他のコンポーネントと比較する IronOCRとDynamsoft OCRの比較 Kannapat Udonpant 更新日:8月 20, 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 光学文字認識、またはOCRは、手書きまたは印刷されたテキストの認識とデジタル化を伴うデータ入力プロセスです。 これは、印刷されたテキストのデジタル写真を他のプログラムで使用可能な文字や数字に変換するために画像解析を使用するコンピュータ技術です。 テキストは文字コードに変換され、コンピュータ上で検索および変更できるようになります。 かつてはすべてのドキュメントが物理的で、将来はすべてのドキュメントがデジタルになるかもしれませんが、現在は変革の途中にあります。 物理的なドキュメントとデジタルドキュメントはこの移行期に共存しており、そのためOCRのような技術は双方向の変換において不可欠です。 ドキュメントの復元、データ入力、アクセシビリティーはOCRの用途の一部に過ぎません。 OCRアプリケーションの大半はスキャンされた書類から派生していますが、写真も時折使用されます。 OCRは多くの場合、資料を再入力する以外の唯一の選択肢であるため、貴重な時間節約になります。 以下はOCRの使用例です: スキャンされたドキュメント、例えばファックスから編集可能なテキストファイルを復元する。 書籍のスキャンを使用して検索可能で編集可能な電子書籍を作成する。 スクリーンショット画像を使用してテキストを検索および変更する。 テキスト読み上げ技術を使用して視覚障害者が書籍を読む。 これらはOCRの用途の一部に過ぎませんが、広範な業界における技術の柔軟性を示しています。 ほとんどすべての企業の従業員は日常的に大量のドキュメントに依存しているため、ビジネス用途はOCRシステム開発の重要な考慮事項です。 本記事では、最も強力な2つのOCRリーダーを比較します: IronOCR Dynamsoft OCR IronOCRとDynamsoft OCRは、スキャンされた画像の変換およびPDFドキュメントのOCR処理をサポートする2つの.NET OCRライブラリです。 数行のコードで画像を検索可能なテキストに変換できます。 個々の単語、文字、および段落を取得することもできます。 IronOCR — 優れた特徴 IronOCRは、正確にスキャンされていない画像やPDFドキュメントからテキストを検出、読み取り、解釈する独自の能力を提供します。 IronOCRは、たとえ常に最速であるわけではなくても、低品質のスキャンを自動でシャープにし、傾斜、歪み、背景ノイズ、視点の問題を低減し、解像度とコントラストを向上させることで、ドキュメントや写真からテキストを抽出する最も簡単な方法を提供します。 IronOCRは、開発者が単一または複数ページのスキャンされた画像を送信できるようにし、それがすべてのテキスト、バーコード、およびQR情報を返します。 OCRライブラリのクラスセットは、Webベース、デスクトップ、またはコンソールアプリケーションにOCR機能を追加します。 Tesseract OCR C#、およびnetアプリJPG、PNG、TIFF、PDF、GIF、BMPは入力として使用できるフォーマットの一例です。 IronOCRの光学式文字認識(OCR)エンジンは、多くの一般的なフォント、イタリック体、ウエイト、およびアンダーラインで用意されたテキストを読み取ることができます。 クロッピングクラスにより、OCRは迅速かつ正確に作業できます。 複数ページのドキュメントを扱う際、IronOCRのマルチスレッドエンジンはOCRを加速します。 IronOCR 機能 Tesseractの管理においては、IronOCRは以下の点でユニークです: 純粋な.NETで箱から出してすぐに動作します Tesseractをマシンにインストールする必要はありません 最新のエンジンを実行します:Tesseract 5(およびTesseract 4 & 3) すべての.NETプロジェクトで使用可能:.NET Framework 4.5 +、.NET Standard 2 +、.NET Core 2, 3 & .NET 5 従来のTesseractに比べて精度と速度が向上しています Xamarin、Mono、Azure、Dockerをサポートしています NuGetパッケージを使用して複雑なTesseract辞書システムを管理します PDF、MultiFrame Tiffs、そしてすべての主要な画像フォーマットを設定なしでサポートします 低品質および傾斜したスキャンを修正してTesseractから最良の結果を得ることができます。 Dynamsoft OCR — 機能 Dynamsoft.NET OCRライブラリは、高速で信頼性のある光学式文字認識を提供する.NETコンポーネントです。 C#またはVB.NETで.NETデスクトップアプリケーションを作成するために使用されます。 基本的なOCR APIを使用すると、PDFや写真の不要なテキストをデジタルテキストに変換して編集、検索、アーカイブ、その他に使用するコードを簡単に作成できます。 スキャナーおよびその他のTWAIN準拠デバイスから画像を取得する方法: ネイティブ、バッファーメモリ、ディスクファイル画像転送メカニズムがサポートされています。 自動ドキュメントフィーダーを使用してバッチスキャンが可能です(ADF)。 TWAIN属性を使用して一般的なデバイスの機能を変更できます。 IfAutoFeed、IfAutoScan、解像度、BitDepth、明るさ、コントラスト、単位、両面、その他の機能を変更可能です。 白紙検出をサポートします。 スキャナープロファイルの変更と保存が可能です。 UVCおよびWIA準拠のWebcamから画像をキャプチャ: 選択されたWebカメラから画像をキャプチャする際にライブビデオフィードを表示します。 カメラの設定をカスタマイズします:明るさ、コントラスト、色相、飽和、シャープネス、ガンマ、白バランス、バックライト補正、ゲイン、カラーイネーブル、ズーム、フォーカス、露出、絞り、パン、ティルト、ロール。 堅牢な画像の読み込み/表示 BMP、JPEG、PNG、TIFF、およびマルチページTIFF形式の画像を読み込むことができます。 画像のズームインとズームアウトがサポートされています。 画像はローカルドライブ、FTPサーバー、HTTPサーバー、またはデータベースから取得できます。 .NETイメージングコンポーネントの最も包括的なセットの1つを使用してBMP、JPEG、PNG、およびTIFFの画像デコードを行います。 保存およびアップロード/ダウンロード ファイルストリーム経由で画像を読んだり書いたりできます。 キャプチャされた画像をBMP、JPEG、PNG、TIFF、またはマルチページTIFFとしてローカルドライブ、Webサーバー、またはデータベースに保存できます。 RLE、G3/G4、LZW、PackBits、TIFF圧縮がサポートされています。 HTTPSアップロードとダウンロードをサポートしています。 One of the most extensive sets of.NET imaging components available supports BMP, JPEG, PNG, and TIFF image encoding. Allows you to attach newly obtained photos to existing TIFF files. Read Text from Scanned PDFs or Other Images in ASP.NET (Optical Character Recognition) Customers want work to be completed quickly in today's fast-paced world. Customers with urgent projects contact us frequently. Our technology can simply recognize the content of an image and convert it to text if the project entails scanning papers that contain images. Optical Character Recognition (OCR) saves your firm time and money while also reducing data entry errors. Using IronOCR IronOCR makes use of the IronOcr.IronTesseract class to perform its OCR conversions. We use the IronOcr.IronTesseract class to read text from an image and automatically return its result as a string in this basic example. // PM> Install-Package IronOcr using IronOcr; class Program { static void Main(string[] args) { // Create a new instance of the IronTesseract class var ironOcr = new IronTesseract(); // Read the text from the image var result = ironOcr.Read(@"img\Screenshot.png"); // Output the text to the console Console.WriteLine(result.Text); } } // PM> Install-Package IronOcr using IronOcr; class Program { static void Main(string[] args) { // Create a new instance of the IronTesseract class var ironOcr = new IronTesseract(); // Read the text from the image var result = ironOcr.Read(@"img\Screenshot.png"); // Output the text to the console Console.WriteLine(result.Text); } } ' PM> Install-Package IronOcr Imports IronOcr Friend Class Program Shared Sub Main(ByVal args() As String) ' Create a new instance of the IronTesseract class Dim ironOcr = New IronTesseract() ' Read the text from the image Dim result = ironOcr.Read("img\Screenshot.png") ' Output the text to the console Console.WriteLine(result.Text) End Sub End Class $vbLabelText $csharpLabel As a result, the following paragraph is 100 percent accurate: IronOCR Simple Example In this simple example we will test the accuracy of our C# OCR library to read text from a PNG Image. This is a very basic test, but things will get more complicated as the tutorial continues. The quick brown fox jumps over the lazy dog Although it may appear simple on the surface, there is sophisticated behavior going on behind the surface: scanning the image for alignment, quality, and resolution, looking at its attributes, optimizing the OCR engine, and finally reading the text as a human might. OCR is a difficult task for a machine to do, and reading speeds may be comparable to that of a human. To put it another way, OCR is not a quick procedure. In this case, though, it is absolutely correct. In most real-world scenarios, developers will want their projects to run as quickly as possible. In this scenario, we propose that you utilize the IronOCR add-ons namespace's OcrInput and IronTesseract classes instead. You can set the exact features of an OCR job with OcrInput, such as: JPEG, TIFF, GIF, BMP, and PNG are just a few of the image formats that can be used Importing PDF documents in their entirety or in portions Enhancing the contrast, resolution, and size of the image Rotation, scan noise, digital noise, skew, and negative picture correction IronTesseract Choose from hundreds of pre-packaged languages and dialects Use Tesseract 5, 4, or 3 OCR engines right away If we're looking at a screenshot, a snippet, or the entire document, specify the document type Recognize barcodes Searchable PDFs, Hocr HTML, a DOM, and Strings are all options for OCR results using IronOcr; class Program { static void Main(string[] args) { // Create an instance of IronTesseract var ocr = new IronTesseract(); // Use the OcrInput class to read from an image file using (var input = new OcrInput(@"img\Potter.tiff")) { // Perform the OCR operation var result = ocr.Read(input); // Output the recognized text to the console Console.WriteLine(result.Text); } } } using IronOcr; class Program { static void Main(string[] args) { // Create an instance of IronTesseract var ocr = new IronTesseract(); // Use the OcrInput class to read from an image file using (var input = new OcrInput(@"img\Potter.tiff")) { // Perform the OCR operation var result = ocr.Read(input); // Output the recognized text to the console Console.WriteLine(result.Text); } } } Imports IronOcr Friend Class Program Shared Sub Main(ByVal args() As String) ' Create an instance of IronTesseract Dim ocr = New IronTesseract() ' Use the OcrInput class to read from an image file Using input = New OcrInput("img\Potter.tiff") ' Perform the OCR operation Dim result = ocr.Read(input) ' Output the recognized text to the console Console.WriteLine(result.Text) End Using End Sub End Class $vbLabelText $csharpLabel We can use this even on a medium-quality scan with 100% accuracy. As you can see, reading text (and, if desired, barcodes) from a scanned image such as a TIFF was rather easy. The accuracy of this OCR job is 100 percent. Next, we will try a much lower quality scan of the same page, at a low DPI and with lots of distortion and digital noise, as well as damage to the original paper. This is where IronOCR truly shines in comparison to other OCR libraries such as Tesseract, and we'll find that other OCR projects avoid discussing the use of OCR on real-world scanned images rather than unrealistically 'perfect' test cases created digitally in order to achieve 100% OCR accuracy. using IronOcr; class Program { static void Main(string[] args) { // Create an instance of IronTesseract var ocr = new IronTesseract(); // Use the OcrInput class to read from a low-quality image file using (var input = new OcrInput(@"img\Potter.LowQuality.tiff")) { // Deskew the image to improve accuracy input.Deskew(); // Perform the OCR operation var result = ocr.Read(input); // Output the recognized text to the console Console.WriteLine(result.Text); } } } using IronOcr; class Program { static void Main(string[] args) { // Create an instance of IronTesseract var ocr = new IronTesseract(); // Use the OcrInput class to read from a low-quality image file using (var input = new OcrInput(@"img\Potter.LowQuality.tiff")) { // Deskew the image to improve accuracy input.Deskew(); // Perform the OCR operation var result = ocr.Read(input); // Output the recognized text to the console Console.WriteLine(result.Text); } } } Imports IronOcr Friend Class Program Shared Sub Main(ByVal args() As String) ' Create an instance of IronTesseract Dim ocr = New IronTesseract() ' Use the OcrInput class to read from a low-quality image file Using input = New OcrInput("img\Potter.LowQuality.tiff") ' Deskew the image to improve accuracy input.Deskew() ' Perform the OCR operation Dim result = ocr.Read(input) ' Output the recognized text to the console Console.WriteLine(result.Text) End Using End Sub End Class $vbLabelText $csharpLabel Without adding Input.Deskew() to straighten the image we get a 52.5% accuracy. This is not good enough. Adding Input.Deskew() brings us to 99.8% accuracy which is almost as accurate as the OCR of a high-quality scan. Using Dynamsoft OCR We will present some code snippets for using Dynamic Web TWAIN to do TWAIN scanning and client-side OCR in JavaScript. Scan Images You may change scanning settings and acquire photos from TWAIN scanners using Dynamic Web TWAIN's simple APIs. function acquireImage() { // Select an available TWAIN scanner DWObject.SelectSourceByIndex(document.getElementById("source").selectedIndex); // Set scanning settings like pixel type, resolution, ADF, etc. DWObject.IfShowUI = false; // Do not show the user interface of the scanner DWObject.PixelType = 1; // Scan in grayscale DWObject.Resolution = 300; DWObject.IfFeederEnabled = true; // Scan from auto feeder DWObject.IfDuplexEnabled = false; DWObject.IfDisableSourceAfterAcquire = true; // Acquire images from scanners DWObject.AcquireImage(); } function acquireImage() { // Select an available TWAIN scanner DWObject.SelectSourceByIndex(document.getElementById("source").selectedIndex); // Set scanning settings like pixel type, resolution, ADF, etc. DWObject.IfShowUI = false; // Do not show the user interface of the scanner DWObject.PixelType = 1; // Scan in grayscale DWObject.Resolution = 300; DWObject.IfFeederEnabled = true; // Scan from auto feeder DWObject.IfDuplexEnabled = false; DWObject.IfDisableSourceAfterAcquire = true; // Acquire images from scanners DWObject.AcquireImage(); } JAVASCRIPT Download the OCR Professional Module To use the OCR Professional module for client-side OCR, you will need to include ocrpro.js in the head and also download the OCR Pro DLL. <script type="text/javascript" src="Resources/addon/dynamsoft.webtwain.addon.ocrpro.js"></script> <script type="text/javascript" src="Resources/addon/dynamsoft.webtwain.addon.ocrpro.js"></script> HTML Make edits to the .js file: // Define base path var CurrentPathName = unescape(location.pathname); var CurrentPath = CurrentPathName.substring(0, CurrentPathName.lastIndexOf("/") + 1); // Download the OCR Pro add-on DWObject.Addon.OCRPro.Download(CurrentPath + "Resources/addon/OCRPro.zip", OnSuccess, OnFailure); // Define base path var CurrentPathName = unescape(location.pathname); var CurrentPath = CurrentPathName.substring(0, CurrentPathName.lastIndexOf("/") + 1); // Download the OCR Pro add-on DWObject.Addon.OCRPro.Download(CurrentPath + "Resources/addon/OCRPro.zip", OnSuccess, OnFailure); JAVASCRIPT Recognize text using OCR Using the JS OCR recognition API to extract text from scanned images is as simple as inserting the code below. // Recognize text from the image at index 0 DWObject.Addon.OCRPro.Recognize(0, GetOCRProInfo, GetErrorInfo); // 0 is the index of the image // Recognize text from the image at index 0 DWObject.Addon.OCRPro.Recognize(0, GetOCRProInfo, GetErrorInfo); // 0 is the index of the image JAVASCRIPT Reading Cropped Regions of Images Both sets of software offer solutions for cropping images for OCR. Reading cropped regions with IronOCR Iron's branch of Tesseract OCR is adept at reading specific regions of images, as shown in the following code sample. We use System.Drawing.Rectangle to describe the exact region of an image to be read in pixels. When dealing with a standardized form that is filled out, and only a portion of the content changes from case to case, this can be really handy. Scanning a Section of a Page: We use System.Drawing.Rectangle to designate a region to read from a document, improving speed and accuracy. using IronOcr; using System.Drawing; class Program { static void Main(string[] args) { // Create an instance of IronTesseract var ocr = new IronTesseract(); using (var input = new OcrInput()) { // Define content area of interest var contentArea = new Rectangle() { X = 215, Y = 1250, Height = 280, Width = 1335 }; // Add the specific region to the input input.AddImage("img/ComSci.png", contentArea); // Perform OCR operation var result = ocr.Read(input); // Output recognized text to console Console.WriteLine(result.Text); } } } using IronOcr; using System.Drawing; class Program { static void Main(string[] args) { // Create an instance of IronTesseract var ocr = new IronTesseract(); using (var input = new OcrInput()) { // Define content area of interest var contentArea = new Rectangle() { X = 215, Y = 1250, Height = 280, Width = 1335 }; // Add the specific region to the input input.AddImage("img/ComSci.png", contentArea); // Perform OCR operation var result = ocr.Read(input); // Output recognized text to console Console.WriteLine(result.Text); } } } Imports IronOcr Imports System.Drawing Friend Class Program Shared Sub Main(ByVal args() As String) ' Create an instance of IronTesseract Dim ocr = New IronTesseract() Using input = New OcrInput() ' Define content area of interest Dim contentArea = New Rectangle() With { .X = 215, .Y = 1250, .Height = 280, .Width = 1335 } ' Add the specific region to the input input.AddImage("img/ComSci.png", contentArea) ' Perform OCR operation Dim result = ocr.Read(input) ' Output recognized text to console Console.WriteLine(result.Text) End Using End Sub End Class $vbLabelText $csharpLabel This results in a 41 percent boost in speed, while also allowing us to be more specific. This is extremely valuable for .NET OCR applications involving documents that are comparable and consistent, including invoices, receipts, checks, forms, expense claims, and so on. When reading PDFs, ContentAreas (OCR cropping) is also supported. Reading cropped regions with Dynamsoft OCR To begin, launch Visual Studio and build a new C# Windows Forms Application, or open an existing one. We will need to include DynamicDotNetTWAIN.dll, DynamicOCR.dll, and the appropriate language package. Navigate to Tools -> Choose Toolbox Items, then to the .NET Framework Components tab, click the Browse button, and locate DynamicDotNetTWAIN.dll. Right-click the project file in Solution Explorer and select Add-> Existing Item... then add the necessary items from the OCR resources directory. This is the code for clicking the LoadImage button: private void button1_Click(object sender, EventArgs e) { OpenFileDialog filedlg = new OpenFileDialog(); if (filedlg.ShowDialog() == DialogResult.OK) { dynamicDotNetTwain1.LoadImage(filedlg.FileName); // Choose an image from your local disk and load it into Dynamic .NET TWAIN } } private void dynamicDotNetTwain1_OnImageAreaSelected(short sImageIndex, int left, int top, int right, int bottom) { dynamicDotNetTwain1.OCRTessDataPath = "../../"; dynamicDotNetTwain1.OCRLanguage = "eng"; OcrResultFormat ocrResultFormat = Dynamsoft.DotNet.TWAIN.OCR.ResultFormat.Text; byte [] sbytes = dynamicDotNetTwain1.OCR(dynamicDotNetTwain1.CurrentImageIndexInBuffer, left, top, right, bottom); // OCR the selected area of the image if (sbytes != null) { SaveFileDialog filedlg = new SaveFileDialog(); filedlg.Filter = "Text File(*.txt)| *.txt"; if (filedlg.ShowDialog() == DialogResult.OK) { FileStream fs = File.OpenWrite(filedlg.FileName); fs.Write(sbytes, 0, sbytes.Length); // Save the OCR result as a text file fs.Close(); } MessageBox.Show("OCR successful"); } else { MessageBox.Show(dynamicDotNetTwain1.ErrorString); } } private void button1_Click(object sender, EventArgs e) { OpenFileDialog filedlg = new OpenFileDialog(); if (filedlg.ShowDialog() == DialogResult.OK) { dynamicDotNetTwain1.LoadImage(filedlg.FileName); // Choose an image from your local disk and load it into Dynamic .NET TWAIN } } private void dynamicDotNetTwain1_OnImageAreaSelected(short sImageIndex, int left, int top, int right, int bottom) { dynamicDotNetTwain1.OCRTessDataPath = "../../"; dynamicDotNetTwain1.OCRLanguage = "eng"; OcrResultFormat ocrResultFormat = Dynamsoft.DotNet.TWAIN.OCR.ResultFormat.Text; byte [] sbytes = dynamicDotNetTwain1.OCR(dynamicDotNetTwain1.CurrentImageIndexInBuffer, left, top, right, bottom); // OCR the selected area of the image if (sbytes != null) { SaveFileDialog filedlg = new SaveFileDialog(); filedlg.Filter = "Text File(*.txt)| *.txt"; if (filedlg.ShowDialog() == DialogResult.OK) { FileStream fs = File.OpenWrite(filedlg.FileName); fs.Write(sbytes, 0, sbytes.Length); // Save the OCR result as a text file fs.Close(); } MessageBox.Show("OCR successful"); } else { MessageBox.Show(dynamicDotNetTwain1.ErrorString); } } Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs) Dim filedlg As New OpenFileDialog() If filedlg.ShowDialog() = DialogResult.OK Then dynamicDotNetTwain1.LoadImage(filedlg.FileName) ' Choose an image from your local disk and load it into Dynamic .NET TWAIN End If End Sub Private Sub dynamicDotNetTwain1_OnImageAreaSelected(ByVal sImageIndex As Short, ByVal left As Integer, ByVal top As Integer, ByVal right As Integer, ByVal bottom As Integer) dynamicDotNetTwain1.OCRTessDataPath = "../../" dynamicDotNetTwain1.OCRLanguage = "eng" Dim ocrResultFormat As OcrResultFormat = Dynamsoft.DotNet.TWAIN.OCR.ResultFormat.Text Dim sbytes() As Byte = dynamicDotNetTwain1.OCR(dynamicDotNetTwain1.CurrentImageIndexInBuffer, left, top, right, bottom) ' OCR the selected area of the image If sbytes IsNot Nothing Then Dim filedlg As New SaveFileDialog() filedlg.Filter = "Text File(*.txt)| *.txt" If filedlg.ShowDialog() = DialogResult.OK Then Dim fs As FileStream = File.OpenWrite(filedlg.FileName) fs.Write(sbytes, 0, sbytes.Length) ' Save the OCR result as a text file fs.Close() End If MessageBox.Show("OCR successful") Else MessageBox.Show(dynamicDotNetTwain1.ErrorString) End If End Sub $vbLabelText $csharpLabel This is how the application looks: Image Performance Tuning The quality of the input image is the most crucial determinant in the speed of an OCR task. The lower the background noise and the higher the dpi, with a great goal value of around 200 dpi, the faster and more accurate the OCR output. Image Processing Techniques for Dynamsoft OCR We need to use OCR in a variety of situations, such as scanning a credit card number with our phone or extracting text from paper documents. OCR capabilities are included in Dynamsoft Label Recognition (DLR) and Dynamic Web TWAIN (DWT). Although they can do an excellent job in general, we can improve the results by using various image processing techniques. Lighten/remove shadows Poor illumination may have an impact on the OCR result. To improve the outcome, we can whiten photos or eliminate shadows from images. Invert Because the OCR engine is often trained on text in dark colors, text in light colors can be harder to discover and recognize. It will be easier to recognize if we invert its color To perform the inversion, we can use the GrayscaleTransformationModes parameter in DLR. Here are the JSON settings: "GrayscaleTransformationModes": [ { "Mode": "DLR_GTM_INVERTED" } ] DLR .net’s reading result: Rescale If the letter height is too low, the OCR engine may not produce a good result. In general, the image should have a DPI of at least 300. There is a ScaleUpModes parameter in DLR 1.1 that allows you to scale up letters. We may, of course, scale the image ourselves. Reading the image directly yields the incorrect result: After scaling up the image x2, the result is correct: Deskew It is fine if the text is a little distorted. However, if it is overly skewed, the outcome will be adversely altered. To improve the outcome, we need to crop the image. To accomplish this, we can use the Hough Line Transform in OpenCV and Python. Here is the code to deskew the image above: import cv2 import numpy as np import math from PIL import Image def deskew(): src = cv2.imread("neg.jpg", cv2.IMREAD_COLOR) gray = cv2.cvtColor(src, cv2.COLOR_BGR2GRAY) kernel = np.ones((5,5), np.uint8) erode_img = cv2.erode(gray, kernel) eroDil = cv2.dilate(erode_img, kernel) show_and_wait_key("eroDil", eroDil) canny = cv2.Canny(eroDil, 50, 150) show_and_wait_key("canny", canny) lines = cv2.HoughLinesP(canny, 0.8, np.pi / 180, 90, minLineLength=100, maxLineGap=10) drawing = np.zeros(src.shape[:], dtype=np.uint8) maxY = 0 degree_of_bottomline = 0 index = 0 for line in lines: x1, y1, x2, y2 = line[0] cv2.line(drawing, (x1, y1), (x2, y2), (0, 255, 0), 1, lineType=cv2.LINE_AA) k = float(y1-y2)/(x1-x2) degree = np.degrees(math.atan(k)) if index == 0: maxY = y1 degree_of_bottomline = degree else: if y1 > maxY: maxY = y1 degree_of_bottomline = degree index += 1 show_and_wait_key("houghP", drawing) img = Image.fromarray(src) rotate_img = img.rotate(degree_of_bottomline) rotate_img_cv = np.array(rotate_img) cv2.imshow("rotateImg", rotate_img_cv) cv2.imwrite("deskewed.jpg", rotate_img_cv) cv2.waitKey() def show_and_wait_key(win_name, img): cv2.imshow(win_name, img) cv2.waitKey() if __name__ == "__main__": deskew() import cv2 import numpy as np import math from PIL import Image def deskew(): src = cv2.imread("neg.jpg", cv2.IMREAD_COLOR) gray = cv2.cvtColor(src, cv2.COLOR_BGR2GRAY) kernel = np.ones((5,5), np.uint8) erode_img = cv2.erode(gray, kernel) eroDil = cv2.dilate(erode_img, kernel) show_and_wait_key("eroDil", eroDil) canny = cv2.Canny(eroDil, 50, 150) show_and_wait_key("canny", canny) lines = cv2.HoughLinesP(canny, 0.8, np.pi / 180, 90, minLineLength=100, maxLineGap=10) drawing = np.zeros(src.shape[:], dtype=np.uint8) maxY = 0 degree_of_bottomline = 0 index = 0 for line in lines: x1, y1, x2, y2 = line[0] cv2.line(drawing, (x1, y1), (x2, y2), (0, 255, 0), 1, lineType=cv2.LINE_AA) k = float(y1-y2)/(x1-x2) degree = np.degrees(math.atan(k)) if index == 0: maxY = y1 degree_of_bottomline = degree else: if y1 > maxY: maxY = y1 degree_of_bottomline = degree index += 1 show_and_wait_key("houghP", drawing) img = Image.fromarray(src) rotate_img = img.rotate(degree_of_bottomline) rotate_img_cv = np.array(rotate_img) cv2.imshow("rotateImg", rotate_img_cv) cv2.imwrite("deskewed.jpg", rotate_img_cv) cv2.waitKey() def show_and_wait_key(win_name, img): cv2.imshow(win_name, img) cv2.waitKey() if __name__ == "__main__": deskew() PYTHON Lines detected: Deskewed: Image Processing Techniques for IronOCR The quality of the input image is not important here because IronOCR excels at repairing defective documents (though this is time-consuming and will cause your OCR jobs to use more CPU cycles). Choosing input image formats with less digital noise, such as TIFF or PNG, can also result in speedier outcomes than lossy image formats, such as JPEG. The image filters listed below can significantly enhance performance: OcrInput.Rotate(double degrees) — Rotates images clockwise by a specified number of degrees. Negative integers are used for anti-clockwise rotation. OcrInput.Binarize() — This image filter makes every pixel either black or white, with no in-between. It may improve OCR performance in circumstances where the text-to-background contrast is very low. OcrInput.ToGrayScale() — This image filter converts every pixel to a grayscale shade. It is unlikely to improve OCR accuracy, but it may increase speed. OcrInput.Contrast() — Automatically increases contrast. In low-contrast scans, this filter frequently improves OCR speed and accuracy. OcrInput.DeNoise() — This filter should be used only when noise is expected. OcrInput.Invert() — Reverses all colors. For example, white becomes black: black becomes white. OcrInput.Dilate() — Advanced morphology. Dilation is the process of adding pixels to the edges of objects in an image. (Inverse of Erode) OcrInput.Erode() — An advanced morphology function. Erosion is the process of removing pixels from the edges of objects. (Inverse of Dilate) OcrInput.Deskew() — Rotates an image so that it is orthogonal and the right way up. Because Tesseract tolerance for skewed scans can be as low as 5 degrees, this is quite useful for OCR. DeepCleanBackgroundNoise() — Removes a lot of background noise. Only use this filter if you know there is a lot of background noise in the document because it can reduce OCR accuracy on clear documents and is quite CPU intensive. OcrInput.EnhanceResolution — Improves the resolution of low-resolution photos. Because of OcrInput, this filter is rarely used. OcrInput will detect and resolve low resolution automatically. We may want to use IronTesseract to speed up OCR on higher-quality scans. If we're looking for speed, we might start here and subsequently turn features back on until the proper balance is struck. using IronOcr; class Program { static void Main(string[] args) { var ocr = new IronTesseract(); // Configuration for speed tuning ocr.Configuration.BlackListCharacters = "~`$#^*_}{][|\\"; ocr.Configuration.PageSegmentationMode = TesseractPageSegmentationMode.Auto; ocr.Configuration.TesseractVersion = TesseractVersion.Tesseract5; ocr.Configuration.EngineMode = TesseractEngineMode.LstmOnly; ocr.Language = OcrLanguage.EnglishFast; using (var input = new OcrInput(@"img\Potter.tiff")) { var result = ocr.Read(input); Console.WriteLine(result.Text); } } } using IronOcr; class Program { static void Main(string[] args) { var ocr = new IronTesseract(); // Configuration for speed tuning ocr.Configuration.BlackListCharacters = "~`$#^*_}{][|\\"; ocr.Configuration.PageSegmentationMode = TesseractPageSegmentationMode.Auto; ocr.Configuration.TesseractVersion = TesseractVersion.Tesseract5; ocr.Configuration.EngineMode = TesseractEngineMode.LstmOnly; ocr.Language = OcrLanguage.EnglishFast; using (var input = new OcrInput(@"img\Potter.tiff")) { var result = ocr.Read(input); Console.WriteLine(result.Text); } } } Imports IronOcr Friend Class Program Shared Sub Main(ByVal args() As String) Dim ocr = New IronTesseract() ' Configuration for speed tuning ocr.Configuration.BlackListCharacters = "~`$#^*_}{][|\" ocr.Configuration.PageSegmentationMode = TesseractPageSegmentationMode.Auto ocr.Configuration.TesseractVersion = TesseractVersion.Tesseract5 ocr.Configuration.EngineMode = TesseractEngineMode.LstmOnly ocr.Language = OcrLanguage.EnglishFast Using input = New OcrInput("img\Potter.tiff") Dim result = ocr.Read(input) Console.WriteLine(result.Text) End Using End Sub End Class $vbLabelText $csharpLabel This result is 99.8% accurate compared to the baseline of 100% — but 35% faster. ライセンスと価格 Dynamsoft Licensing and Pricing Per year license. All rates include one year of maintenance, which includes free software upgrades and premium support. Dynamsoft offers two types of licenses: Per client device license The "One Client Device License" provides access to a same-origin Application (same protocol, same host, and same port) to use the software's features from a single client device. An inactive client device is one that has not accessed any software capability for 90 days in a row. An inactive client device's license seat will be instantly freed and made available for usage by any other active client device. When you reach the maximum number of license seats allowed, Dynamsoft will give you an extra 10% of your client device allowance for emergency use. Once the additional client device allowance has been depleted, no new client devices can access and use the software until there are available license seats again. Please keep in mind that exceeding your client device allowance has no effect on any client devices that have already been licensed. Per-server license To deploy the application to a single server, a "One Server License" is required. Servers refer to both physical and virtual servers and include, but are not limited to, production servers, failover servers, development servers that are also used for testing, quality assurance servers, testing servers, and staging servers, all of which require a license. Additional licenses are not required for continuous integration servers (build servers) or localhost development servers. The per-server license is only valid for on-premises server installations, and not for cloud deployments. Pricing for Dynamsoft OCR starts at USD 1,249/year. IronOCR Licensing and Pricing As developers, we all want to accomplish our projects with the least amount of money and resources possible — budgeting is critical. Examine the chart to determine which license is best suited to your requirements and budget. IronOCR provides licenses with a customizable number of developers, projects, and locations, allowing you to fulfill the needs of your project while only paying for the coverage you require. IronOCR licensing keys enable you to publish your product without a watermark. Licenses start from $799 and include one year of support and upgrades. You can also use a trial license key to try IronOCR for free. 結論 Tesseract OCR on Mac, Windows, Linux, Azure OCR, and Docker are all available with IronOCR for C#. .NET Framework 4.0 or above is required, .NET Standard 2.0+, .NET Core 2.0+, .NET 5, Mono for macOS and Linux, and Xamarin for macOS are all examples of cross-platform development. IronOCR also uses the latest Tesseract 5 engine to read text, barcodes, and QR codes from all major image and PDF formats. In minutes, this library adds OCR functionality to your desktop, console, or web apps! The OCR can also read PDFs and multi-page TIFFs, and it can be saved as a searchable PDF document or XHTML in any OCR Scan. Plain text, barcode data, and an OCR result class encompassing paragraphs, lines, words, and characters are among its data output choices. It is available in 125 languages, including Arabic, Chinese, English, Finnish, French, German, Hebrew, Italian, Japanese, Korean, Portuguese, Russian, and Spanish, but keep in mind that bespoke language packs can also be generated. The Dynamic .NET TWAIN OCR add-on is a quick and reliable .NET component for Optical Character Recognition that you can use in WinForms and WPF applications written in C# or VB .NET. You can scan documents or capture photos from webcams using Dynamic .NET TWAIN's image capture module, and then conduct OCR on the images to convert the text in the images to text, searchable PDF files, or strings. Multiple Asian languages, as well as Arabic, are offered in addition to English. IronOCR offers better licensing than Dynamsoft OCR; IronOcr starts at $799 with one year free, while Dynamsoft starts at $1249 with a free trial. IronOCR also offers licenses for multiple users, while with Dynamsoft, you only get one license per user. While both sets of software aim at offering the best performance in terms of OCR readings of barcodes, image to text, and image to text, IronOCR stands out in that it shines its light even on images that are in pretty bad shape. It automatically puts in place its sophisticated tuning methods to give you the best OCR results. IronOCR also makes use of Tesseract to give you optimal results with little or no errors. Iron Software is also offering its customers and users the option to grab its entire suite of software in just two clicks. This means that for the price of two of the components in the Iron Software suite, you can currently get all five components and uninterrupted support. ご注意Dynamsoft OCR is a registered trademark of its respective owner. This site is not affiliated with, endorsed by, or sponsored by Dynamsoft OCR. すべての製品名、ロゴ、およびブランドは各所有者の所有物です。 比較は情報提供のみを目的としており、執筆時点で公開されている情報を反映しています。 よくある質問 テキストの画像をC#を使用してデジタル形式に変換するにはどうすればよいですか? C#でIronOCRを利用して、テキストの画像をデジタル形式に変換することができます。IronOCRは、低品質のスキャンを自動的にシャープにし、補正するためのメソッドを提供し、さまざまな画像形式をテキストに変換するのに最適です。 IronOCRは、低品質のスキャンを扱う際にどのような利点を提供しますか? IronOCRは、傾き、歪み、背景ノイズを減らしながら、解像度とコントラストを改善することで、低品質のスキャンを自動的に強化し、テキスト認識の精度を高めます。 クロスプラットフォームアプリケーションに適したOCRライブラリはどれですか? IronOCRは、XamarinやAzureのような環境をサポートしており、さまざまなプラットフォームで作業する開発者に柔軟性を提供するため、クロスプラットフォームアプリケーションに適しています。 IronOCRはどのような画像形式をサポートしていますか? IronOCRは幅広い画像形式をサポートしており、さまざまなOCRアプリケーションに対応することで、柔軟性を提供します。画像やPDFドキュメントを処理でき、さまざまな入力ソースを扱うことが可能です。 OCR技術は企業の文書管理に役立ちますか? はい、OCR技術は物理的な文書をデジタル化し、検索可能で編集可能にすることで文書管理を大幅に改善します。これにより手動でのデータ入力が減り、エラーが最小限に抑えられ、アクセス性が向上します。 Dynamsoft OCRはデバイスからの画像取得をどのように処理しますか? Dynamsoft OCRはTWAIN準拠のデバイスやウェブカメラからの画像取得をサポートしており、効率的な画像処理のためにバッチスキャンとスキャナー属性の変更が可能です。 IronOCRの価格設定オプションは他のライブラリと比べてどのようですか? IronOCRは開発者の数、プロジェクト、場所に応じてカスタマイズ可能なライセンスを提供し、他のライブラリと比較してより柔軟かつコスト効率の良いオプションを提供します。 OCR技術を使用するときに直面する一般的な問題は何ですか? OCR技術に関する一般的な問題には、低解像度の画像、歪み、さまざまなテキストフォントの処理があります。しかし、IronOCRのようなライブラリにはこれらの問題を解決するための内蔵機能があり、OCRの精度を向上させます。 Kannapat Udonpant 今すぐエンジニアリングチームとチャット ソフトウェアエンジニア ソフトウェアエンジニアになる前に、Kannapatは北海道大学で環境資源の博士号を修了しました。博士号を追求する間に、彼はバイオプロダクションエンジニアリング学科の一部である車両ロボティクスラボラトリーのメンバーになりました。2022年には、C#のスキルを活用してIron Softwareのエンジニアリングチームに参加し、IronPDFに注力しています。Kannapatは、IronPDFの多くのコードを執筆している開発者から直接学んでいるため、この仕事を大切にしています。同僚から学びながら、Iron Softwareでの働く社会的側面も楽しんでいます。コードやドキュメントを書いていない時は、KannapatはPS5でゲームをしたり、『The Last of Us』を再視聴したりしていることが多いです。 関連する記事 更新日 9月 25, 2025 C#で適切なOCRライブラリを選択する方法 プロジェクトに最適なOCRライブラリを決定するのは難しいことです。いくつかのライブラリは、エンタープライズ グレードのOCR機能と高いOCR精度に焦点を当てています 詳しく読む 更新日 8月 24, 2025 なぜIronOCRが光学文字認識のLLMよりも優れているのか:.NET開発者のための実用ガイド 光学文字認識(OCR)は、画像や文書からテキストや情報を抽出するために重要な技術です。GPT-4やGeminiのような大規模言語モデル(LLM)は自然言語処理を一新しました。 詳しく読む 更新日 7月 28, 2025 AWS OCR対Azure OCR(OCR機能の比較) これにはAmazon Web Services(AWS)、Microsoft Azure、Google Cloudプラットフォーム上のGoogle Cloud Vision APIなどのクラウドプロバイダーが含まれます 詳しく読む IronOCRとTesseract.NETの比較IronOCRとAbbyy Finereaderの比較
更新日 9月 25, 2025 C#で適切なOCRライブラリを選択する方法 プロジェクトに最適なOCRライブラリを決定するのは難しいことです。いくつかのライブラリは、エンタープライズ グレードのOCR機能と高いOCR精度に焦点を当てています 詳しく読む
更新日 8月 24, 2025 なぜIronOCRが光学文字認識のLLMよりも優れているのか:.NET開発者のための実用ガイド 光学文字認識(OCR)は、画像や文書からテキストや情報を抽出するために重要な技術です。GPT-4やGeminiのような大規模言語モデル(LLM)は自然言語処理を一新しました。 詳しく読む
更新日 7月 28, 2025 AWS OCR対Azure OCR(OCR機能の比較) これにはAmazon Web Services(AWS)、Microsoft Azure、Google Cloudプラットフォーム上のGoogle Cloud Vision APIなどのクラウドプロバイダーが含まれます 詳しく読む