How to use the Filter Wizard

This article was translated from English: Does it need improvement?
Translated
View the article in English

When it comes to preprocessing and preparing an image for the OCR process, it can be daunting. Multiple filters can be used on an image; however, it can be complicated to try and test which combination suits your image best, as it is often a case-by-case basis. The process itself can be incredibly time-consuming, as you try different combinations repeatedly to verify which method yields the best results.

However, IronOCR provides an effective and easy way to handle this by introducing the OcrInputFilterWizard. The Filter Wizard automatically evaluates combinations of preprocessing filters to maximize OCR confidence and accuracy. It performs a "brute-force" scan for optimal settings and additionally returns the best filter combination as a code snippet, allowing developers to reproduce the result easily.

In this how-to guide, we'll quickly go through an example of how the Filter Wizard works and showcase the code snippets and parameters it uses.

Quickstart: Automatically discover your ideal image filter chain

Use IronOCR’s Filter Wizard to quickly run all preprocessing filter combinations and get the best-performing code snippet—no guesswork needed. Just one line yields both your highest confidence score and the exact C# filter chain you should use for similar images.

Nuget IconGet started making PDFs with NuGet now:

  1. Install IronOCR with NuGet Package Manager

    PM > Install-Package IronOcr

  2. Copy and run this code snippet.

    string code = OcrInputFilterWizard.Run("image.png", out double confidence, new IronTesseract());
  3. Deploy to test on your live environment

    Start using IronOCR in your project today with a free trial
    arrow pointer

Filter Wizard Example

The OcrInputFilterWizard.Run method takes in three parameters: the input image, an out parameter for the resulting confidence level, and the Tesseract Engine instance.

It works using a brute-force method by repeatedly combining different combinations of preprocess filters to achieve the best confidence score. The highest confidence score at the end determines which set of preprocessing image filters you should ideally apply to your input image.

Do note that there are no presets in the filter wizard, and there's no limit on the combinations it can try. The primary focus of the filter wizard is to achieve the best possible confidence score by testing various combinations of image filters.

Here's a list of all the filters that it can use in its combinations. Note that these are all filter methods available within the IronOCR library:

  • input.Contrast()
  • input.Sharpen()
  • input.Binarize()
  • input.ToGrayScale()
  • input.Invert()
  • input.Deskew()
  • input.Scale(...)
  • input.Denoise()
  • input.DeepCleanBackgroundNoise()
  • input.EnhanceResolution()
  • input.Dilate(), input.Erode()

For a more in-depth look at what each individual filter does, please refer to this extensive tutorial on image filters we have.

Advertencia Since this is a brute-force method, this operation will take some time to complete as it tests many possibilities to find the best result for your image.

Input

For this input, we'll use a screenshot with heavy artificial noise to illustrate the functionality of the filter wizard.

Input Image

Code

:path=/static-assets/ocr/content-code-examples/how-to/filter-wizard-process.cs
using IronOcr;
using System;

// Initialize the Tesseract engine
var ocr = new IronTesseract();

// 1. Pass the image path ("noise.png").
// 2. Pass an 'out' variable to store the best confidence score found.
// 3. Pass the tesseract instance to be used for testing.
string codeToRun = OcrInputFilterWizard.Run("noise.png", out double confidence, ocr);

// The 'confidence' variable is now populated with the highest score achieved.
Console.WriteLine($"Best Confidence Score: {confidence}");

// 'codeToRun' holds the exact C# code snippet that achieved this score.
// The returned string is the code you can use to filter similar images.
Console.WriteLine("Recommended Filter Code:");
Console.WriteLine(codeToRun);
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

Output

Output from Filter Wizard

As you can see from its output, the filter wizard determined that, through all the combinations, 65% confidence is the best it can achieve with this specific image.

AdvertenciaThe input image is highly distorted and heavily impacted by artificial noise. This is an extreme case intended to illustrate how IronOCR's filter wizard can help, even under challenging scenarios.

Filter Wizard Best Combination

After the filter wizard runs, we can then follow the code snippet it provided. We apply those exact settings to our input image to verify the result and confidence.

Code

:path=/static-assets/ocr/content-code-examples/how-to/filter-wizard-best-combination.cs
using IronOcr;
using System;

// Initialize the Tesseract engine
var ocrTesseract = new IronTesseract();

// Load the image into an OcrInput object
using (var input = new OcrImageInput("noise.png"))
{
    // Apply the exact filter chain recommended by the Wizard's output
    input.Invert();
    input.DeNoise();
    input.Contrast();
    input.AdaptiveThreshold();

    // Run OCR on the pre-processed image
    OcrResult result = ocrTesseract.Read(input);

    // Print the final result and confidence
    Console.WriteLine($"Result: {result.Text}");
    Console.WriteLine($"Confidence: {result.Confidence}");
}
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

Output

Output from image

As you can see, IronOCR can make out most of the text even under these heavily distorted conditions, and the confidence level matches what was reported by the filter wizard.

Preguntas Frecuentes

¿Qué es el Asistente de Filtros en IronOCR?

El Asistente de Filtros en IronOCR es una herramienta diseñada para mejorar la precisión de OCR generando código de procesamiento de imágenes personalizado adaptado a tipos de imágenes específicos.

¿Cómo mejora la precisión de OCR el Asistente de Filtros?

El Asistente de Filtros mejora la precisión de OCR al permitir a los usuarios crear filtros de procesamiento de imágenes personalizados que se pueden aplicar a las imágenes antes de realizar OCR, asegurando mejores resultados de reconocimiento de texto.

¿Puedo usar el Asistente de Filtros para diferentes tipos de imágenes?

Sí, el Asistente de Filtros se puede usar para generar código de procesamiento personalizado para una variedad de tipos de imágenes, lo que lo hace versátil para diferentes necesidades de OCR.

¿El Asistente de Filtros es difícil de usar para principiantes?

El Asistente de Filtros está diseñado pensando en la facilidad de uso, por lo que es accesible tanto para principiantes como para usuarios experimentados que desean mejorar sus proyectos de OCR.

¿Cuáles son los beneficios de usar código de procesamiento de imágenes personalizado en OCR?

Usar código de procesamiento de imágenes personalizado puede mejorar significativamente la precisión de la extracción de texto, especialmente en condiciones desafiantes como imágenes de bajo contraste o imágenes con ruido.

¿Necesito habilidades de programación para usar el Asistente de Filtros?

Si bien las habilidades de programación pueden ser beneficiosas, el Asistente de Filtros simplifica el proceso de generación de código de procesamiento de imágenes, haciéndolo accesible a usuarios con diferentes antecedentes técnicos.

¿Puede manejar el Asistente de Filtros el procesamiento por lotes?

El Asistente de Filtros es capaz de generar código que se puede integrar en flujos de trabajo de procesamiento por lotes, permitiendo el manejo eficiente de múltiples imágenes.

¿Qué tipos de imágenes se benefician más del Asistente de Filtros?

Las imágenes con bajo contraste, ruido o fondos complejos se benefician significativamente de las capacidades de procesamiento personalizado del Asistente de Filtros, lo que lleva a mejorar los resultados de OCR.

¿Cómo accedo al Asistente de Filtros en IronOCR?

El Asistente de Filtros se puede acceder dentro del conjunto de IronOCR, proporcionando a los usuarios herramientas para personalizar el procesamiento de imágenes para un rendimiento óptimo de OCR.

¿Hay soporte disponible para usar el Asistente de Filtros?

IronOCR ofrece documentación y recursos de soporte para asistir a los usuarios en la utilización efectiva del Asistente de Filtros para sus tareas de OCR.

Curtis Chau
Escritor Técnico

Curtis Chau tiene una licenciatura en Ciencias de la Computación (Carleton University) y se especializa en el desarrollo front-end con experiencia en Node.js, TypeScript, JavaScript y React. Apasionado por crear interfaces de usuario intuitivas y estéticamente agradables, disfruta trabajando con frameworks modernos y creando manuales bien ...

Leer más
¿Listo para empezar?
Nuget Descargas 5,044,537 | Versión: 2025.11 recién lanzado