C # reads text from the image

Source: Internet
Author: User

Today, the ability to read text on an image is implemented through C #.

1. Environment Readiness:

1). Download Microsoft Office SharePoint Designer 2007.

2). Please refer to kb:https://support.microsoft.com/kb/982760 for installation. You only need to install Office Tools under the Microsoft office Document Imaging option.

2. In the project, reference the Microsoft Office Document Imaging 12.0 Type Library,

Refer to the following code for a specific read method:

        Private Static stringExtracttextfromimage (stringFilePath) {Document modidocument=NewDocument ();            Modidocument.create (FilePath); MODIDOCUMENT.OCR (Milanguages.milang_english,true,true); MODI. Image Modiimage= (modidocument.images[0] asMODI.            Image); stringExtractedtext =ModiImage.Layout.Text;            Modidocument.close (); returnExtractedtext; }

Just pass in the image address to get the text on the picture.
But I also found that Modi has some flaws that can only be read in one language at a time. If you want another way, please note in the comments. Thank you for reading.

C # reads text from the image

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.