Skip to content

Commit

Permalink
Include OpenCV/NumPy documentation example
Browse files Browse the repository at this point in the history
  • Loading branch information
int3l authored Jan 8, 2018
1 parent 7a941a7 commit 8f8ade1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@ USAGE
print(pytesseract.image_to_string(Image.open('test.png')))
print(pytesseract.image_to_string(Image.open('test-european.jpg'), lang='fra'))
Support for OpenCV image/NumPy array objects

.. code-block:: python
import cv2
img = cv2.imread('/**path_to_image**/digits.png')
print(pytesseract.image_to_string(img))
# OR explicit beforehand converting
print(pytesseract.image_to_string(Image.fromarray(img))
Add the following config, if you have tessdata error like: "Error opening data file..."
.. code-block:: python
Expand Down

0 comments on commit 8f8ade1

Please sign in to comment.