Hire a web Developer and Designer to upgrade and boost your online presence with cutting edge Technologies

Friday, October 21, 2022

Convert image to text using CMD Command Prompt, Tesseract Optical Character Recognition (OCR)

 

1.Download and Install the Tesseract ‘tesseract-ocr-setup-3.02.02.exe’.


Install in any location you want,

Eg. C:\OCR

2.After installing verify all the below files are available in the installed directory, we are going to use tesseract.exe for the operation.


3.Collect the image and save that we need to OCR to any location in the PC

Eg: C:\Image_to_OCR.jpg


4.Open Command Prompt CMD in Administrator mode,

5.The Command to execute the OCR is,

tesseract <imagename> <outputname>

Where <imagename> you want to give the path of image and <outputname> you want to give path of output text file. Note that the out put is always text file as from Tesseract Documentation.
So the command for our testing will be,

"C:\OCR\tesseract" "C:\Image_to_OCR.jpg" "C:\out"

6.Now run the command in CMD

7.Now it will create an output file in C: as out.txt

8.The possible error which I got on testing was Cannot Open input file. It was caused when I missed to give the image name ,

Tesseract Open Source OCR Engine v3.02 with Leptonica
Cannot open input file:
ie. “C:\OCR\tesseract” “C:\ ” “C:\out”
Or
“C:\OCR\tesseract” “C:\out”

No comments:

Post a Comment