Verification Code Identification related commands (from www.sysoft.net.cn)

Source: Internet
Author: User

1. Start-run-cmd, enter into DOS operating environment. 2. Go to the merged diagram and the path: such as CD E:\propic3. Input: Tesseract.exe mainpic.tif (This is the name of the processed image) Mainpic (this is the result name, can be assigned randomly, preferably directly specified with the picture) Bach.nochop Makebox carriage return, Until the picture processing is complete. 4. When finished, if there is no error, you can see that there is a Mainpic.box file generated in the same directory, at this time, open again Jtessboxeditor.jar, open by file-when selecting Mainpic, the initial recognition results for Mainpic.tif will appear. The work we do at this point is to carefully process the error correction to form the sample library we need. 5. In order to ensure that the above sample library has been saved, go back to the command line and enter Tesseract.exe mainpic.tif mainpic nobach box.train Enter confirmation. 6. Command-Line Input command: Unicharset_extractor.exe mainpic.box7. Make sure to create a new file manually in the current operation directory, font_properties, note that the file cannot have an extension. Write in file Mainpic 1 0 0 1 08. Command Line input: Cntraining.exe mainpic.tr9. Command Line Input: mftraining.exe-f font_properties-u unicharset mainpic.tr10. At this point, in the current folder will produce several files, unicharset,inttemp,normproto,pfftable these filenames prefixed with mainpic.11. Command Line Input: Combine_tessdata mainpic. The generated mainpic.traineddata is the sample library used for the final identification. 12, the introduction of API class library, for. NET recognition:Tesseractdotnet_v301_r590.zip package tesseract.dll file extracted, copied into the current project, reference-Add reference-Select the file. 13. Program code:private void Btncrckt_click (object sender, EventArgs e)        {OpenFileDialog ofd = new OpenFileDialog ();//Create File dialog boxif (ofd. ShowDialog () = = DialogResult.OK)            {string file = Ofd. filename;//Get file nameusing (Bitmap bit = (Bitmap) image.fromfile (file))//Create image file by file name                {using (Bitmap newbit = processbitmap (bit))//The new image is obtained by preprocessing the picture method                    {tesseractprocessor tesprocess = new Tesseractprocessor ();//Build Tesseractprocess Objecttesprocess. Setpagesegmode (epagesegmode.psm_single_line);//Set Page modetesprocess. Init (@ "E:\propic\last\", "Mainpic", (int) eocrenginemode.oem_default);//Set the location of the identity library and the training library name. string result = Tesprocess. recognize (newbit);//Specify image file for identificationMessageBox.Show (result);                    }                }            }Else            {return;            }        }

Verification Code Identification related commands (from www.sysoft.net.cn)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.