In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains ".NET Core how to use C# to scan and read the text in the picture". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn ".NET Core how to use C# to scan and read the text in the picture".
Program test environment:
Visual Studio version requires no less than 2017
Image scanning tool: Spire.OCR for .NET
Image format: png (the image format here supports JPG, PNG, GIF, BMP, TIFF, etc.)
Scanned picture text: Chinese (can also support Chinese, English, Japanese, Korean, German, French, etc.)
.Net Core 2.1
Detailed steps 1. Create a .net Core console application.
two。 Add dependencies through NuGet
(1) in solution Explorer, right-click on "dependencies" and select "manage NuGet packages".
(2) in the pop-up interface, select "Browse"-enter Spire.OCR in the search box, and click "install"
Select "OK" and "I accept" in the two windows that pop up in turn
(3) after completion, you can view the dependencies that have been added
3. Copy dll
Case 1: if it is .net core 3.0 or later, copy the 6 dll files shown in the figure from the bin\ Debug\ netcoreapp3.0\ runtimes\ win-x64\ native folder to the program running path bin\ Debug\ netcoreapp3.0
Case 2: if it is below. Net core 3.0 (such as the test environment in this text), you need to download the Spire.OCR package, extract it, and copy the 6 dll in the file path Spire.OCR\ Spire.OCR_Dependency\ x64 to the program running path F:\ VS2017project\ ReadTextFromImg_OCR\ ReadTextFromImg_OCR\ bin\ Debug\ netcoreapp2.1.
4. After completing the above operations, you can refer to the following code to read the text content on the picture.
Using Spire.OCR;using System.IO;namespace ReadTextFromImg_OCR {class Program {static void Main (string [] args) {OcrScanner scanner = new OcrScanner (); scanner.Scan ("image.png"); File.WriteAllText ("output.txt", scanner.Text.ToString ());}
Test picture:
Text reading result:
★★★ Note: currently, the OCR control only supports 64-bit systems!
Thank you for your reading, the above is the content of ".NET Core how to use C# to scan and read the text in the picture". After the study of this article, I believe you have a deeper understanding of how .NET Core uses C# to scan and read the text in the picture, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.