Class OcrInputFilterWizard
OcrInputFilterWizard provides a brute-force filter assessment tool to try filter combinations within IronOCR to get the highest IronTesseract confidence.
Simply call the Run(String, out String, out Double, IronTesseract) method with a image filepath, and optionally a Tesseract.
Out variables include the result of the best combination's read, and the best confidence.
Example use: var results = OcrInputFilterWizard.Run("img.png", out string text, out double confidence);
Inheritance
Namespace: IronOcr
Assembly: IronOcr.dll
Syntax
public class OcrInputFilterWizard : Object
When a scan refuses to read cleanly and the right filters are not obvious, OcrInputFilterWizard finds them by brute force. Its static Run method tries combinations of IronOCR's image filters against an image and reports the combination that produced the highest IronTesseract confidence, so a developer skips the manual trial-and-error of guessing which corrections a difficult source needs.
Run takes an image file path and an optional IronTesseract to read with, and returns the best read result as a string. The richer overloads add out parameters: out string bestReadResult and out double ironOcrConfidence surface the winning text and its confidence score, which is the signal you act on when deciding whether the source is usable. Treat the wizard as a tuning step run once on a representative image, then apply the filters it points to through OcrInputBase.ApplyMultipleFilters on the real inputs rather than calling it on every read.
The filter wizard how-to walks through a run, and the filter wizard example shows the call.
string text = OcrInputFilterWizard.Run("scan.png", out double confidence);Methods
Run(String, IronTesseract)
This method applies a brute-force filter assessment tool to try filter combinations within IronOCR to get the highest IronTesseract confidence.
Example use: OcrInputFilterWizard.Run("img.png");
Please note that this is a debug method which is CPU-intensive. When using a large PDF it may be wise to only scan a single page rather than the whole document.
Declaration
public static string Run(string filePath, IronTesseract tesseract = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | filePath | Relative or Absolute filepath to image to run wizard on. |
| IronTesseract | tesseract | Optional Tesseract to include. Can be used if multiple languages need to be read. |
Returns
| Type | Description |
|---|---|
| System.String | Code to use to reproduce the best confidence result as a multi-line string. |
Run(String, out Double, IronTesseract)
This method applies a brute-force filter assessment tool to try filter combinations within IronOCR to get the highest IronTesseract confidence.
Out variables include the result of the best confidence.
Example use: OcrInputFilterWizard.Run("img.png", out double confidence);
Please note that this is a debug method which is CPU-intensive. When using a large PDF it may be wise to only scan a single page rather than the whole document.
Declaration
public static string Run(string filePath, out double ironOcrConfidence, IronTesseract tesseract = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | filePath | Relative or Absolute filepath to image to run wizard on. |
| System.Double | ironOcrConfidence | Out-variable of confidence of the best read result from Tesseract itself. |
| IronTesseract | tesseract | Optional Tesseract to include. Can be used if multiple languages need to be read. |
Returns
| Type | Description |
|---|---|
| System.String | Code to use to reproduce the best confidence result as a multi-line string. |
Run(String, out String, IronTesseract)
This method applies a brute-force filter assessment tool to try filter combinations within IronOCR to get the highest IronTesseract confidence.
Out variables include the result of the best combination's read text.
Example use: OcrInputFilterWizard.Run("img.png", out string bestReadResult);
Please note that this is a debug method which is CPU-intensive. When using a large PDF it may be wise to only scan a single page rather than the whole document.
Declaration
public static string Run(string filePath, out string bestReadResult, IronTesseract tesseract = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | filePath | Relative or Absolute filepath to image to run wizard on. |
| System.String | bestReadResult | Out-variable of the best filter combination Tesseract string read result. |
| IronTesseract | tesseract | Optional Tesseract to include. Can be used if multiple languages need to be read. |
Returns
| Type | Description |
|---|---|
| System.String | Code to use to reproduce the best confidence result as a multi-line string. |
Run(String, out String, out Double, IronTesseract)
This method applies a brute-force filter assessment tool to try filter combinations within IronOCR to get the highest IronTesseract confidence.
Out variables include the result of the best combination's read text, and the best confidence.
Example use: OcrInputFilterWizard.Run("img.png", out string text, out double confidence);
Please note that this is a debug method which is CPU-intensive. When using a large PDF it may be wise to only scan a single page rather than the whole document.
Declaration
public static string Run(string filePath, out string bestReadResult, out double ironOcrConfidence, IronTesseract tesseract = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | filePath | Relative or Absolute filepath to image to run wizard on. |
| System.String | bestReadResult | Out-variable of the best filter combination Tesseract string read result. |
| System.Double | ironOcrConfidence | Out-variable of confidence of the best read result from Tesseract itself. |
| IronTesseract | tesseract | Optional Tesseract to include. Can be used if multiple languages need to be read. |
Returns
| Type | Description |
|---|---|
| System.String | Code to use to reproduce the best confidence result as a multi-line string. |