Sunday, September 28, 2014

How to Use Tesseract OCR in Java

Instructions

    1

    Right-click the Java file you want to use to create the OCR document. Click "Open With" and select your preferred Java editor.

    2

    Add the OCR library namespace at the top of the file. Copy and paste the following code to your source code file:

    com.tplan.robot.imagecomparison.tesseractocr

    3

    Create the code that scans characters to the file. For instance, the following code loops through each character in a file and writes it to an image file:

    Var lines=0
    Compareto method="tocr" cmparea="x:33,y:2,w:200,h:22"
    for (i=1; i Typeline "_TOCR_LINEi"

    4

    Click the Java editor's "Save" button and click "Run" to execute the code in a Java debugger.



No comments:

Post a Comment