# 如何在C#中使用計算機視覺尋找文字
IronOCR使用OpenCV計算機視覺在OCR處理之前自動檢測圖像中的文字區域。 這可以改善對嘈雜、多區域或扭曲文字的準確性,因為Tesseract識別僅針對識別出的文字區域,大大增強了提取結果,相較於處理整個圖像。
*as-heading:2(快速入門:檢測並OCR主要文字區域)*
此範例演示即時文字提取:載入圖像,使用IronOCR的計算機視覺自動檢測主文字區域,然後執行`.Read(...)`在一行中提取文字。
```cs
:title=Start OCR with Computer Vision in One Line
using var result = new IronTesseract().Read(new OcrInput().LoadImage("image.png").FindTextRegion());
```
- [如何在C#中OCR車牌(教程)](/csharp/ocr/blog/using-ironocr/license-plate-ocr-csharp-tutorial/)
- [如何從C#教學中獲得發票文字](/csharp/ocr/blog/using-ironocr/invoice-ocr-csharp-tutorial/)
- [如何使用C#從截圖中獲取OCR文字](/csharp/ocr/blog/using-ironocr/get-text-ocr-screenshot-csharp-tutorial/)
- [如何在C#中OCR字幕(教程)](/csharp/ocr/blog/using-ironocr/subtitle-ocr-csharp-tutorial/)
<div class="hsg-featured-snippet">
<h3>最小工作流程(5步)</h3>
<ol>
<li><a class="js-modal-open" data-modal-id="trial-license-after-download" href="https://nuget.org/packages/IronOcr/">下載C#程式庫以使用計算機視覺進行OCR</a></li>
<li>使用<code>FindTextRegion</code>方法自動檢測文字區域</li>
<li>使用<code>StampCropRectangleAndSaveAs</code>方法檢查檢測到的文字區域</li>
<li>使用計算機視覺將原始圖像根據文字區域分割成多個圖像,使用<code>FindMultipleTextRegions</code>方法</li>
<li>使用<code>GetTextRegions</code>方法獲取檢測到文字的裁剪區域清單</li>
</ol>
</div>
## 如何通過NuGet Package安裝IronOcr.ComputerVision?
執行IronOCR中的OpenCV方法可以在常規IronOCR NuGet包中看到。 詳細的安裝指南請參閱我們的[NuGet安裝指南](https://ironsoftware.com/csharp/ocr/get-started/advanced-installation-nuget/)。
### 為什麼IronOCR需要一個單獨的計算機視覺包?
使用這些方法需要在解決方案中安裝`IronOcr.ComputerVision`的NuGet包。 如果未安裝,系統將提示您下載。 計算機視覺功能利用了OpenCV算法,可以大幅度提高文字檢測的準確性,類似於我們在[車牌識別](https://ironsoftware.com/csharp/ocr/how-to/read-license-plate/)和[護照掃描](https://ironsoftware.com/csharp/ocr/how-to/read-passport/)功能中使用的技術。
### 我應該安裝哪個特定平台的包?
- Windows: `IronOcr.ComputerVision.Windows` - 查看我們的[Windows設置指南](https://ironsoftware.com/csharp/ocr/get-started/windows/)
- Linux: `IronOcr.ComputerVision.Linux` - 查看我們的[Linux安裝教程](https://ironsoftware.com/csharp/ocr/get-started/linux/)
- macOS: `IronOcr.ComputerVision.MacOS` - 查看我們的[macOS設置指南](https://ironsoftware.com/csharp/ocr/get-started/mac/)
- macOS ARM: `IronOcr.ComputerVision.MacOS.ARM`
### 如何使用Package Manager Console進行安裝?
使用NuGet Package Manager安裝或在Package Manager Console中粘貼以下內容:
```shell
:InstallCmd Install-Package IronOcr.ComputerVision.Windows
```
這提供了必要的程式集以便IronOCR計算機視覺與我們的模型文件配合使用。
## IronOCR中有哪些計算機視覺方法?
本教程的後面部分包含了範例程式碼。 以下是當前可用方法的概覽:
<table class="table table__configuration-variables">
<tr>
<th scope="col">方法</th>
<th scope="col">解釋</th>
</tr>
<tr>
<td><a href="#anchor-findtextregion"><code>FindTextRegion</code></a></td>
<td class="word-break--break-word">檢測包含文字元素的區域,並指示Tesseract僅在檢測到的文字區域內查找文字。</td>
</tr>
<tr>
<td><a href="#anchor-findmultipletextregions"><code>FindMultipleTextRegions</code></a></td>
<td class="word-break--break-word">檢測包含文字元素的區域,並根據文字區域將頁面劃分為單獨的圖像。</td>
</tr>
<tr>
<td><a href="#anchor-gettextregions"><code>GetTextRegions</code></a></td>
<td class="word-break--break-word">Scans the image and returns a list of text regions as <code>List<CropRectangle></code>.</td>
</tr>
</table>
## 如何使用FindTextRegion檢測文字區域?
`OcrInput`物件每個頁面中包含文字元素的區域。 此方法特別有用於處理包含分散文字的圖像,或者您需要通過僅專注於包含文字的區域來提高性能時。
### 什麼是基本的FindTextRegion用法?
```csharp
using IronOcr;
var ocr = new IronTesseract();
using var input = new OcrInput();
input.LoadImage("/path/file.png");
input.FindTextRegion();
OcrResult result = ocr.Read(input);
string resultText = result.Text;
```
`IronOcr 2025.6.x`中已被棄用,並且不接受自定義參數。
### 如何自定義FindTextRegion參數?
調用此方法時設置自定義參數以微調文字檢測。 這些參數類似於我們的[圖像過濾器配置](https://ironsoftware.com/csharp/ocr/how-to/image-quality-correction/):
```csharp
using IronOcr;
var ocr = new IronTesseract();
using var input = new OcrInput();
input.LoadImage("/path/file.png");
input.FindTextRegion();
OcrResult result = ocr.Read(input);
string resultText = result.Text;
```
### FindTextRegion在實際使用中是什麼樣的?
在此範例中,我使用以下圖像作為需要裁剪到包含文字區域的方法,但輸入圖像的文字位置可能不同。 我使用`FindTextRegion`將掃描範圍縮小到計算機視覺檢測到文字的區域。 這種方法類似於我們在[內容區域和裁剪區域教程](https://ironsoftware.com/csharp/ocr/troubleshooting/crop-regions-rectangles/)中使用的技術。 這是一個範例圖像:
<div class="content-img-align-center">
<div class="center-image-wrapper">
<img src="/static-assets/ocr/how-to/computer-vision/iron-2022.webp" alt="Iron Software 2022公司統計,顯示開發者指標和業務績效資料" class="img-responsive add-shadow" />
</div>
</div>
```csharp
using IronOcr;
using IronSoftware.Drawing;
using System;
using System.Linq;
var ocr = new IronTesseract();
using var input = new OcrInput();
input.LoadImage("wh-words-sign.jpg");
// Find the text region using Computer Vision
Rectangle textCropArea = input.GetPages().First().FindTextRegion();
// For debugging and demonstration purposes, lets see what region it found:
input.StampCropRectangleAndSaveAs(textCropArea, Color.Red, "image_text_area", AnyBitmap.ImageFormat.Png);
// Looks good, so let us apply this region to hasten the read:
var ocrResult = ocr.Read("wh-words-sign.jpg", textCropArea);
Console.WriteLine(ocrResult.Text);
```
### 如何除錯和驗證文字區域檢測?
此程式碼有兩個輸出。 第一個是由`.png`文件。 此技術也在我們的[除錯指南中的突出顯示文字技術指南](https://ironsoftware.com/csharp/ocr/examples/highlight-texts-for-debugging/)中涵蓋。 我們可以看到IronCV(計算機視覺)檢測到的文字位置:
<div class="content-img-align-center">
<div class="center-image-wrapper">
<img src="/static-assets/ocr/how-to/computer-vision/text_area_0.PNG" alt="Iron Software 2022 統計,紅色邊界框顯示FindTextRegion文字檢測功能" class="img-responsive add-shadow" />
</div>
</div>
檢測準確地識別了文字區域。 第二個輸出是文字本身:
```text
IRONSOFTWARE
50,000+
Developers in our active community
10,777,061 19,313
NuGet downloads Support tickets resolved
50%+ 80%+
Engineering Team growth Support Team growth
$25,000+
Raised with #TEAMSEAS to clean our beaches & waterways
```
## 如何使用FindMultipleTextRegions檢測多文字區域?
`OcrInput`物件的所有頁面,使用計算機視覺檢測包含文字元素的區域,然後將輸入分割為根據文字區域的單獨圖像。 這特別適用於處理具有多個獨立文字區域的文件,類似於我們的[文件中讀取表格功能](https://ironsoftware.com/csharp/ocr/examples/read-table-in-document/):
### 什麼是基本的FindMultipleTextRegions用法?
```csharp
using IronOcr;
var ocr = new IronTesseract();
using var input = new OcrInput();
input.LoadImage("/path/file.png");
input.FindMultipleTextRegions();
OcrResult result = ocr.Read(input);
string resultText = result.Text;
```
[[e:(自IronOCR v2025.6.x開始,`FindMultipleTextRegions`方法不再支持自定義參數。)]]
### 如何自定義FindMultipleTextRegions參數?
調用此方法時設置自定義參數以控制如何檢測及分隔區域:
```csharp
using IronOcr;
var ocr = new IronTesseract();
using var input = new OcrInput();
input.LoadImage("/path/file.png");
input.FindMultipleTextRegions();
OcrResult result = ocr.Read(input);
string resultText = result.Text;
```
### 如何使用FindMultipleTextRegions處理個別頁面?
`FindMultipleTextRegions`的另一個重載方法接收一個OCR頁面,並返回一個OCR頁面列表,每個檢測到的文字區域對應一個OCR頁面。 這在處理複雜佈局時特別有幫助,類似於我們在[多頁TIFF處理指南](https://ironsoftware.com/csharp/ocr/examples/csharp-tesseract-multipage-tiff/)中描述的技術:
```csharp
using IronOcr;
using System.Collections.Generic;
using System.Linq;
int pageIndex = 0;
using var input = new OcrInput();
input.LoadImage("/path/file.png");
var selectedPage = input.GetPages().ElementAt(pageIndex);
List<OcrInputPage> textRegionsOnPage = selectedPage.FindMultipleTextRegions();
```
## 如何使用GetTextRegions獲取文字區域座標?
`GetTextRegions`返回檢測到文字的裁剪區域列表。 此方法特別有用於需要獲取文字區域座標以供進一步處理或實施自定義的OCR工作流時。 有關處理結果的詳細資訊,請參見我們的[OcrResult類文件](https://ironsoftware.com/csharp/ocr/examples/results-objects/):
### 什麼情況下應該使用GetTextRegions而不是FindTextRegion?
```csharp
/* :path=/static-assets/ocr/content-code-examples/how-to/computer-vision-gettextregions.cs */
using IronOcr;
using IronSoftware.Drawing;
using System;
using System.Collections.Generic;
using System.Linq;
// Create a new IronTesseract object for OCR
var ocr = new IronTesseract();
// Load an image into OcrInput
using var input = new OcrInput();
input.LoadImage("/path/file.png");
// Get the first page from the input
var firstPage = input.GetPages().First();
// Get all text regions detected on this page
List<Rectangle> textRegions = firstPage.GetTextRegions();
// Display information about each detected region
Console.WriteLine($"Found {textRegions.Count} text regions:");
foreach (var region in textRegions)
{
Console.WriteLine($"Region at X:{region.X}, Y:{region.Y}, Width:{region.Width}, Height:{region.Height}");
}
// You can also process each region individually
foreach (var region in textRegions)
{
var regionResult = ocr.Read(input, region);
Console.WriteLine($"Text in region: {regionResult.Text}");
}
```
### 計算機視覺在OCR中的常見用例有哪些?
在具挑戰性的場景中,計算機視覺可顯著提高OCR的準確性。 這裡是一些實際應用:
1. **文件佈局分析**:自動識別和處理複雜文件的不同部分。 特別對於[掃描文件](https://ironsoftware.com/csharp/ocr/examples/read-scanned-document/)非常有用。
2. **多列文字**:獨立分離並讀取報紙或雜誌的欄目。 使用[多執行緒處理](https://ironsoftware.com/csharp/ocr/examples/csharp-tesseract-multithreading-for-speed/)以加速處理。
3. **混合內容**:在文件中區分文字區域和圖形。 當處理包含嵌入文字的[照片](https://ironsoftware.com/csharp/ocr/examples/read-photo/)時十分有幫助。
4. **性能優化**:僅將OCR處理集中在包含文字的區域。 請參考我們的[快速OCR配置指南](https://ironsoftware.com/csharp/ocr/examples/tune-tesseract-for-speed-in-dotnet/)。
5. **質量控制**:在進行完整OCR處理前驗證文字檢測。 我們的[進度跟蹤功能](https://ironsoftware.com/csharp/ocr/examples/progress-tracking/)監控每個階段。
透過正確的設置和輸入文件,OCR可達到接近人類的閱讀能力。 為了獲得最佳結果,將計算機視覺與我們的[圖像優化過濾器](https://ironsoftware.com/csharp/ocr/examples/ocr-image-filters-for-net-tesseract/)相結合,以獲得最佳的OCR準確性。 處理低質量圖像時,我們的[修復低質量掃描](https://ironsoftware.com/csharp/ocr/examples/ocr-low-quality-scans-tesseract/)指南提供了有價值的預處理技術。
### 高級計算機視覺技術
對於希望突破OCR準確性邊界的開發者,請考慮以下先進方法:
- **自定義訓練**:使用我們的[自定義語言文件指導](https://ironsoftware.com/csharp/ocr/examples/ocr-tesseract-custom-languages/)訓練OCR引擎以適應專門字體
- **多語言支援**:使用我們的[多語言功能](https://ironsoftware.com/csharp/ocr/examples/ocr-tesseract-multiple-languages/)處理多語言文件
- **條碼整合**:使用我們的[與條碼識別功能相結合的OCR](https://ironsoftware.com/csharp/ocr/examples/csharp-ocr-barcodes/)
using IronOcr;var ocr = new IronTesseract();using var input = new OcrInput();input.LoadImage("/path/file.png");input.FindTextRegion();OcrResult result = ocr.Read(input);string resultText = result.Text;
using IronOcr;
var ocr = new IronTesseract();
using var input = new OcrInput();
input.LoadImage("/path/file.png");
input.FindTextRegion();
OcrResult result = ocr.Read(input);
string resultText = result.Text;
ImportsIronOcrPrivate ocr = New IronTesseract()Private input = New OcrInput()input.LoadImage("/path/file.png")input.FindTextRegion()Dim result AsOcrResult = ocr.Read(input)Dim resultText AsString = result.Text
Imports IronOcr
Private ocr = New IronTesseract()
Private input = New OcrInput()
input.LoadImage("/path/file.png")
input.FindTextRegion()
Dim result As OcrResult = ocr.Read(input)
Dim resultText As String = result.Text
using IronOcr;var ocr = new IronTesseract();using var input = new OcrInput();input.LoadImage("/path/file.png");input.FindTextRegion();OcrResult result = ocr.Read(input);string resultText = result.Text;
using IronOcr;
var ocr = new IronTesseract();
using var input = new OcrInput();
input.LoadImage("/path/file.png");
input.FindTextRegion();
OcrResult result = ocr.Read(input);
string resultText = result.Text;
ImportsIronOcrPrivate ocr = New IronTesseract()Private input = New OcrInput()input.LoadImage("/path/file.png")input.FindTextRegion()Dim result AsOcrResult = ocr.Read(input)Dim resultText AsString = result.Text
Imports IronOcr
Private ocr = New IronTesseract()
Private input = New OcrInput()
input.LoadImage("/path/file.png")
input.FindTextRegion()
Dim result As OcrResult = ocr.Read(input)
Dim resultText As String = result.Text
using IronOcr;using IronSoftware.Drawing;using System;using System.Linq;var ocr = new IronTesseract();using var input = new OcrInput();input.LoadImage("wh-words-sign.jpg");// Find the text region using Computer VisionRectangle textCropArea = input.GetPages().First().FindTextRegion();// For debugging and demonstration purposes, lets see what region it found:input.StampCropRectangleAndSaveAs(textCropArea, Color.Red, "image_text_area", AnyBitmap.ImageFormat.Png);// Looks good, so let us apply this region to hasten the read:var ocrResult = ocr.Read("wh-words-sign.jpg", textCropArea);Console.WriteLine(ocrResult.Text);
using IronOcr;
using IronSoftware.Drawing;
using System;
using System.Linq;
var ocr = new IronTesseract();
using var input = new OcrInput();
input.LoadImage("wh-words-sign.jpg");
// Find the text region using Computer Vision
Rectangle textCropArea = input.GetPages().First().FindTextRegion();
// For debugging and demonstration purposes, lets see what region it found:
input.StampCropRectangleAndSaveAs(textCropArea, Color.Red, "image_text_area", AnyBitmap.ImageFormat.Png);
// Looks good, so let us apply this region to hasten the read:
var ocrResult = ocr.Read("wh-words-sign.jpg", textCropArea);
Console.WriteLine(ocrResult.Text);
ImportsIronOcrImportsIronSoftware.DrawingImportsSystemImportsSystem.LinqPrivate ocr = New IronTesseract()Private input = New OcrInput()input.LoadImage("wh-words-sign.jpg")' Find the text region using Computer VisionDim textCropArea AsRectangle = input.GetPages().First().FindTextRegion()' For debugging and demonstration purposes, lets see what region it found:input.StampCropRectangleAndSaveAs(textCropArea, Color.Red, "image_text_area", AnyBitmap.ImageFormat.Png)' Looks good, so let us apply this region to hasten the read:Dim ocrResult = ocr.Read("wh-words-sign.jpg", textCropArea)Console.WriteLine(ocrResult.Text)
Imports IronOcr
Imports IronSoftware.Drawing
Imports System
Imports System.Linq
Private ocr = New IronTesseract()
Private input = New OcrInput()
input.LoadImage("wh-words-sign.jpg")
' Find the text region using Computer Vision
Dim textCropArea As Rectangle = input.GetPages().First().FindTextRegion()
' For debugging and demonstration purposes, lets see what region it found:
input.StampCropRectangleAndSaveAs(textCropArea, Color.Red, "image_text_area", AnyBitmap.ImageFormat.Png)
' Looks good, so let us apply this region to hasten the read:
Dim ocrResult = ocr.Read("wh-words-sign.jpg", textCropArea)
Console.WriteLine(ocrResult.Text)
IRONSOFTWARE50,000+Developers in our active community10,777,061 19,313NuGet downloads Support tickets resolved50%+ 80%+Engineering Team growth Support Team growth$25,000+Raised with #TEAMSEAS to clean our beaches & waterways
IRONSOFTWARE
50,000+
Developers in our active community
10,777,061 19,313
NuGet downloads Support tickets resolved
50%+ 80%+
Engineering Team growth Support Team growth
$25,000+
Raised with #TEAMSEAS to clean our beaches & waterways
using IronOcr;var ocr = new IronTesseract();using var input = new OcrInput();input.LoadImage("/path/file.png");input.FindMultipleTextRegions();OcrResult result = ocr.Read(input);string resultText = result.Text;
using IronOcr;
var ocr = new IronTesseract();
using var input = new OcrInput();
input.LoadImage("/path/file.png");
input.FindMultipleTextRegions();
OcrResult result = ocr.Read(input);
string resultText = result.Text;
ImportsIronOcrPrivate ocr = New IronTesseract()Private input = New OcrInput()input.LoadImage("/path/file.png")input.FindMultipleTextRegions()Dim result AsOcrResult = ocr.Read(input)Dim resultText AsString = result.Text
Imports IronOcr
Private ocr = New IronTesseract()
Private input = New OcrInput()
input.LoadImage("/path/file.png")
input.FindMultipleTextRegions()
Dim result As OcrResult = ocr.Read(input)
Dim resultText As String = result.Text
using IronOcr;var ocr = new IronTesseract();using var input = new OcrInput();input.LoadImage("/path/file.png");input.FindMultipleTextRegions();OcrResult result = ocr.Read(input);string resultText = result.Text;
using IronOcr;
var ocr = new IronTesseract();
using var input = new OcrInput();
input.LoadImage("/path/file.png");
input.FindMultipleTextRegions();
OcrResult result = ocr.Read(input);
string resultText = result.Text;
ImportsIronOcrPrivate ocr = New IronTesseract()Private input = New OcrInput()input.LoadImage("/path/file.png")input.FindMultipleTextRegions()Dim result AsOcrResult = ocr.Read(input)Dim resultText AsString = result.Text
Imports IronOcr
Private ocr = New IronTesseract()
Private input = New OcrInput()
input.LoadImage("/path/file.png")
input.FindMultipleTextRegions()
Dim result As OcrResult = ocr.Read(input)
Dim resultText As String = result.Text
using IronOcr;using System.Collections.Generic;using System.Linq;int pageIndex = 0;using var input = new OcrInput();input.LoadImage("/path/file.png");var selectedPage = input.GetPages().ElementAt(pageIndex);List<OcrInputPage> textRegionsOnPage = selectedPage.FindMultipleTextRegions();
using IronOcr;
using System.Collections.Generic;
using System.Linq;
int pageIndex = 0;
using var input = new OcrInput();
input.LoadImage("/path/file.png");
var selectedPage = input.GetPages().ElementAt(pageIndex);
List<OcrInputPage> textRegionsOnPage = selectedPage.FindMultipleTextRegions();
/* :path=/static-assets/ocr/content-code-examples/how-to/computer-vision-gettextregions.cs */using IronOcr;using IronSoftware.Drawing;using System;using System.Collections.Generic;using System.Linq;// Create a new IronTesseract object for OCRvar ocr = new IronTesseract();// Load an image into OcrInputusing var input = new OcrInput();input.LoadImage("/path/file.png");// Get the first page from the inputvar firstPage = input.GetPages().First();// Get all text regions detected on this pageList<Rectangle> textRegions = firstPage.GetTextRegions();// Display information about each detected regionConsole.WriteLine($"Found {textRegions.Count} text regions:");foreach (var region in textRegions){Console.WriteLine($"Region at X:{region.X}, Y:{region.Y}, Width:{region.Width}, Height:{region.Height}");}// You can also process each region individuallyforeach (var region in textRegions){ var regionResult = ocr.Read(input, region);Console.WriteLine($"Text in region: {regionResult.Text}");}
/* :path=/static-assets/ocr/content-code-examples/how-to/computer-vision-gettextregions.cs */
using IronOcr;
using IronSoftware.Drawing;
using System;
using System.Collections.Generic;
using System.Linq;
// Create a new IronTesseract object for OCR
var ocr = new IronTesseract();
// Load an image into OcrInput
using var input = new OcrInput();
input.LoadImage("/path/file.png");
// Get the first page from the input
var firstPage = input.GetPages().First();
// Get all text regions detected on this page
List<Rectangle> textRegions = firstPage.GetTextRegions();
// Display information about each detected region
Console.WriteLine($"Found {textRegions.Count} text regions:");
foreach (var region in textRegions)
{
Console.WriteLine($"Region at X:{region.X}, Y:{region.Y}, Width:{region.Width}, Height:{region.Height}");
}
// You can also process each region individually
foreach (var region in textRegions)
{
var regionResult = ocr.Read(input, region);
Console.WriteLine($"Text in region: {regionResult.Text}");
}
ImportsIronOcrImportsIronSoftware.DrawingImportsSystemImportsSystem.Collections.GenericImportsSystem.Linq' Create a new IronTesseract object for OCRDim ocr As New IronTesseract()' Load an image into OcrInputUsing input As New OcrInput() input.LoadImage("/path/file.png") ' Get the first page from the input Dim firstPage = input.GetPages().First() ' Get all text regions detected on this page Dim textRegions AsList(OfRectangle) = firstPage.GetTextRegions() ' Display information about each detected regionConsole.WriteLine($"Found {textRegions.Count} text regions:") For Each region In textRegionsConsole.WriteLine($"Region at X:{region.X}, Y:{region.Y}, Width:{region.Width}, Height:{region.Height}") Next ' You can also process each region individually For Each region In textRegions Dim regionResult = ocr.Read(input, region)Console.WriteLine($"Text in region: {regionResult.Text}") NextEndUsing
Imports IronOcr
Imports IronSoftware.Drawing
Imports System
Imports System.Collections.Generic
Imports System.Linq
' Create a new IronTesseract object for OCR
Dim ocr As New IronTesseract()
' Load an image into OcrInput
Using input As New OcrInput()
input.LoadImage("/path/file.png")
' Get the first page from the input
Dim firstPage = input.GetPages().First()
' Get all text regions detected on this page
Dim textRegions As List(Of Rectangle) = firstPage.GetTextRegions()
' Display information about each detected region
Console.WriteLine($"Found {textRegions.Count} text regions:")
For Each region In textRegions
Console.WriteLine($"Region at X:{region.X}, Y:{region.Y}, Width:{region.Width}, Height:{region.Height}")
Next
' You can also process each region individually
For Each region In textRegions
Dim regionResult = ocr.Read(input, region)
Console.WriteLine($"Text in region: {regionResult.Text}")
Next
End Using
What is the use of the GetTextRegions method in IronOCR?
The GetTextRegions method in IronOCR provides a list of detected text regions as coordinates, useful for further processing or implementing custom OCR workflows.
How can IronOCR assist in processing documents with multiple text areas?
IronOCR uses the FindMultipleTextRegions method to detect and process documents with multiple distinct text areas by automatically separating them into individual sections for better OCR performance.
Why might IronOCR require a separate Computer Vision package?
The separate Computer Vision package for IronOCR, available via NuGet, is necessary to utilize advanced text detection features powered by OpenCV algorithms, enhancing OCR accuracy beyond standard capabilities.
What common uses does computer vision in IronOCR support?
Computer vision in IronOCR can be used for document layout analysis, multi-column text recognition, distinguishing mixed content, performance optimizations, and quality control in OCR processes.