Skip to content

Commit

Permalink
update rit text recognition README
Browse files Browse the repository at this point in the history
Signed-off-by: GuillaumeFalourd <[email protected]>
  • Loading branch information
GuillaumeFalourd committed Feb 16, 2021
1 parent 5025671 commit c7171ab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 6 additions & 3 deletions detect/text-on-image/src/formula/formula.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
import os
import re

# List of available languages
# print(pytesseract.get_languages(config=''))

def run(image_path):

# Check if Tesseract is installed
try:
output = os.popen("which tesseract").read()
tesseract_match = re.match("(.*?)(?=\\n)", output)
Expand All @@ -16,6 +15,7 @@ def run(image_path):
except:
print("You don't seem to have Tesseract installed. Have a look here: https://tesseract-ocr.github.io/tessdoc/Downloads.html")

# Use Pytesseract (a Tessaract warper) to extract Text from Image
try:
text = pytesseract.image_to_string(Image.open(image_path))
print("\033[1m✅ Successfully convert the image into text:\033[0m")
Expand All @@ -24,3 +24,6 @@ def run(image_path):
print("\033[1m❌ Couldn't converting the image into text:\033[0m")
print("Please, check the image path and try again.")
print("If the problem persists, open an ISSUE on https://github.com/GuillaumeFalourd/formulas-python")

# List of available languages
# print(pytesseract.get_languages(config=''))
2 changes: 2 additions & 0 deletions text/recognition/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ A formula that allows to detect text on image or through webcam.
This formula gathered 2 formulas in one:
- [Image Text Detection](https://github.com/GuillaumeFalourd/formulas-python/tree/master/detect/text-on-image): `rit detect image-to-text`
- [Live Text Detection](https://github.com/GuillaumeFalourd/formulas-python/tree/master/detect/text-on-video): `rit detect text-on-video`

When using the Webcam, type the `Q key` on the **Text Detection Window** to close it and end the formula execution.

0 comments on commit c7171ab

Please sign in to comment.