OCRツール Windows用Tesseract Ocr(コード例のチュートリアル) Kannapat Udonpant 更新日:7月 28, 2025 Download IronOCR NuGet Download テキストの検索と置換 テキストと画像のスタンプ Start Free Trial Copy for LLMs Copy for LLMs Copy page as Markdown for LLMs Open in ChatGPT Ask ChatGPT about this page Open in Gemini Ask Gemini about this page Open in Grok Ask Grok about this page Open in Perplexity Ask Perplexity about this page Share Share on Facebook Share on X (Twitter) Share on LinkedIn Copy URL Email article What is Tesseract OCR? Tesseract is an optical character recognition engine that can be used on a variety of operating systems. It is a free software, released under the Apache License. In this guide, I will take you through the steps that I followed in order to install Tesseract on my Windows 10 machine. The major version 5 is the current stable version and began with release 5.0. 0 on November 30, 2021. How to Use Tesseract OCR in Windows Install Tesseract OCR on a Windows 10 using .exe file Configure the Tesseract installation Add installation path to environment variables Run Tesseract OCR for Windows on a test image Use C# library for more intuitive APIs and advance methods in windows Step 1: Install Tesseract OCR in Windows 10 using .exe File: To install language data: sudo port install tesseract -<langcode> A list of langcodes is found on the MacPorts Tesseract page Homebrew. The first step to install Tesseract OCR for Windows is to download the .exe installer that corresponds to your machine's operating system. Step 2: Configure Installation Next, we'll need to configure the Tesseract installation. If you're feeling confident and only want to run Tesseract OCR for Windows with the default language set to English, running through the installation screens with all of the default options selected should work. Installer Language This is just the language for the dialog boxes and help information. If we want to, we can run Tesseract OCR for Windows in multiple languages: Installer language for Tesseract OCR for Windows Tesseract OCR Setup The setup screen recommends that all other applications are closed before continuing with the installation. The Tesseract OCR for Windows installation screen. Choose Install Location Next, we'll choose the installation location. Before proceeding to the next step, make sure to copy the install location to a .txt file. We will need to add the installation location to our machine's environment variables once the installation is complete. Choose the installation location. Choose Components By default, the ScrollView, Training Tools, Shortcuts creation, and Language data are all selected. Unless you have a specific reason not to install these, we will want to keep all of these selected. Default Tesseract OCR for Windows installation components. If we scroll down and expand the ‘Additional script data’, we will see that we have the option to download and install additional script data. This can be helpful in improving the accuracy of text extraction from certain scripted languages. It’s up to you if you want to install these. Optional script installation components. Choose the Start Menu Folder In the last step of the installation, we’ll be asked to choose the start menu folder for Tesseract OCR for Windows shortcuts. I’ve left mine set to the default name: ‘Tesseract-OCR’. Choose the start menu folder for the Tesseract OCR for Windows shortcuts. After we click install, Tesseract OCR for Windows will begin installing. Our next step is to add the installation path to our machine’s environment variables. Step 3: Add Installation Path to Environment Variables Control Panel To add the installation location to our environment variables, go to the Start menu and search for 'environment variables'. You should see a result to edit the system environment variables. If you don’t, you can always use the following steps: Start menu > Control Panel > Edit the system environment variables. Searching for ‘environment variables’ System Properties When presented with the ‘System Properties’ dialog box, we’ll want to make sure the Advanced tab is clicked, then click the Environment Variables button towards the bottom right of the screen. Environment Variables Under system variables, we will click the Edit button. When presented with the "Edit environment variable" screen, click the New button, and paste in your Tesseract OCR installation path that we copied earlier in Step 2. Once you’ve done this, click the ‘OK‘ button. Add Tesseract OCR for Windows Installation Directory to Environment Variables That’s it! Now that we’ve run the .exe installer and added the Tesseract OCR for Windows install location to our environment variables, we can test that our installation is working by running Tesseract on a test image. Step 4: Run Tesseract OCR for Windows on a Test Image To test that Tesseract OCR for Windows was installed successfully, open the command prompt on your machine, then run the Tesseract command. You should see an output with a quick explanation of Tesseract’s usage options. Checking successful installation of Tesseract OCR for Windows Congratulations! You’ve successfully installed Tesseract OCR for Windows on your machine. Advantages of using IronOCR to do OCR Work: IronOCR provides Tesseract OCR on Mac, Windows, Linux, Azure and Docker for: .NET Framework 4.0 + .NET Standard 2.0 + .NET Core 2.0 + .NET 5 Mono for macOS and Linux Xamarin for macOS IronOCR reads text, barcodes, and QR codes from all major image and PDF formats using the latest Tesseract 5 engine. This library adds OCR functionality to Desktop, Console, and Web applications in minutes. It supports 125+ international languages. Licenses start from $799. Step 1: Install the latest version of IronOCR Install DLL Download the IronOcr DLL directly to your machine. Install NuGet Alternatively, you can install it through NuGet with the following command: Install-Package IronOcr Step 2: Apply Your License Key Set your IronOCR license key using code Add this code to the startup of your application before IronOCR is used. IronOcr.Installation.LicenseKey = "IRONOCR-MYLICENSE-KEY-1EF01"; IronOcr.Installation.LicenseKey = "IRONOCR-MYLICENSE-KEY-1EF01"; IronOcr.Installation.LicenseKey = "IRONOCR-MYLICENSE-KEY-1EF01" $vbLabelText $csharpLabel Step 3: Test your Key Test if your key has been installed correctly. bool isValidLicense = IronOcr.License.IsValidLicense("IRONOCR-MYLICENSE-KEY-1EF01"); bool isValidLicense = IronOcr.License.IsValidLicense("IRONOCR-MYLICENSE-KEY-1EF01"); Dim isValidLicense As Boolean = IronOcr.License.IsValidLicense("IRONOCR-MYLICENSE-KEY-1EF01") $vbLabelText $csharpLabel Get started with the project // PM > Install-Package IronOcr // using IronOcr; var Ocr = new IronTesseract(); // Set the recognition language to English Ocr.Language = OcrLanguage.English; using (var Input = new OcrInput()) { // Add an example image to the OCR input Input.Add(@"img\example.tiff"); // Optional: Clean the image before processing // Input.DeNoise(); // Input.Deskew(); // Read the text from the image IronOcr.OcrResult result = Ocr.Read(Input); // Output the recognized text Console.WriteLine(result.Text); // Explore the OcrResult using IntelliSense } // PM > Install-Package IronOcr // using IronOcr; var Ocr = new IronTesseract(); // Set the recognition language to English Ocr.Language = OcrLanguage.English; using (var Input = new OcrInput()) { // Add an example image to the OCR input Input.Add(@"img\example.tiff"); // Optional: Clean the image before processing // Input.DeNoise(); // Input.Deskew(); // Read the text from the image IronOcr.OcrResult result = Ocr.Read(Input); // Output the recognized text Console.WriteLine(result.Text); // Explore the OcrResult using IntelliSense } ' PM > Install-Package IronOcr ' using IronOcr; Dim Ocr = New IronTesseract() ' Set the recognition language to English Ocr.Language = OcrLanguage.English Using Input = New OcrInput() ' Add an example image to the OCR input Input.Add("img\example.tiff") ' Optional: Clean the image before processing ' Input.DeNoise(); ' Input.Deskew(); ' Read the text from the image Dim result As IronOcr.OcrResult = Ocr.Read(Input) ' Output the recognized text Console.WriteLine(result.Text) ' Explore the OcrResult using IntelliSense End Using $vbLabelText $csharpLabel How to Use Tesseract OCR in C# for .NET? Install Google Tesseract and IronOCR for .NET into Visual Studio Check the latest builds in C# Review accuracy and image compatibility Test performance and API function Consider Multi-Language Support Code Example for .NET OCR Usage — Extract Text from Images in C# Use NuGet Package Manager to install the IronOCR NuGet Package into your Visual Studio solution. // PM > Install-Package IronOcr // using IronOcr; var Ocr = new IronTesseract(); // Set the recognition language to English Ocr.Language = OcrLanguage.English; using (var Input = new OcrInput()) { // Add an example image to the OCR input Input.Add(@"img\example.tiff"); // Optional: Clean the image before processing // Input.DeNoise(); // Input.Deskew(); // Read the text from the image IronOcr.OcrResult result = Ocr.Read(Input); // Output the recognized text Console.WriteLine(result.Text); // Explore the OcrResult using IntelliSense } // PM > Install-Package IronOcr // using IronOcr; var Ocr = new IronTesseract(); // Set the recognition language to English Ocr.Language = OcrLanguage.English; using (var Input = new OcrInput()) { // Add an example image to the OCR input Input.Add(@"img\example.tiff"); // Optional: Clean the image before processing // Input.DeNoise(); // Input.Deskew(); // Read the text from the image IronOcr.OcrResult result = Ocr.Read(Input); // Output the recognized text Console.WriteLine(result.Text); // Explore the OcrResult using IntelliSense } ' PM > Install-Package IronOcr ' using IronOcr; Dim Ocr = New IronTesseract() ' Set the recognition language to English Ocr.Language = OcrLanguage.English Using Input = New OcrInput() ' Add an example image to the OCR input Input.Add("img\example.tiff") ' Optional: Clean the image before processing ' Input.DeNoise(); ' Input.Deskew(); ' Read the text from the image Dim result As IronOcr.OcrResult = Ocr.Read(Input) ' Output the recognized text Console.WriteLine(result.Text) ' Explore the OcrResult using IntelliSense End Using $vbLabelText $csharpLabel IronOCR Tesseract for C# With IronOCR, all Tesseract installation happens entirely using the NuGet Package Manager. Install-Package IronOcr Tesseract 5 API in IronOCR Tesseract To date, IronTesseract is the only known implementation of Tesseract 5 for .NET Framework or Core. // using IronOcr; var Ocr = new IronTesseract(); // nothing to configure using (var Input = new OcrInput(@"images\image.png")) { var result = Ocr.Read(Input); // Output the recognized text Console.WriteLine(result.Text); } // using IronOcr; var Ocr = new IronTesseract(); // nothing to configure using (var Input = new OcrInput(@"images\image.png")) { var result = Ocr.Read(Input); // Output the recognized text Console.WriteLine(result.Text); } ' using IronOcr; Dim Ocr = New IronTesseract() ' nothing to configure Using Input = New OcrInput("images\image.png") Dim result = Ocr.Read(Input) ' Output the recognized text Console.WriteLine(result.Text) End Using $vbLabelText $csharpLabel Tesseract 4 API in IronOCR Tesseract // using IronOcr; var Ocr = new IronTesseract(); // Specify the version of Tesseract Ocr.Configuration.TesseractVersion = TesseractVersion.Tesseract4; using (var Input = new OcrInput(@"images\image.png")) { var result = Ocr.Read(Input); // Output the recognized text Console.WriteLine(result.Text); } // using IronOcr; var Ocr = new IronTesseract(); // Specify the version of Tesseract Ocr.Configuration.TesseractVersion = TesseractVersion.Tesseract4; using (var Input = new OcrInput(@"images\image.png")) { var result = Ocr.Read(Input); // Output the recognized text Console.WriteLine(result.Text); } ' using IronOcr; Dim Ocr = New IronTesseract() ' Specify the version of Tesseract Ocr.Configuration.TesseractVersion = TesseractVersion.Tesseract4 Using Input = New OcrInput("images\image.png") Dim result = Ocr.Read(Input) ' Output the recognized text Console.WriteLine(result.Text) End Using $vbLabelText $csharpLabel Why IronOCR Is Better Than Tesseract: ACCURACY TESSERACT: If Tesseract encounters an image that is rotated, skewed, is of a low DPI, scanned, or has background noise, it becomes almost impossible for Tesseract to get data from that image. In addition, Tesseract will also take a very long time to process that document before providing you with nonsensical information. IRONOCR: IronOCR takes this headache away. Users often achieve 99.8-100% accuracy with minimal configuration. IMAGE COMPATIBILITY TESSERACT: Only accepts Leptonica PIX image format which is an IntPtr C++ object in C#. PIX objects are not managed memory — and failure to handle them with care in C# results in memory leaks. IRONOCR: Images are memory managed. PDF & Tiff supported. System.Drawing, Stream, and Byte Array are included for every file format. Broad image support: PDF Documents PDF Pages MultiFrame TIFF files JPEG & JPEG2000 GIF PNG System.Drawing.Image Binary image Data (byte []) And many more... PERFORMANCE TESSERACT: Google Tesseract can perform fast and accurate results if properly tuned and input images have been preprocessed using Photoshop or ImageMagick. IRONOCR: The IronOcr .NET Tesseract DLL works accurately and at speed for most images out of the box. We have implemented multithreading to make use of the multi-core processors that most machines now use. Even low-resolution images generally work with a high degree of accuracy in your program. No Photoshop required. API TESSERACT: We have two free choices: Work with Interop layers — many that are found on GitHub are out of date, have unresolved tickets, memory leaks, and Console warnings. May not support .NET Core or Standard. Work with the command line EXE — difficult to deploy and constantly interrupted by virus scanners and security policies. IRONOCR: A managed and tested .NET Library for Tesseract called IronTesseract. Fully documented with IntelliSense support. LANGUAGE TESSERACT: Supports only 100 languages. IRONOCR: Supports 125+ languages. Conclusion Tesseract is an excellent resource for C++ developers, but it is not a complete OCR library for .NET. Scanned or photographed images need to be processed so as to be orthogonal, standardized, high-resolution, and free of digital noise before Tesseract can accurately work with them. In contrast, IronOCR can do this and more, with just a single line of code. It is true that IronOCR uses Tesseract for its internal OCR engine, a very finely-tuned Tesseract, built for C#, with a lot of performance improvements and features added as standard. Kannapat Udonpant 今すぐエンジニアリングチームとチャット ソフトウェアエンジニア ソフトウェアエンジニアになる前に、Kannapatは北海道大学で環境資源の博士号を修了しました。博士号を追求する間に、彼はバイオプロダクションエンジニアリング学科の一部である車両ロボティクスラボラトリーのメンバーになりました。2022年には、C#のスキルを活用してIron Softwareのエンジニアリングチームに参加し、IronPDFに注力しています。Kannapatは、IronPDFの多くのコードを執筆している開発者から直接学んでいるため、この仕事を大切にしています。同僚から学びながら、Iron Softwareでの働く社会的側面も楽しんでいます。コードやドキュメントを書いていない時は、KannapatはPS5でゲームをしたり、『The Last of Us』を再視聴したりしていることが多いです。 関連する記事 更新日 6月 22, 2025 Power Automate OCR(開発者向けチュートリアル) この光学文字認識技術は、ドキュメントのデジタル化、自動化されたPDFデータの抽出とエントリ、請求書処理、スキャンPDFの検索可能化に応用されます。 詳しく読む 更新日 6月 22, 2025 Easyocr対Tesseract (OCR機能の比較) EasyOCR、Tesseract OCR、Keras-OCR、IronOCRのような人気のOCRツールやライブラリは、現代のアプリケーションにこの機能を統合するためによく利用されています。 詳しく読む 更新日 6月 22, 2025 画像をテキストに変換する方法 現代のデジタル時代では、画像ベースのコンテンツを読みやすい編集可能で検索可能なテキストに変換することが重要です。 詳しく読む オンラインOCRコンバータ — 無料オンラインツールWindows 11でのOCR(無料のオ...
更新日 6月 22, 2025 Power Automate OCR(開発者向けチュートリアル) この光学文字認識技術は、ドキュメントのデジタル化、自動化されたPDFデータの抽出とエントリ、請求書処理、スキャンPDFの検索可能化に応用されます。 詳しく読む
更新日 6月 22, 2025 Easyocr対Tesseract (OCR機能の比較) EasyOCR、Tesseract OCR、Keras-OCR、IronOCRのような人気のOCRツールやライブラリは、現代のアプリケーションにこの機能を統合するためによく利用されています。 詳しく読む