Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Main.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
threshold = (160,160,160)

# Open input image in grayscale mode and get its pixels.
img = Image.open("./in/captcha.svl").convert("LA")
img = Image.open("./in/image7.png").convert("LA")

# multiply each pixel by 1.2
out = img.point(lambda i: i * 1.3)
Expand All @@ -33,12 +33,12 @@
newImg.putdata(newPixels)
newImg.save("./out/newImage.jpg")

pytesseract.pytesseract.tesseract_cmd = r'./Tesseract-OCR/tesseract' # https://github.com/tesseract-ocr/tesseract/wiki/4.0-with-LSTM#400-alpha-for-windows
#pytesseract.pytesseract.tesseract_cmd = r'./Tesseract-OCR/tesseract' # https://github.com/tesseract-ocr/tesseract/wiki/4.0-with-LSTM#400-alpha-for-windows

# Simple image to string
# print(pytesseract.image_to_string(Image.open('test.png')))
print("-----------------------")
# print(pytesseract.image_to_string(Image.open('captcha (2).svl')))
# https://stackoverflow.com/questions/44619077/pytesseract-ocr-multiple-config-options
print(pytesseract.image_to_string(Image.open('./out/newImage.jpg'), lang='eng', config='--psm 10 --oem 3 -c tessedit_char_whitelist=1234567890 --tessdata-dir="./Tesseract-OCR/tessdata"'))
print(pytesseract.image_to_string(Image.open('./out/newImage.jpg'), lang='eng', config='--psm 10 --oem 3 -c tessedit_char_whitelist=1234567890'))
print("-----------------------")
44 changes: 0 additions & 44 deletions Main_For_Ubuntu.py

This file was deleted.

Binary file removed Tesseract-OCR/ambiguous_words.exe
Binary file not shown.
Binary file removed Tesseract-OCR/classifier_tester.exe
Binary file not shown.
Binary file removed Tesseract-OCR/cntraining.exe
Binary file not shown.
Binary file removed Tesseract-OCR/combine_tessdata.exe
Binary file not shown.
Binary file removed Tesseract-OCR/dawg2wordlist.exe
Binary file not shown.
42 changes: 0 additions & 42 deletions Tesseract-OCR/doc/AUTHORS

This file was deleted.

21 changes: 0 additions & 21 deletions Tesseract-OCR/doc/COPYING

This file was deleted.

43 changes: 0 additions & 43 deletions Tesseract-OCR/doc/README

This file was deleted.

Loading