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.