Cómo utilizar Iron Tesseract en C
Iron Tesseract en C# se utiliza creando una instancia IronTesseract, configurándola con el idioma y ajustes de OCR, luego llamando al método Read() en un objeto OcrInput que contiene tus imágenes o PDFs. Esto convierte imágenes de texto en PDFs buscables usando el motor optimizado de Tesseract 5.
IronOCR proporciona una API intuitiva para utilizar el Tesseract 5 personalizado y optimizado, conocido como Iron Tesseract. Usando IronOCR y IronTesseract, podrás convertir imágenes de texto y documentos escaneados en texto y PDFs buscables. La biblioteca es compatible con 125 idiomas internacionales e incluye funciones avanzadas como lectura de códigos de barras y visión por ordenador.
Inicio Rápido: Configurar la Configuración de IronTesseract en C#
Este ejemplo demuestra cómo configurar IronTesseract con configuraciones específicas y realizar OCR en una sola línea de código.
-
Instala IronOCR con el Administrador de Paquetes NuGet
-
Copie y ejecute este fragmento de código.
var result = new IronOcr.IronTesseract { Language = IronOcr.OcrLanguage.English, Configuration = new IronOcr.TesseractConfiguration { ReadBarCodes = false, RenderSearchablePdf = true, WhiteListCharacters = "ABCabc123" } }.Read(new IronOcr.OcrInput("image.png")); -
Despliegue para probar en su entorno real
Comienza a usar IronOCR en tu proyecto hoy mismo con una prueba gratuita
Flujo de trabajo básico de OCR
- Instalar la biblioteca OCR con NuGet para leer imágenes
- Utilizar `Tesseract 5` personalizado para realizar OCR
- Cargar los documentos deseados, como imágenes o archivos PDF, para el procesamiento
- Mostrar el texto extraído en la consola o en un archivo
- Guardar el resultado como un PDF buscable
¿Cómo creo una instancia de IronTesseract?
Inicializa un objeto Tesseract con este código:
:path=/static-assets/ocr/content-code-examples/how-to/irontesseract-initialize-irontesseract.cs
using IronOcr;
IronTesseract ocr = new IronTesseract();
Imports IronOcr
Dim ocr As New IronTesseract()
Puedes personalizar el comportamiento de IronTesseract seleccionando diferentes idiomas, habilitando la lectura de códigos de barras y permitiendo/bloqueando caracteres. IronOCR ofrece amplias opciones de configuración para ajustar el proceso de OCR:
:path=/static-assets/ocr/content-code-examples/how-to/irontesseract-configure-irontesseract.cs
IronTesseract ocr = new IronTesseract
{
Configuration = new TesseractConfiguration
{
ReadBarCodes = false,
RenderHocr = true,
TesseractVariables = null,
WhiteListCharacters = null,
BlackListCharacters = "`ë|^",
},
MultiThreaded = false,
Language = OcrLanguage.English,
EnableTesseractConsoleMessages = true, // False as default
};
Dim ocr As New IronTesseract With {
.Configuration = New TesseractConfiguration With {
.ReadBarCodes = False,
.RenderHocr = True,
.TesseractVariables = Nothing,
.WhiteListCharacters = Nothing,
.BlackListCharacters = "`ë|^"
},
.MultiThreaded = False,
.Language = OcrLanguage.English,
.EnableTesseractConsoleMessages = True
}
Una vez configurado, puedes utilizar la funcionalidad de Tesseract para leer objetos OcrInput. La clase OcrInput proporciona métodos flexibles para cargar varios formatos de entrada:
:path=/static-assets/ocr/content-code-examples/how-to/irontesseract-read.cs
IronTesseract ocr = new IronTesseract();
using OcrInput input = new OcrInput();
input.LoadImage("attachment.png");
OcrResult result = ocr.Read(input);
string text = result.Text;
Dim ocr As New IronTesseract()
Using input As New OcrInput()
input.LoadImage("attachment.png")
Dim result As OcrResult = ocr.Read(input)
Dim text As String = result.Text
End Using
Para situaciones complejas, puede aprovechar las capacidades de multithreading para procesar varios documentos simultáneamente, lo que mejora significativamente el rendimiento de las operaciones por lotes.
¿Qué son las variables de configuración avanzadas de Tesseract?
La interfaz de Tesseract en IronOCR permite el control total de las variables de configuración de Tesseract a través de la Clase IronOcr.TesseractConfiguration. Estos ajustes avanzados permiten optimizar el rendimiento del OCR para casos de uso específicos, como corregir escaneos de baja calidad o leer tipos de documentos específicos.
¿Cómo se utiliza la configuración de Tesseract en el código?
:path=/static-assets/ocr/content-code-examples/how-to/irontesseract-tesseract-configuration.cs
using IronOcr;
using System;
IronTesseract Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.English;
Ocr.Configuration.PageSegmentationMode = TesseractPageSegmentationMode.AutoOsd;
// Configure Tesseract Engine
Ocr.Configuration.TesseractVariables["tessedit_parallelize"] = false;
using var input = new OcrInput();
input.LoadImage("/path/file.png");
OcrResult Result = Ocr.Read(input);
Console.WriteLine(Result.Text);
Imports IronOcr
Imports System
Private Ocr As New IronTesseract()
Ocr.Language = OcrLanguage.English
Ocr.Configuration.PageSegmentationMode = TesseractPageSegmentationMode.AutoOsd
' Configure Tesseract Engine
Ocr.Configuration.TesseractVariables("tessedit_parallelize") = False
Dim input = New OcrInput()
input.LoadImage("/path/file.png")
Dim Result As OcrResult = Ocr.Read(input)
Console.WriteLine(Result.Text)
IronOCR también proporciona una configuración especializada para diferentes tipos de documentos. Por ejemplo, al leer pasaportes o procesar cheques MICR, puede aplicar filtros específicos de preprocesamiento y detección de regiones para mejorar la precisión.
Ejemplo de configuración para documentos financieros:
:path=/static-assets/ocr/content-code-examples/how-to/iron-tesseract-6.cs
// Example: Configure for financial documents
IronTesseract ocr = new IronTesseract
{
Language = OcrLanguage.English,
Configuration = new TesseractConfiguration
{
PageSegmentationMode = TesseractPageSegmentationMode.SingleBlock,
TesseractVariables = new Dictionary<string, object>
{
["tessedit_char_whitelist"] = "0123456789.$,",
["textord_heavy_nr"] = false,
["edges_max_children_per_outline"] = 10
}
}
};
// Apply preprocessing filters for better accuracy
using OcrInput input = new OcrInput();
input.LoadPdf("financial-document.pdf");
input.Deskew();
input.EnhanceResolution(300);
OcrResult result = ocr.Read(input);
Imports IronOcr
' Example: Configure for financial documents
Dim ocr As New IronTesseract With {
.Language = OcrLanguage.English,
.Configuration = New TesseractConfiguration With {
.PageSegmentationMode = TesseractPageSegmentationMode.SingleBlock,
.TesseractVariables = New Dictionary(Of String, Object) From {
{"tessedit_char_whitelist", "0123456789.$,"},
{"textord_heavy_nr", False},
{"edges_max_children_per_outline", 10}
}
}
}
' Apply preprocessing filters for better accuracy
Using input As New OcrInput()
input.LoadPdf("financial-document.pdf")
input.Deskew()
input.EnhanceResolution(300)
Dim result As OcrResult = ocr.Read(input)
End Using
¿Cuál es la lista completa de todas las variables de configuración de Tesseract?
Estos se pueden establecer usando IronTesseract.Configuration.TesseractVariables["key"] = value;. Las variables de configuración le permiten ajustar el comportamiento del OCR para obtener resultados óptimos con sus documentos específicos. Para obtener información detallada sobre la optimización del rendimiento de OCR, consulte nuestra guía de configuración de OCR rápido.
| Variable de configuración de Tesseract | Default | Significado |
|---|---|---|
| clasificar_num_cp_niveles | 3 | Número de niveles de podador de clase |
| búsqueda de pestaña de depuración de textord | 0 | Búsqueda de la pestaña de depuración |
| errores de depuración de textord | 0 | Activar la salida relacionada con errores en la búsqueda de pestañas |
| región de prueba de textord_izquierda | -1 | Borde izquierdo del rectángulo de informe de depuración |
| región de prueba de textord_arriba | -1 | Borde superior del rectángulo de informe de depuración |
| región de prueba de textord_derecha | 2147483647 | Borde derecho del rectángulo de depuración |
| región de prueba de textord_inferior | 2147483647 | Borde inferior del rectángulo de depuración |
| textord_tabfind_mostrar_particiones | 0 | Mostrar los límites de la partición, esperando si es >1 |
| nivel de depuración dividido devanagari | 0 | Nivel de depuración para el proceso dividido shiro-rekha. |
| bordes_máximo_de_hijos_por_contorno | 10 | Número máximo de niños dentro del contorno de un personaje |
| bordes_máx._capas_hijas | 5 | Máximo de capas de elementos secundarios anidados dentro del contorno de un personaje |
| bordes_hijos_por_nieto | 10 | Relación de importancia para los contornos de sujeción |
| límite de conteo de niños en los bordes | 45 | Máximo de agujeros permitidos en el blob |
| bordes_min_sin_agujero | 12 | Mínimo de píxeles para caracteres potenciales en el cuadro |
| relación_área_de_ruta_de_aristas | 40 | Max lensq/area for acceptable child outline |
| Error de corte de textord_fp | 2 | Máxima flexión permitida de las celdas de corte |
| textord_tabfind_mostrar_imágenes | 0 | Show image blobs |
| desplazamiento suave y sesgado de textord | 4 | Para un factor de suavidad |
| desplazamiento suave y sesgado de textord2 | 1 | Para un factor de suavidad |
| prueba_textord_x | -2147483647 | coord del paciente de prueba |
| prueba de texto_y | -2147483647 | coord del paciente de prueba |
| textopalabra_min_blobs_en_fila | 4 | Mínimo de blobs antes del gradiente contado |
| textord_spline_minblobs | 8 | Min blobs in each spline segment |
| textord_spline_medianwin | 6 | Size of window for spline segmentation |
| superposiciones de blobs de textord_max | 4 | Max number of blobs a big blob can overlap |
| altura mínima de la x del texto | 10 | Min credible pixel xheight |
| ensayos de línea de textord_lms | 12 | Number of linew fits to do |
| recuento de pérdidas de oldbl_holed | 10 | Max lost before fallback line used |
| versión lineal de pitsync | 6 | Use new fast algorithm |
| pitsync_falsa_profundidad | 1 | Max advance fake generation |
| textord_tabfind_mostrar_anchos_de_trazo | 0 | Show stroke widths |
| brecha de matriz de puntos de textord | 3 | Max pixel gap for broken pixed pitch |
| bloque de depuración de textord | 0 | Block to do debug on |
| rango de paso de textord | 2 | Max range test on pitch |
| poder de veto de textord_words | 5 | Rows required to outvote a veto |
| detección de ecuación_guardar_imagen_bi | 0 | Save input bi image |
| detección de ecuación_guardar_imagen_spt | 0 | Save special character image |
| detección de ecuación_guardar_imagen_semilla | 0 | Save the seed image |
| detección de ecuación_guardar_imagen_combinada | 0 | Save the merged image |
| poli_depuración | 0 | Debug old poly |
| objetos poligonales mejores | 1 | More accurate approx on wide things |
| divisiones de visualización de wordrec | 0 | Display splits |
| textord_debug_imprimible | 0 | Make debug windows printable |
| El tamaño del espacio de texto es variable | 0 | If true, word delimiter spaces are assumed to have variable width, even though characters have fixed pitch. |
| textord_tabfind_mostrar_particiones_iniciales | 0 | Show partition bounds |
| textord_tabfind_mostrar_blobs_rechazados | 0 | Show blobs rejected as noise |
| textord_tabfind_mostrar_columnas | 0 | Show column bounds |
| textord_tabfind_mostrar_bloques | 0 | Show final block bounds |
| textord_tabfind_buscar_tablas | 1 | run table detection |
| imagen de depuración dividida devanagari | 0 | Whether to create a debug image for split shiro-rekha process. |
| textord_show_cortes_fijos | 0 | Draw fixed pitch cell boundaries |
| los bordes usan una nueva complejidad de contorno | 0 | Use the new outline complexity module |
| bordes_depuración | 0 | turn on debugging for this module |
| bordes_niños_arreglo | 0 | Remove boxy parents of char-like children |
| mapa de brechas_depuración | 0 | Say which blocks have tables |
| fin del uso del mapa de brechas | 0 | Use large space at start and end of rows |
| mapa de brechas sin cuantos aislados | 0 | Ensure gaps not less than 2quanta wide |
| textord_pesado_nr | 0 | Vigorously remove noise |
| textord_mostrar_filas_iniciales | 0 | Display row accumulation |
| textord_mostrar_filas_paralelas | 0 | Display page correlated rows |
| textord_mostrar_filas_expandidas | 0 | Display rows after expanding |
| textord_mostrar_filas_finales | 0 | Display rows after final fitting |
| textord_mostrar_blobs_finales | 0 | Display blob bounds after pre-ass |
| paisaje de prueba de textord | 0 | Tests refer to land/port |
| líneas base paralelas de textord | 1 | Force parallel baselines |
| líneas base rectas de textord | 0 | Force straight baselines |
| líneas base antiguas de textord | 1 | Use old baseline algorithm |
| altura_x_antigua_textord | 0 | Use old xheight algorithm |
| textord_corrección_error_altura_x | 1 | Use spline baseline |
| textord_corrección_error_makerow | 1 | Prevent multiple baselines |
| alturas de x de depuración de textord | 0 | Test xheight algorithms |
| cálculo sesgado de textord | 1 | Bias skew estimates with line length |
| sesgo de interpolación de textord | 1 | Interpolate across gaps |
| textord_nueva_altura_x_inicial | 1 | Use test xheight mechanism |
| textord_debug_blob | 0 | Print test blob information |
| textord_realmente_viejo_alturax | 0 | Use original wiseowl xheight |
| textord_oldbl_debug | 0 | Debug old baseline generation |
| líneas base de depuración de textord | 0 | Debug baseline generation |
| textord_oldbl_paradef | 1 | Use para default mechanism |
| splines divididos de textord_oldbl | 1 | Split stepped splines |
| textord_oldbl_fusionar_partes | 1 | Merge suspect partitions |
| oldbl_corrfix | 1 | Improve correlation of heights |
| oldbl_xhfix | 0 | Fix bug in modes threshold for xheights |
| modo textord_ocropus | 0 | Make baselines for ocropus |
| textord_tabfind_only_anchos_de_trazo | 0 | Only run stroke widths |
| textord_tabfind_show_initialtabs | 0 | Show tab candidates |
| textord_tabfind_show_finaltabs | 0 | Show tab vectors |
| textord_mostrar_tablas | 0 | Show table regions |
| textord_tablefind_mostrar_marca | 0 | Debug table marking steps in detail |
| textord_tablefind_mostrar_estadísticas | 0 | Show page stats used in table finding |
| textord_tablefind_reconocer_tablas | 0 | Enables the table recognizer for table layout and filtering. |
| textord_all_prop | 0 | All doc is proportial text |
| prueba de tono de depuración de textord | 0 | Debug on fixed pitch test |
| textord_deshabilitar_prueba_de_tono | 0 | Turn off dp fixed pitch algorithm |
| prueba de tono rápido de textord | 0 | Do even faster pitch algorithm |
| métrica de paso de depuración de textord | 0 | Write full metric stuff |
| textord_mostrar_cortes_de_fila | 0 | Draw row-level cuts |
| textord_mostrar_cortes_de_página | 0 | Draw page-level cuts |
| trucos de tono de textord | 0 | Use correct answer for fixed/prop |
| textord_blockndoc_arreglado | 0 | Attempt whole doc/block fixed pitch |
| textord_mostrar_palabras_iniciales | 0 | Display separate words |
| textord_mostrar_nuevas_palabras | 0 | Display separate words |
| textord_mostrar_palabras_fijas | 0 | Display forced fixed pitch words |
| textord_blocksall_arreglado | 0 | Moan about prop blocks |
| bloque de texto_todo_prop | 0 | Moan about fixed pitch blocks |
| Pruebas de textord_blocksall | 0 | Dump stats when moaning |
| modo de prueba de textord | 0 | Do current test |
| similitud de filas de paso de texto | 0.08 | Fraction of xheight for sameness |
| palabras_inicial_minúscula | 0.5 | Max initial cluster size |
| palabras_inicial_mayúscula | 0.15 | Min initial cluster spacing |
| palabras_predeterminadas_prop_sin espacio | 0.25 | Fraction of xheight |
| palabras_predeterminadas_espacio_fijo | 0.75 | Fraction of xheight |
| límite fijo predeterminado de palabras | 0.6 | Allowed size variance |
| propagación definida de palabras de textord | 0.3 | Non-fuzzy spacing region |
| relación de tamaño de espacio de texto | 2.8 | Min ratio space/nonspace |
| relación de tamaño de espacio de texto | 2 | Min ratio space/nonspace |
| relación fpiqr_textord | 1.5 | Pitch IQR/Gap IQR threshold |
| textord_máximo_paso_iq | 0.2 | Xh fraction noise in pitch |
| ancho mínimo de textord_fp | 0.5 | Min width of decent blobs |
| desplazamiento de subrayado de texto | 0.1 | Fraction of x to ignore |
| nivel de depuración de ambigs | 0 | Debug level for unichar ambiguities |
| clasificar_nivel_de_depuración | 0 | Classify debug level |
| método de clasificación de normas | 1 | Normalization Method ... |
| nivel de depuración del comparador | 0 | Matcher Debug Level |
| indicadores de depuración del comparador | 0 | Matcher Debug Flags |
| clasificar_aprendizaje_nivel_de_depuración | 0 | Learning Debug Level: |
| matcher_permanent_classes_min | 1 | Min # of permanent classes |
| ejemplos de matcher_min para creación de prototipos | 3 | Reliable Config Threshold |
| ejemplos_suficientes_de_comparación_para_la_creación_de_prototipos | 5 | Enable adaption even if the ambiguities have not been seen |
| clasificar_adaptar_proto_umbral | 230 | Threshold for good protos during adaptive 0-255 |
| clasificar_adaptar_umbral_de_características | 230 | Threshold for good features during adaptive 0-255 |
| clasificar_clase_podador_umbral | 229 | Class Pruner Threshold 0-255 |
| clasificar_multiplicador_podador_de_clases | 15 | Class Pruner Multiplier 0-255: |
| clasificar_fuerza_de_corte_cp | 7 | Class Pruner CutoffStrength: |
| clasificar_multiplicador_comparador_de_enteros | 10 | Integer Matcher Multiplier 0-255: |
| nivel de depuración de dawg | 0 | Set to 1 for general debug info, to 2 for more details, to 3 to see all the debug messages |
| nivel de depuración de guión | 0 | Debug level for hyphenated words. |
| tapón_pequeño_tamaño_de_palabra | 2 | Size of dict word to be treated as non-dict word |
| nivel de depuración del tapón | 0 | Stopper debug level |
| registro de selección de palabras truncado de tessedit | 10 | Max words to keep in list |
| intentos máximos de permutación | 10000 | Maximum number of different character choices to consider during permutation. This limit is especially useful when user patterns are specified, since overly generic patterns can result in dawg search exploring an overly large number of options. |
| reparar manchas no cortadas | 1 | Fix blobs that aren't chopped |
| cortar_depuración | 0 | Chop debug |
| longitud de división | 10000 | Split Length |
| cortar_misma_distancia | 2 | Same distance |
| puntos de contorno mínimos de chop | 6 | Min Number of Points on Outline |
| tamaño de pila de costura cortada | 150 | Max number of seams in seam_pile |
| cortar_el_ángulo_interior | -50 | Min Inside Angle Bend |
| área de contorno de chop_min | 2000 | Min Outline Area |
| ancho máximo centrado en el corte | 90 | Width of (smaller) chopped blobs above which we don't care that a chop is not near the center. |
| peso de corte x y | 3 | X / Y length weight |
| nivel de depuración de wordrec | 0 | Debug level for wordrec |
| fragmentos de unión de wordrec_max | 4 | Max number of broken pieces to associate |
| nivel de depuración de segsearch | 0 | SegSearch debug level |
| segsearch_máximos_puntos_de_dolor | 2000 | Maximum number of pain points stored in the queue |
| segsearch_max_futile_classifications | 20 | Maximum number of pain point classifications per chunk that did not result in finding a better word choice. |
| nivel de depuración del modelo de lenguaje | 0 | Language model debug level |
| orden de ngramas del modelo de lenguaje | 8 | Maximum order of the character ngram model |
| modelo de idioma_lista_viterbi_máximo_podable | 10 | Maximum number of prunable (those for which PrunablePath() is true) entries in each viterbi list recorded in BLOB_CHOICEs |
| modelo_de_idioma_viterbi_lista_tamaño_máximo | 500 | Maximum size of viterbi lists recorded in BLOB_CHOICEs |
| longitud mínima del compuesto del modelo de idioma | 3 | Minimum length of compound words |
| segmentaciones de visualización de wordrec | 0 | Display Segmentations |
| modo tessedit_pageseg | 6 | Page seg mode: 0=osd only, 1=auto+osd, 2=auto_only, 3=auto, 4=column, 5=block_vert, 6=block, 7=line, 8=word, 9=word_circle, 10=char,11=sparse_text, 12=sparse_text+osd, 13=raw_line (Values from PageSegMode enum in tesseract/publictypes.h) |
| modo de motor tessedit_ocr | 2 | Which OCR engine(s) to run (Tesseract, LSTM, both). Defaults to loading and running the most accurate available. |
| páginaseg_devanagari_split_strategy | 0 | Whether to use the top-line splitting process for Devanagari documents while performing page-segmentation. |
| estrategia de división de ocr_devanagari | 0 | Whether to use the top-line splitting process for Devanagari documents while performing ocr. |
| depuración bidireccional | 0 | Debug level for BiDi |
| aplicar_box_debug | 1 | Debug level |
| página de caja de aplicación | 0 | Page number to apply boxes from |
| depuración de tessedit_bigram | 0 | Amount of debug output for bigram correction. |
| eliminación de ruido de depuración | 0 | Debug reassignment of small outlines |
| ruido_máximo por gota | 8 | Max diacritics to apply to a blob |
| ruido_máximo_por_palabra | 16 | Max diacritics to apply to a word |
| nivel_ht_debug_x | 0 | Reestimate debug |
| alfas iniciales mínimas de calidad requeridas | 2 | alphas in a good word |
| tessedit_tess_adaption_mode | 39 | Adaptation decision algorithm for tess |
| nivel de depuración multilang | 0 | Print multilang debug info. |
| nivel de depuración de párrafo | 0 | Print paragraph debug info. |
| tessedit_preservar_min_wd_len | 2 | Only preserve wds longer than this |
| calificación máxima de crunch | 10 | For adj length in rating per ch |
| indicadores de crunch_pot | 1 | How many potential indicators needed |
| crunch_leave_lc_strings | 4 | Don't crunch words with long lower case strings |
| crunch_leave_uc_strings | 4 | Don't crunch words with long lower case strings |
| crunch_largas_repeticiones | 3 | Crunch words with long repetitions |
| crunch_debug | 0 | As it says |
| fixsp_sin_límite_de_ruido | 1 | How many non-noise blbs either side? |
| modo fixsp_done | 1 | What constitues done for spacing |
| nivel de espacio de corrección de depuración | 0 | Contextual fixspace debug |
| tolerancia de aceptación x_ht | 8 | Max allowed deviation of blob top outside of font data |
| cambio de x_ht_min | 8 | Min change in xht before actually trying it |
| superíndice_depuración | 0 | Debug level for sub & superscript fixer |
| calidad jpg | 85 | Set JPEG quality level |
| dpi definidos por el usuario | 0 | Specify DPI for input image |
| min_caracteres_a_probar | 50 | Specify minimum characters to try during OSD |
| suspect_level | 99 | Suspect marker level |
| suspect_short_words | 2 | Don't suspect dict wds longer than this |
| modo de rechazo de tessedit | 0 | Rejection algorithm |
| borde de imagen de tessedit | 2 | Rej blbs near image edge limit |
| píxeles min_sane_x_ht | 8 | Reject any x-ht lt or eq than this |
| número de página de tessedit | -1 | -1 -> All pages, else specific page to process |
| tessedit_paralelizar | 1 | Run in parallel where possible |
| modo de elección lstm | 2 | Allows to include alternative symbols choices in the hOCR output. Valid input values are 0, 1 and 2. 0 is the default value. With 1 the alternative symbol choices per timestep are included. With 2 alternative symbol choices are extracted from the CTC process instead of the lattice. The choices are mapped per character. |
| iteraciones de elección lstm | 5 | Sets the number of cascading iterations for the Beamsearch in modo de elección lstm. Note that modo de elección lstm must be set to a value greater than 0 to produce results. |
| nivel de depuración de tosp | 0 | Debug data |
| tosp_suficientes_muestras_de_espacio_para_la_mediana | 3 | or should we use mean |
| límite de kern de rehacer tosp | 10 | No.samples reqd to reestimate for row |
| tosp_few_samples | 40 | No.gaps reqd with 1 large gap to treat as a table |
| tosp_fila corta | 20 | No.gaps reqd with few cert spaces to use certs |
| método de sanidad tosp | 1 | How to avoid being silly |
| tamaño máximo de ruido de textord | 7 | Pixel size of noise |
| depuración de línea base de textord | 0 | Baseline debug level |
| Fracción del tamaño del ruido de texto | 10 | Fraction of size for maxima |
| límite de transmisión de ruido de texto | 16 | Transitions for normal blob |
| recuento de ruido de textord | 1 | super norm blobs to save row |
| use_ambigs_para_adaptación | 0 | Use ambigs for deciding whether to adapt to a character |
| priorizar_división | 0 | Prioritize blob division over chopping |
| clasificar_habilitar_aprendizaje | 1 | Enable adaptive classifier |
| tess_cn_matching | 0 | Character Normalized Matching |
| tess_bn_coincidencia | 0 | Baseline Normalized Matching |
| clasificar_habilitar_comparador_adaptativo | 1 | Enable adaptive classifier |
| clasificar_utilizar_plantillas_preadaptadas | 0 | Use pre-adapted classifier templates |
| clasificar_guardar_plantillas_adaptadas | 0 | Save adapted templates to a file |
| clasificar_habilitar_depurador_adaptativo | 0 | Enable match debugger |
| clasificar_norma_no_lineal | 0 | Non-linear stroke-density normalization |
| disable_character_fragments | 1 | Do not include character fragments in the results of the classifier |
| clasificar_fragmentos_de_caracteres_de_depuración | 0 | Bring up graphical debugging windows for fragments training |
| ventanas separadas de depuración de matcher | 0 | Use two different windows for debugging the matching: One for the protos and one for the features. |
| clasificar_bln_modo_numérico | 0 | Assume the input is numbers [0-9]. |
| sistema de carga dawg | 1 | Load system word dawg. |
| frecuencia de carga dawg | 1 | Load frequent word dawg. |
| cargar_unambig_dawg | 1 | Load unambiguous word dawg. |
| carga_punc_dawg | 1 | Load dawg with punctuation patterns. |
| número de carga dawg | 1 | Load dawg with number patterns. |
| cargar_bigram_dawg | 1 | Load dawg with special word bigrams. |
| use_solo_el_primer_paso_uft8 | 0 | Use only the first UTF8 step of the given string when computing log probabilities. |
| tapón_sin_opciones_aceptables | 0 | Make AcceptableChoice() always return false. Useful when there is a need to explore all segmentations |
| segmento_script_no_alfabético | 0 | Don't use any alphabetic-specific tricks. Set to true in the traineddata config file for scripts that are cursive or inherently fixed-pitch |
| guardar_doc_words | 0 | Save Document Words |
| fusionar fragmentos en la matriz | 1 | Merge the fragments in the ratings matrix and delete them after merging |
| wordrec_enable_assoc | 1 | Associator Enable |
| asociación de palabras de fuerza | 0 | force associator to run regardless of what enable_assoc is. This is used for CJK where component grouping is necessary. |
| habilitar chop | 1 | Chop enable |
| deslizamiento vertical de corte | 0 | Vertical creep |
| cortar_nueva_cosecha_pila | 1 | Use new seam_pile |
| asumir_segmento_de_caracteres_de_paso_fijo | 0 | include fixed-pitch heuristics in char segmentation |
| wordrec_skip_no_truth_words | 0 | Only run OCR for words that had truth recorded in BlamerBundle |
| Culpable de depuración de wordrec | 0 | Print blamer debug messages |
| culpar a wordrec_run_bamer | 0 | Try to set the blame for errors |
| guardar_opciones_alt | 1 | Save alternative paths found during chopping and segmentation search |
| language_model_ngram_on | 0 | Turn on/off the use of character ngram model |
| language_model_ngram_use_only_first_uft8_step | 0 | Use only the first UTF8 step of the given string when computing log probabilities. |
| modelo_de_lenguaje_espacio_ngrama_lenguaje_delimitado | 1 | Words are delimited by space |
| modelo_de_lenguaje_utiliza_certeza_sigmoidea | 0 | Use sigmoidal score for certainty |
| tessedit_resegment_de_cajas | 0 | Take segmentation and labeling from box file |
| tessedit_resegment_de_cajas_de_línea | 0 | Conversion of word/line box file to char box file |
| tessedit_train_from_boxes | 0 | Generate training data from boxed chars |
| tessedit_hacer_cajas_a_partir_de_cajas | 0 | Generate more boxes from boxed chars |
| tessedit_reconocedor_de_líneas_de_tren | 0 | Break input into lines and remap boxes if present |
| imágenes de tessedit_dump_pageseg | 0 | Dump intermediate images made during page segmentation |
| tessedit_do_invert | 1 | Try inverting the image in LSTMRecognizeWord |
| entrenamiento de tessedit_ambigs | 0 | Perform training for ambiguities |
| depuración de adaptación de tessedit | 0 | Generate and print debug information for adaption |
| modo applybox_learn_chars_and_char_frags | 0 | Learn both character fragments (as is done in the special low exposure mode) as well as unfragmented characters. |
| modo applybox_learn_ngrams | 0 | Each bounding box is assumed to contain ngrams. Only learn the ngrams whose outlines overlap horizontally. |
| tessedit_mostrar_palabras_fuera | 0 | Draw output words |
| opciones de volcado de tessedit | 0 | Dump char choices |
| depuración de tiempo de tessedit | 0 | Print timing stats |
| tessedit_arregla_espacios_difusos | 1 | Try to improve fuzzy spaces |
| tessedit_unrej_any_wd | 0 | Don't bother with word plausibility |
| tessedit_fix_guiones | 1 | Crunch double hyphens? |
| tessedit_habilitar_doc_dict | 1 | Add words to the document dictionary |
| fuentes de depuración de tessedit | 0 | Output font info per char |
| rechazo de bloque de depuración de tessedit | 0 | Block and Row stats |
| tessedit_habilitar_corrección_de_bigramas | 1 | Enable correction based on the word bigram dictionary. |
| tessedit_habilitar_corrección_dict | 0 | Enable single word correction based on the dictionary. |
| habilitar_eliminación_de_ruido | 1 | Remove and conditionally reassign small outlines when they confuse layout analysis, determining diacritics vs noise |
| tessedit_minimal_rej_pass1 | 0 | Do minimal rejection on pass 1 output |
| adaptación de la prueba tessedit | 0 | Test adaption criteria |
| prueba_pt | 0 | Test for point |
| párrafo_basado_en_texto | 1 | Run paragraph detection on the post-text-recognition (more accurate) |
| matriz de uso lstm | 1 | Use ratings matrix/beam search with lstm |
| tessedit_buena_calidad_unrej | 1 | Reduce rejection on good docs |
| tessedit_use_reject_spaces | 1 | Reject spaces? |
| tessedit_preserve_blk_rej_perfect_wds | 1 | Only rej partially rejected words in block rejection |
| tessedit_preserve_row_rej_perfect_wds | 1 | Only rej partially rejected words in row rejection |
| tessedit_dont_blkrej_good_wds | 0 | Use word segmentation quality metric |
| tessedit_dont_rowrej_good_wds | 0 | Use word segmentation quality metric |
| tessedit_row_rej_good_docs | 1 | Apply row rejection to good docs |
| tessedit_reject_bad_qual_wds | 1 | Reject all bad quality wds |
| tessedit_debug_doc_rejection | 0 | Page stats |
| tessedit_debug_quality_metrics | 0 | Output data to debug file |
| bland_unrej | 0 | unrej potential with no checks |
| unlv_tilde_crunching | 0 | Mark v.bad words for tilde crunch |
| información de fuente hocr | 0 | Add font info to hocr output |
| cajas de caracteres hocr | 0 | Add coordinates for each character to hocr output |
| La fusión temprana de crunch falla | 1 | Before word crunch? |
| crunch_conversión temprana_mala_unlv_chs | 0 | Take out ~^ early? |
| crujido_terrible_basura | 1 | As it says |
| crunch_leave_ok_strings | 1 | Don't touch sensible strings |
| crunch_accept_ok | 1 | Use acceptability in okstring |
| crunch_leave_accept_strings | 0 | Don't pot crunch sensible strings |
| crunch_include_numerals | 0 | Fiddle alpha figures |
| tessedit_prefer_joined_punct | 0 | Reward punctuation joins |
| tessedit_write_block_separators | 0 | Write block separators in output |
| tessedit_write_rep_codes | 0 | Write repetition char code |
| tessedit_write_unlv | 0 | Write .unlv output file |
| tessedit_create_txt | 0 | Write .txt output file |
| tessedit_create_hocr | 0 | Write .html hOCR output file |
| tessedit_create_alto | 0 | Write .xml ALTO file |
| tessedit_create_lstmbox | 0 | Write .box file for LSTM training |
| tessedit_create_tsv | 0 | Write .tsv output file |
| tessedit_create_wordstrbox | 0 | Write WordStr format .box output file |
| tessedit_create_pdf | 0 | Write .pdf output file |
| textonly_pdf | 0 | Create PDF with only one invisible text layer |
| suspect_constrain_1Il | 0 | UNLV keep 1Il chars rejected |
| tessedit_minimal_rejection | 0 | Only reject tess failures |
| tessedit_zero_rejection | 0 | Don't reject ANYTHING |
| tessedit_word_for_word | 0 | Make output have exactly one word per WERD |
| tessedit_zero_kelvin_rejection | 0 | Don't reject ANYTHING AT ALL |
| tessedit_rejection_debug | 0 | Adaption debug |
| tessedit_flip_0O | 1 | Contextual 0O O0 flips |
| rej_trust_doc_dawg | 0 | Use DOC dawg in 11l conf. detector |
| rej_1Uso dict_word | 0 | Use dictword test |
| rej_1Il_trust_permuter_type | 1 | Don't double check |
| rej_use_tess_aceptado | 1 | Individual rejection control |
| rej_use_tess_blanks | 1 | Individual rejection control |
| rej_use_good_perm | 1 | Individual rejection control |
| rej_use_sensible_wd | 0 | Extend permuter check |
| rej_alphas_en_número_perm | 0 | Extend permuter check |
| tessedit_create_boxfile | 0 | Output text with boxes |
| tessedit_escribir_imágenes | 0 | Capture the image from the IPE |
| modo de visualización interactiva | 0 | Run interactively? |
| permutador de anulación de tessedit | 1 | According to dict_word |
| tessedit_use_modelo_de_parámetros_primarios | 0 | In multilingual mode use params model of the primary language |
| textord_tabfind_mostrar_líneas_v | 0 | Debug line finding |
| textord_use_cjk_fp_model | 0 | Use CJK fixed pitch model |
| poly_allow_detailed_fx | 0 | Allow feature extractors to see the original outline |
| tessedit_init_config_only | 0 | Only initialize with the config file. Useful if the instance is not going to be used for OCR but say only for layout analysis. |
| detección de ecuaciones de texto | 0 | Turn on equation detector |
| textord_tabfind_texto_vertical | 1 | Enable vertical detection |
| textord_tabfind_force_vertical_text | 0 | Force using vertical text page mode |
| preservar_los_espacios_entre_palabras | 0 | Preserve multiple interword spaces |
| pageseg_aplicar_máscara_musical | 1 | Detect music staff and remove intersecting components |
| modo de altura única de textord | 0 | Script has no xheight, so use a single mode |
| método tosp_old_to | 0 | Space stats use prechopping? |
| tosp_old_para_restringir_sp_kn | 0 | Constrain relative values of inter and intra-word gaps for old_to_method. |
| tosp_solo_use_prop_rows | 1 | Block stats to use fixed pitch rows? |
| tosp_forzar_ruptura_de_palabra_al_punct | 0 | Force word breaks on punct to break long lines in non-space delimited langs |
| tosp_use_pre_cortar | 0 | Space stats use prechopping? |
| tosp_old_to_bug_fix | 0 | Fix suspected bug in old code |
| tosp_block_use_cert_spaces | 1 | Only stat OBVIOUS spaces |
| tosp_row_use_cert_spaces | 1 | Only stat OBVIOUS spaces |
| tosp_narrow_blobs_no_certificado | 1 | Only stat OBVIOUS spaces |
| tosp_row_use_cert_spaces1 | 1 | Only stat OBVIOUS spaces |
| estadísticas de filas aisladas de recuperación de tosp | 1 | Use row alone when inadequate cert spaces |
| solo pequeños espacios para el kern | 0 | Better guess |
| tosp_all_flips_fuzzy | 0 | Pass ANY flip to context? |
| límite difuso total | 1 | Don't restrict kn->sp fuzzy limit to tables |
| textord_sin_rechazos | 0 | Don't remove noise blobs |
| textord_mostrar_blobs | 0 | Display unsorted blobs |
| cuadros de presentación de textord | 0 | Display unsorted blobs |
| textord_ruido_rejwords | 1 | Reject noise-like words |
| ruido de texto_rejrows | 1 | Reject noise-like rows |
| depuración de ruido de textord | 0 | Debug row garbage detector |
| clasificar_aprender_depurar_str | Class str to debug learning | |
| archivo de palabras del usuario | A filename of user-provided words. | |
| sufijo de palabras de usuario | A suffix of user-provided words located in tessdata. | |
| archivo de patrones de usuario | A filename of user-provided patterns. | |
| sufijo de patrones de usuario | A suffix of user-provided patterns located in tessdata. | |
| archivo de palabras ambiguas de salida | Output file for ambiguities found in the dictionary | |
| palabra_a_depurar | Word for which stopper debug information should be printed to stdout | |
| lista negra de caracteres de tessedit | Blacklist of chars not to recognize | |
| lista blanca de caracteres de tessedit | Whitelist of chars to recognize | |
| tessedit_char_unblacklist | List of chars to override lista negra de caracteres de tessedit | |
| tessedit_write_params_to_file | Write all parameters to the given file. | |
| patrón de exposición del cuadro de aplicación | .exp | Exposure value follows this pattern in the image filename. The name of the image files are expected to be in the form [lang].[fontname].exp [num].tif |
| chs_leading_punct('`" | Puntuación inicial | |
| chs_trailing_punct1 | ¡).,;:?! | 1st Trailing punctuation |
| chs_trailing_punct2)'`" | 2nd Trailing punctuation | |
| contornos_impares | %| | Número no estándar de contornos |
| contornos_2ij!?%":; | Número no estándar de contornos | |
| puntuación numérica | ., | Punct. chs expected WITHIN numbers |
| carácter no reconocido | | | Output char for unidentified blobs |
| ok_repetido_ch_no_alphanum_wds | -?*= | Allow NN to unrej |
| conjunto_de_conflictos_I_l_1 | Il1 [] | Il1 conflict set |
| tipo de archivo | .tif | Filename extension |
| tessedit_load_sublangs | List of languages to load with this one | |
| separador de páginas | Page separator (default is form feed control character) | |
| clasificar_rango_de_norma_de_caracteres | 0.2 | Character Normalization Range ... |
| clasificar_cociente_máximo_de_calificación | 1.5 | Veto ratio between classifier ratings |
| clasificar_máximo_margen_de_certeza | 5.5 | Veto difference between classifier certainties |
| umbral bueno del comparador | 0.125 | Good Match (0-1) |
| resultado adaptativo confiable del comparador | 0 | Great Match (0-1) |
| umbral perfecto del comparador | 0.02 | Perfect Match (0-1) |
| pad de emparejamiento incorrecto | 0.15 | Bad Match Pad (0-1) |
| margen de calificación del comparador | 0.1 | New template margin (0-1) |
| tamaño promedio de ruido del comparador | 12 | Avg. noise blob length |
| delta del ángulo máximo de agrupación del comparador | 0.015 | Maximum angle delta for prototype clustering |
| clasificar_penalización_basura_inadaptada | 0 | Penalty to apply when a non-alnum is vertically out of its expected textline position |
| escala de calificación | 1.5 | Rating scaling factor |
| escala de certeza | 20 | Certainty scaling factor |
| escala de fallas de clase tessedit | 0.00390625 | Scale factor for features not used |
| factor de poda adaptado para clasificar | 2.5 | Prune poor adapted results this much worse than best result |
| clasificar_umbral_de_poda_adaptado | -1 | Threshold at which factor de poda adaptado para clasificar starts |
| clasificar_fragmentos_de_caracteres_umbral_de_certeza_de_basura | -3 | Exclude fragments that do not look like whole characters from training and adaption |
| tamaño máximo de mota grande | 0.3 | Max large speckle size |
| penalización por moteado | 10 | Penalty to add to worst rating for noise |
| subíndices de penalización de altura x | 0.125 | Score penalty (0.1 = 10%) added if there are subscripts or superscripts in a word, but it is otherwise OK. |
| penalización de altura x inconsistente | 0.25 | Score penalty (0.1 = 10%) added if an xheight is inconsistent. |
| segmento_penalización_dict_palabra_frecuente | 1 | Score multiplier for word matches which have good case and are frequent in the given language (lower is better). |
| caso de dictamen de penalización de segmento ok | 1.1 | Score multiplier for word matches that have good case (lower is better). |
| caso de dictámenes de penalización de segmento incorrecto | 1.3125 | Default score multiplier for word matches, which may have case issues (lower is better). |
| segmento_penalización_dict_nonword | 1.25 | Score multiplier for glyph fragment segmentations which do not match a dictionary word (lower is better). |
| escala de certeza | 20 | Certainty scaling factor |
| stopper_nondict_certainty_base | -2.5 | Certainty threshold for non-dict words |
| stopper_phase2_certainty_rejection_offset | 1 | Reject certainty offset |
| stopper_certainty_per_char | -0.5 | Certainty to add for each dict char above small word size. |
| stopper_allowable_character_badness | 3 | Max certaintly variation allowed in a word (in sigma) |
| doc_dict_pending_threshold | 0 | Worst certainty for using pending dictionary |
| umbral de certeza de doc_dict | -2.25 | Worst certainty for words that can be inserted into the document dictionary |
| umbral de certeza de tessedit | -2.25 | Good blob limit |
| chop_split_dist_knob | 0.5 | Split length adjustment |
| chop_overlap_knob | 0.9 | Split overlap adjustment |
| chop_center_knob | 0.15 | Split center adjustment |
| chop_sharpness_knob | 0.06 | Split sharpness adjustment |
| chop_width_change_knob | 5 | Width change adjustment |
| chop_ok_split | 100 | OK split limit |
| chop_good_split | 50 | Good split limit |
| relación wh_máx_carácter_segsearch | 2 | Relación máxima entre el ancho y la altura de los caracteres |
Para obtener los mejores resultados, se recomienda utilizar los filtros de preprocesamiento de imágenes de IronOCR antes de aplicar el OCR. Estos filtros pueden mejorar drásticamente la precisión, especialmente cuando se trabaja con escaneados de baja calidad o documentos complejos como tablas.
Preguntas Frecuentes
¿Cómo configuro IronTesseract para OCR en C#?
Para configurar IronTesseract, cree una instancia de IronTesseract y establezca propiedades como Idioma y Configuración. Puede especificar el idioma de OCR (de los 125 idiomas admitidos), activar la lectura de códigos de barras, configurar la salida de PDF con capacidad de búsqueda y establecer listas blancas de caracteres. Por ejemplo: var tesseract = new IronOcr.IronTesseract { Language = IronOcr.OcrLanguage.English, Configuration = new IronOcr.TesseractConfiguration { ReadBarCodes = false, RenderSearchablePdf = true } };
¿Qué formatos de entrada admite IronTesseract?
IronTesseract acepta varios formatos de entrada a través de la clase OcrInput. Puede procesar imágenes (PNG, JPG, etc.), archivos PDF y documentos escaneados. La clase OcrInput proporciona métodos flexibles para cargar estos diferentes formatos, lo que facilita la realización de OCR en prácticamente cualquier documento que contenga texto.
¿Puedo leer códigos de barras junto con texto utilizando IronTesseract?
Sí, IronTesseract incluye funciones avanzadas de lectura de códigos de barras. Puede activar la detección de códigos de barras estableciendo ReadBarCodes = true en TesseractConfiguration. Esto le permite extraer datos de texto y de código de barras del mismo documento en una sola operación de OCR.
¿Cómo puedo crear archivos PDF con función de búsqueda a partir de documentos escaneados?
IronTesseract puede convertir documentos e imágenes escaneados en archivos PDF con capacidad de búsqueda estableciendo RenderSearchablePdf = true en TesseractConfiguration. De este modo se crean archivos PDF en los que el texto se puede seleccionar y en los que se pueden realizar búsquedas, al tiempo que se mantiene el aspecto original del documento.
¿Qué idiomas admite IronTesseract para OCR?
IronTesseract admite 125 idiomas internacionales para el reconocimiento de texto. Puede especificar el idioma estableciendo la propiedad Language en su instancia de IronTesseract, como IronOcr.OcrLanguage.English, español, chino, árabe y muchos otros.
¿Puedo restringir los caracteres que se reconocen durante el OCR?
Sí, IronTesseract permite la creación de listas blancas y negras de caracteres mediante la propiedad WhiteListCharacters de TesseractConfiguration. Esta característica ayuda a mejorar la precisión cuando se conoce el conjunto de caracteres esperado, como limitar el reconocimiento sólo a caracteres alfanuméricos.
¿Cómo puedo realizar el OCR en varios documentos a la vez?
IronTesseract admite capacidades multihilo para el procesamiento por lotes. Puede aprovechar el procesamiento paralelo para realizar el reconocimiento óptico de caracteres de varios documentos simultáneamente, lo que mejora significativamente el rendimiento cuando se trabaja con grandes volúmenes de imágenes o archivos PDF.
¿Qué versión de Tesseract utiliza IronOCR?
IronOCR utiliza una versión personalizada y optimizada de Tesseract 5, conocida como Iron Tesseract. Este motor mejorado proporciona una mayor precisión y rendimiento en comparación con las implementaciones estándar de Tesseract, al tiempo que mantiene la compatibilidad con las aplicaciones .NET.
¿Cómo puede IronOCR mejorar la precisión de los datos?
IronOCR mejora la precisión de los datos a través de sus algoritmos de reconocimiento avanzados y características de corrección de imágenes, asegurando que el proceso de extracción de texto sea tanto confiable como preciso.
¿Hay una prueba gratuita disponible para IronOCR?
Sí, Iron Software ofrece una prueba gratuita de IronOCR, permitiendo a los usuarios probar sus características y capacidades antes de tomar una decisión de compra.

