Wie man Text aus einer Bilddatei extrahiert

Wie man Iron Tesseract in C#35 verwendet

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

Iron Tesseract in C# wird verwendet, indem eine IronTesseract-Instanz erstellt, diese mit Sprache und OCR-Einstellungen konfiguriert und dann die Read()-Methode auf einem OcrInput-Objekt aufgerufen wird, das Ihre Bilder oder PDFs enthält. Dies konvertiert Bilder von Text in durchsuchbare PDFs mit dem optimierten Engine von Tesseract 5.

IronOCR bietet eine intuitive API zur Nutzung des angepassten und optimierten Tesseract 5, bekannt als Iron Tesseract. Durch die Verwendung von IronOCR und IronTesseract können Sie Bilder von Text und gescannte Dokumente in Text und durchsuchbare PDFs umwandeln. Die Bibliothek unterstützt 125 internationale Sprachen und umfasst erweiterte Funktionen wie Barcode-Lesen und Computer Vision.

Schnellstart: IronTesseract-Konfiguration in C# einrichten

Dieses Beispiel zeigt, wie IronTesseract mit spezifischen Einstellungen konfiguriert wird und OCR in einer einzigen Codezeile durchgeführt wird.

  1. Installieren Sie IronOCR mit NuGet Package Manager

    PM > Install-Package IronOcr
  2. Kopieren Sie diesen Codeausschnitt und führen Sie ihn aus.

    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"));
  3. Bereitstellen zum Testen in Ihrer Live-Umgebung

    Beginnen Sie noch heute, IronOCR in Ihrem Projekt zu verwenden, mit einer kostenlosen Testversion

    arrow pointer

Wie erstelle ich eine IronTesseract-Instanz?

Initialisieren Sie ein Tesseract-Objekt mit diesem Code:

: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()
$vbLabelText   $csharpLabel

Sie können das Verhalten von IronTesseract anpassen, indem Sie verschiedene Sprachen auswählen, Barcodelesen aktivieren und Zeichen auf die Positiv-/Negativliste setzen. IronOCR bietet umfassende Konfigurationsoptionen zur Feinabstimmung Ihres OCR-Prozesses:

: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
}
$vbLabelText   $csharpLabel

Sobald es konfiguriert ist, können Sie die Tesseract-Funktionalität verwenden, um OcrInput-Objekte zu lesen. Die OcrInput-Klasse bietet flexible Methoden zum Laden verschiedener Eingabeformate:

: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
$vbLabelText   $csharpLabel

Für komplexe Szenarien können Sie die Multithreading-Funktionen nutzen, um mehrere Dokumente gleichzeitig zu verarbeiten, was die Leistung bei Stapelverarbeitungsvorgängen erheblich verbessert.

Was sind die erweiterten Tesseract-Konfigurationsvariablen?

Die IronOCR Tesseract-Schnittstelle ermöglicht die volle Kontrolle über die Tesseract-Konfigurationsvariablen über die IronOcr.TesseractConfiguration Klasse. Mit diesen erweiterten Einstellungen können Sie die OCR-Leistung für bestimmte Anwendungsfälle optimieren, z. B. Fixieren von Scans mit niedriger Qualität oder Lesen bestimmter Dokumenttypen.

Wie verwende ich die Tesseract-Konfiguration im Code?

: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)
$vbLabelText   $csharpLabel

IronOCR bietet auch eine spezielle Konfiguration für verschiedene Dokumenttypen. So können Sie beispielsweise beim Lesen von Reisepässen oder bei der Verarbeitung von MICR-Schecks spezifische Vorverarbeitungsfilter und Bereichserkennung anwenden, um die Genauigkeit zu verbessern.

Beispielkonfiguration für Finanzdokumente:

: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
$vbLabelText   $csharpLabel

Was ist die vollständige Liste aller Tesseract-Konfigurationsvariablen?

Diese können mit IronTesseract.Configuration.TesseractVariables["key"] = value; gesetzt werden. Die Konfigurationsvariablen ermöglichen eine Feinabstimmung des OCR-Verhaltens für optimale Ergebnisse bei Ihren spezifischen Dokumenten. Eine ausführliche Anleitung zur Optimierung der OCR-Leistung finden Sie in unserem fast OCR configuration guide.

Tesseract-Konfigurationsvariable Default Bedeutung
Anzahl der CP-Ebenen klassifizieren3Anzahl der Klassenbeschneidungsebenen
textord_debug_tabfind0Suche auf der Registerkarte "Debuggen"
textord_debug_bugs0Aktivieren Sie die Ausgabe von Fehlern in der Tab-Suche.
textord_testregion_left-1Linke Kante des Rechtecks für Debug-Berichte
textord_testregion_top-1Oberkante des Rechtecks für Debug-Berichte
textord_testregion_right2147483647Rechter Rand des Debug-Rechtecks
textord_testregion_bottom2147483647Unterkante des Debug-Rechtecks
textord_tabfind_show_partitions0Partitionsgrenzen anzeigen, warten, falls >1
Devanagari-Split-Debug-Level0Debug-Level für den geteilten Shiro-Rekha-Prozess.
edges_max_children_per_outline10Maximale Anzahl von Kindern innerhalb einer Zeichenkontur
edges_max_children_layers5Maximale Anzahl verschachtelter Kindebenen innerhalb einer Charakterkontur
edges_children_per_grandchild10Wichtigkeitsverhältnis für Umrisse
edges_children_count_limit45Maximale Anzahl an Löchern im Blob
edges_min_nonhole12Minimale Pixelanzahl für potenzielle Charaktere im Feld
Kantenpfadflächenverhältnis40Max lensq/area for acceptable child outline
textord_fp_chop_error2Maximal zulässige Biegung von Chop-Zellen
textord_tabfind_show_images0Show image blobs
textord_skewsmooth_offset4Für den Glättungsfaktor
textord_skewsmooth_offset21Für den Glättungsfaktor
textord_test_x-2147483647Koordinator des Testpunktes
textord_test_y-2147483647Koordinator des Testpunktes
textword_min_blobs_in_row4Minimale Anzahl an Blobs vor der Gradientenzählung
textord_spline_minblobs8Min blobs in each spline segment
textord_spline_medianwin6Size of window for spline segmentation
textord_max_blob_overlaps4Max number of blobs a big blob can overlap
textord_min_xheight10Min credible pixel xheight
textord_lms_line_trials12Number of linew fits to do
oldbl_holed_losscount10Max lost before fallback line used
pitsync_linear_version6Use new fast algorithm
pitsync_fake_depth1Max advance fake generation
textord_tabfind_show_strokewidths0Show stroke widths
textord_dotmatrix_gap3Max pixel gap for broken pixed pitch
textord_debug_block0Block to do debug on
textord_pitch_range2Max range test on pitch
textord_words_veto_power5Rows required to outvote a veto
equationdetect_save_bi_image0Save input bi image
equationdetect_save_spt_image0Save special character image
equationdetect_save_seed_image0Save the seed image
equationdetect_save_merged_image0Save the merged image
poly_debug0Debug old poly
poly_wide_objects_better1More accurate approx on wide things
wordrec_display_splits0Display splits
textord_debug_printable0Make debug windows printable
textord_space_size_is_variable0If true, word delimiter spaces are assumed to have variable width, even though characters have fixed pitch.
textord_tabfind_show_initial_partitions0Show partition bounds
textord_tabfind_show_reject_blobs0Show blobs rejected as noise
textord_tabfind_show_columns0Show column bounds
textord_tabfind_show_blocks0Show final block bounds
textord_tabfind_find_tables1run table detection
Devanagari-Split-Debugimage0Whether to create a debug image for split shiro-rekha process.
textord_show_fixed_cuts0Draw fixed pitch cell boundaries
kanten_benutzen_neue_außenlinie_komplexität0Use the new outline complexity module
edges_debug0turn on debugging for this module
kanten_Kinder_fix0Remove boxy parents of char-like children
gapmap_debug0Say which blocks have tables
gapmap_nutzen_enden0Use large space at start and end of rows
gapmap_kein_isoliertes_quanta0Ensure gaps not less than 2quanta wide
textord_heavy_nr0Vigorously remove noise
textord_show_initial_rows0Display row accumulation
textord_show_parallel_rows0Display page correlated rows
textord_show_expanded_rows0Display rows after expanding
textord_show_final_rows0Display rows after final fitting
textord_show_final_blobs0Display blob bounds after pre-ass
textord_test_landscape0Tests refer to land/port
textord_parallel_baselines1Force parallel baselines
textord_straight_baselines0Force straight baselines
textord_alt_baselines1Use old baseline algorithm
textord_old_xheight0Use old xheight algorithm
textord_fix_xheight_bug1Use spline baseline
textord_fix_makerow_bug1Prevent multiple baselines
textord_debug_xheights0Test xheight algorithms
textord_biased_skewcalc1Bias skew estimates with line length
textord_interpolating_skew1Interpolate across gaps
textord_new_initial_xheight1Use test xheight mechanism
textord_debug_blob0Print test blob information
textord_really_old_xheight0Use original wiseowl xheight
textord_oldbl_debug0Debug old baseline generation
textord_debug_baselines0Debug baseline generation
textord_oldbl_paradef1Use para default mechanism
textord_oldbl_split_splines1Split stepped splines
textord_oldbl_merge_parts1Merge suspect partitions
oldbl_corrfix1Improve correlation of heights
oldbl_xhfix0Fix bug in modes threshold for xheights
textord_ocropus_mode0Make baselines for ocropus
textord_tabfind_only_strokewidths0Only run stroke widths
textord_tabfind_show_initialtabs0Show tab candidates
textord_tabfind_show_finaltabs0Show tab vectors
textord_show_tables0Show table regions
textord_tablefind_show_mark0Debug table marking steps in detail
textord_tablefind_show_stats0Show page stats used in table finding
textord_tablefind_recognize_tables0Enables the table recognizer for table layout and filtering.
textord_all_prop0All doc is proportial text
textord_debug_pitch_test0Debug on fixed pitch test
textord_disable_pitch_test0Turn off dp fixed pitch algorithm
textord_fast_pitch_test0Do even faster pitch algorithm
textord_debug_pitch_metric0Write full metric stuff
textord_show_row_cuts0Draw row-level cuts
textord_show_page_cuts0Draw page-level cuts
textord_pitch_cheat0Use correct answer for fixed/prop
textord_blockndoc_fixed0Attempt whole doc/block fixed pitch
textord_show_initial_words0Display separate words
textord_show_new_words0Display separate words
textord_show_fixed_words0Display forced fixed pitch words
textord_blocksall_fixed0Moan about prop blocks
textord_blocksall_prop0Moan about fixed pitch blocks
textord_blocksall_testing0Dump stats when moaning
textord_test_mode0Do current test
textord_pitch_rowsimilarity0.08Fraction of xheight for sameness
Wörter_Anfangsbuchstaben_kleingeschrieben0.5Max initial cluster size
Wörter_Anfangsbuchstaben_groß0.15Min initial cluster spacing
words_default_prop_nonspace0.25Fraction of xheight
words_default_fixed_space0.75Fraction of xheight
words_default_fixed_limit0.6Allowed size variance
textord_words_definite_spread0.3Non-fuzzy spacing region
textord_spacesize_ratiofp2.8Min ratio space/nonspace
textord_spacesize_ratioprop2Min ratio space/nonspace
textord_fpiqr_ratio1.5Pitch IQR/Gap IQR threshold
textord_max_pitch_iqr0.2Xh fraction noise in pitch
textord_fp_min_width0.5Min width of decent blobs
textord_unterline_offset0.1Fraction of x to ignore
ambigs_debug_level0Debug level for unichar ambiguities
Debug-Level klassifizieren0Classify debug level
classify_norm_method1Normalization Method ...
matcher_debug_level0Matcher Debug Level
matcher_debug_flags0Matcher Debug Flags
Lern-Debug-Level klassifizieren0Learning Debug Level:
matcher_permanent_classes_min1Min # of permanent classes
matcher_min_examples_for_prototyping3Reliable Config Threshold
matcher_sufficient_examples_ for_prototyping5Enable adaption even if the ambiguities have not been seen
classify_adapt_proto_threshold230Threshold for good protos during adaptive 0-255
classify_adapt_feature_threshold230Threshold for good features during adaptive 0-255
Schwellenwert für den Klassenbereinigungsmechanismus229Class Pruner Threshold 0-255
Multiplikator für Klassenbeschneidung15Class Pruner Multiplier 0-255:
classify_cp_cutoff_strength7Class Pruner CutoffStrength:
classify_integer_matcher_multiplier10Integer Matcher Multiplier 0-255:
dawg_debug_level0Set to 1 for general debug info, to 2 for more details, to 3 to see all the debug messages
hyphen_debug_level0Debug level for hyphenated words.
stopper_smallword_size2Size of dict word to be treated as non-dict word
stopper_debug_level0Stopper debug level
tessedit_truncate_wordchoice_log10Max words to keep in list
max_permuter_attempts10000Maximum 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.
repair_unchopped_blobs1Fix blobs that aren't chopped
chop_debug0Chop debug
chop_split_length10000Split Length
chop_same_distance2Same distance
chop_min_outline_points6Min Number of Points on Outline
Schnittnaht-Pilzgröße150Max number of seams in seam_pile
Innenwinkel-50Min Inside Angle Bend
chop_min_outline_area2000Min Outline Area
chop_centered_maxwidth90Width of (smaller) chopped blobs above which we don't care that a chop is not near the center.
chop_x_y_weight3X / Y length weight
wordrec_debug_level0Debug level for wordrec
wordrec_max_join_chunks4Max number of broken pieces to associate
segsearch_debug_level0SegSearch debug level
segsearch_max_pain_points2000Maximum number of pain points stored in the queue
segsearch_max_futile_classifications20Maximum number of pain point classifications per chunk that did not result in finding a better word choice.
sprache_modell_debug_level0Language model debug level
sprache_modell_ngramm_ordnung8Maximum order of the character ngram model
language_model_viterbi_list_ max_num_prunable10Maximum number of prunable (those for which PrunablePath() is true) entries in each viterbi list recorded in BLOB_CHOICEs
sprache_modell_viterbi_liste_max_grösse500Maximum size of viterbi lists recorded in BLOB_CHOICEs
minimale Verbindungslänge des Sprachmodells3Minimum length of compound words
wordrec_display_segmentations0Display Segmentations
tessedit_pageseg_mode6Page 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)
tessedit_ocr_engine_mode2Which OCR engine(s) to run (Tesseract, LSTM, both). Defaults to loading and running the most accurate available.
seiteneg_devanagari_split_strategy0Whether to use the top-line splitting process for Devanagari documents while performing page-segmentation.
ocr_devanagari_split_strategy0Whether to use the top-line splitting process for Devanagari documents while performing ocr.
bidi_debug0Debug level for BiDi
applybox_debug1Debug level
applybox_page0Page number to apply boxes from
tessedit_bigram_debug0Amount of debug output for bigram correction.
Debug-Rauschentfernung0Debug reassignment of small outlines
noise_maxperblob8Max diacritics to apply to a blob
noise_maxperword16Max diacritics to apply to a word
debug_x_ht_level0Reestimate debug
qualität_min_initial_alphas_reqd2alphas in a good word
tessedit_tess_adaption_mode39Adaptation decision algorithm for tess
multilang_debug_level0Print multilang debug info.
absatz_debug_level0Print paragraph debug info.
tessedit_preserve_min_wd_len2Only preserve wds longer than this
crunch_rating_max10For adj length in rating per ch
crunch_pot_indikatoren1How many potential indicators needed
crunch_leave_lc_strings4Don't crunch words with long lower case strings
crunch_leave_uc_strings4Don't crunch words with long lower case strings
lange Wiederholungen3Crunch words with long repetitions
crunch_debug0As it says
fixsp_geraeuschfrei_limit1How many non-noise blbs either side?
fixsp_done_mode1What constitues done for spacing
debug_fix_space_level0Contextual fixspace debug
x_ht_akzeptanz_toleranz8Max allowed deviation of blob top outside of font data
x_ht_min_change8Min change in xht before actually trying it
superscript_debug0Debug level for sub & superscript fixer
jpg-Qualität85Set JPEG quality level
benutzerdefinierte DPI0Specify DPI for input image
min_characters_to_try50Specify minimum characters to try during OSD
suspect_level99Suspect marker level
suspect_short_words2Don't suspect dict wds longer than this
tessedit_reject_mode0Rejection algorithm
tessedit_image_border2Rej blbs near image edge limit
min_sane_x_ht_pixels8Reject any x-ht lt or eq than this
tessedit_page_number-1-1 -> All pages, else specific page to process
tessedit_parallelisieren1Run in parallel where possible
lstm_choice_mode2Allows 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.
lstm_choice_iterations5Sets the number of cascading iterations for the Beamsearch in lstm_choice_mode. Note that lstm_choice_mode must be set to a value greater than 0 to produce results.
tosp_debug_level0Debug data
tosp_genug_space_samples_für_median3or should we use mean
tosp_redo_kern_limit10No.samples reqd to reestimate for row
tosp_few_samples40No.gaps reqd with 1 large gap to treat as a table
tosp_short_row20No.gaps reqd with few cert spaces to use certs
tosp_sanity_method1How to avoid being silly
textord_max_noise_size7Pixel size of noise
textord_baseline_debug0Baseline debug level
textord_noise_sizefraction10Fraction of size for maxima
textord_noise_translimit16Transitions for normal blob
textord_noise_sncount1super norm blobs to save row
Verwendung von Ambiguitäten zur Anpassung0Use ambigs for deciding whether to adapt to a character
priorisieren_Abteilung0Prioritize blob division over chopping
Klassifizierung aktivieren Lernen1Enable adaptive classifier
tess_cn_matching0Character Normalized Matching
tess_bn_matching0Baseline Normalized Matching
klassifizieren_adaptiven_Abgleich aktivieren1Enable adaptive classifier
classify_use_pre_adapted_templates0Use pre-adapted classifier templates
klassifizieren_speichern_angepasste_Vorlagen0Save adapted templates to a file
klassifizieren_adaptiven_Debugger aktivieren0Enable match debugger
nichtlineare Norm klassifizieren0Non-linear stroke-density normalization
disable_character_fragments1Do not include character fragments in the results of the classifier
klassifizieren_debug_character_fragments0Bring up graphical debugging windows for fragments training
matcher_debug_separate_windows0Use two different windows for debugging the matching: One for the protos and one for the features.
classify_bln_numeric_mode0Assume the input is numbers [0-9].
load_system_dawg1Load system word dawg.
load_freq_dawg1Load frequent word dawg.
load_unambig_dawg1Load unambiguous word dawg.
load_punc_dawg1Load dawg with punctuation patterns.
load_number_dawg1Load dawg with number patterns.
load_bigram_dawg1Load dawg with special word bigrams.
benutze_nur_erste_uft8_schritt0Use only the first UTF8 step of the given string when computing log probabilities.
stopper_no_acceptable_choices0Make AcceptableChoice() always return false. Useful when there is a need to explore all segmentations
segment_nonalphabetisch_script0Don't use any alphabetic-specific tricks. Set to true in the traineddata config file for scripts that are cursive or inherently fixed-pitch
save_doc_words0Save Document Words
fragmente_in_Matrix_zusammenführen1Merge the fragments in the ratings matrix and delete them after merging
wordrec_enable_assoc1Associator Enable
erzwingt_Wortassoziation0force associator to run regardless of what enable_assoc is. This is used for CJK where component grouping is necessary.
chop_enable1Chop enable
chop_vertical_creep0Vertical creep
chop_new_seam_pile1Use new seam_pile
assume_fixed_pitch_char_segment0include fixed-pitch heuristics in char segmentation
wordrec_skip_no_truth_words0Only run OCR for words that had truth recorded in BlamerBundle
wordrec_debug_blamer0Print blamer debug messages
wordrec_run_blamer0Try to set the blame for errors
save_alt_choices1Save alternative paths found during chopping and segmentation search
language_model_ngram_on0Turn on/off the use of character ngram model
language_model_ngram_use_ only_first_uft8_step0Use only the first UTF8 step of the given string when computing log probabilities.
language_model_ngram_space_ delimited_language1Words are delimited by space
sprachmodell_nutze_sigmoide_gewissheit0Use sigmoidal score for certainty
tessedit_resegment_aus_boxen0Take segmentation and labeling from box file
tessedit_resegment_aus_line_boxes0Conversion of word/line box file to char box file
tessedit_train_from_boxes0Generate training data from boxed chars
tessedit_boxen_aus_boxen_herstellen0Generate more boxes from boxed chars
tessedit_train_line_recognizer0Break input into lines and remap boxes if present
tessedit_dump_pageseg_images0Dump intermediate images made during page segmentation
tessedit_do_invert1Try inverting the image in LSTMRecognizeWord
tessedit_ambigs_schulung0Perform training for ambiguities
tessedit_adaption_debug0Generate and print debug information for adaption
applybox_learn_chars_and_char_frags_mode0Learn both character fragments (as is done in the special low exposure mode) as well as unfragmented characters.
applybox_learn_ngrams_mode0Each bounding box is assumed to contain ngrams. Only learn the ngrams whose outlines overlap horizontally.
tessedit_anzeigen_auswuerfe0Draw output words
tessedit_dump_choices0Dump char choices
tessedit_timing_debug0Print timing stats
tessedit_fix_fuzzy_spaces1Try to improve fuzzy spaces
tessedit_unrej_any_wd0Don't bother with word plausibility
tessedit_fix_hyphens1Crunch double hyphens?
tessedit_aktivieren_doc_dict1Add words to the document dictionary
tessedit_debug_fonts0Output font info per char
tessedit_debug_block_rejection0Block and Row stats
tessedit_enable_bigram_correction1Enable correction based on the word bigram dictionary.
tessedit_enable_dict_correction0Enable single word correction based on the dictionary.
Rauschunterdrückung aktivieren1Remove and conditionally reassign small outlines when they confuse layout analysis, determining diacritics vs noise
tessedit_minimal_rej_pass10Do minimal rejection on pass 1 output
tessedit_test_adaptation0Test adaption criteria
test_pt0Test for point
absatztextbasiert1Run paragraph detection on the post-text-recognition (more accurate)
lstm_gebrauch_matrix1Use ratings matrix/beam search with lstm
tessedit_gute_Qualität_unrej1Reduce rejection on good docs
tessedit_verwendet_abgewiesene_Räume1Reject spaces?
tessedit_preserve_blk_rej_perfect_wds1Only rej partially rejected words in block rejection
tessedit_preserve_row_rej_perfect_wds1Only rej partially rejected words in row rejection
tessedit_dont_blkrej_good_wds0Use word segmentation quality metric
tessedit_dont_rowrej_good_wds0Use word segmentation quality metric
tessedit_row_rej_good_docs1Apply row rejection to good docs
tessedit_reject_bad_qual_wds1Reject all bad quality wds
tessedit_debug_doc_rejection0Page stats
tessedit_debug_quality_metrics0Output data to debug file
bland_unrej0unrej potential with no checks
unlv_tilde_crunching0Mark v.bad words for tilde crunch
hocr_font_info0Add font info to hocr output
hocr_char_boxes0Add coordinates for each character to hocr output
crunch_early_merge_tess_fails1Before word crunch?
crunch_early_convert_bad_unlv_chs0Take out ~^ early?
crunch_terrible_garbage1As it says
crunch_leave_ok_strings1Don't touch sensible strings
crunch_accept_ok1Use acceptability in okstring
crunch_leave_accept_strings0Don't pot crunch sensible strings
crunch_include_numerals0Fiddle alpha figures
tessedit_prefer_joined_punct0Reward punctuation joins
tessedit_write_block_separators0Write block separators in output
tessedit_write_rep_codes0Write repetition char code
tessedit_write_unlv0Write .unlv output file
tessedit_create_txt0Write .txt output file
tessedit_create_hocr0Write .html hOCR output file
tessedit_create_alto0Write .xml ALTO file
tessedit_create_lstmbox0Write .box file for LSTM training
tessedit_create_tsv0Write .tsv output file
tessedit_create_wordstrbox0Write WordStr format .box output file
tessedit_create_pdf0Write .pdf output file
textonly_pdf0Create PDF with only one invisible text layer
suspect_constrain_1Il0UNLV keep 1Il chars rejected
tessedit_minimal_rejection0Only reject tess failures
tessedit_zero_rejection0Don't reject ANYTHING
tessedit_word_for_word0Make output have exactly one word per WERD
tessedit_zero_kelvin_rejection0Don't reject ANYTHING AT ALL
tessedit_rejection_debug0Adaption debug
tessedit_flip_0O1Contextual 0O O0 flips
rej_trust_doc_dawg0Use DOC dawg in 11l conf. detector
rej_1Il_verwendung_dict_word0Use dictword test
rej_1Il_trust_permuter_type1Don't double check
rej_use_tess_accepted1Individual rejection control
rej_use_tess_blanks1Individual rejection control
rej_use_good_perm1Individual rejection control
rej_benutzen_sensibel_wd0Extend permuter check
rej_alphas_in_number_perm0Extend permuter check
tessedit_create_boxfile0Output text with boxes
tessedit_write_images0Capture the image from the IPE
interaktiver Anzeigemodus0Run interactively?
tessedit_überschreibender_permuter1According to dict_word
tessedit_verwendet_primäre_Parameter_Modell0In multilingual mode use params model of the primary language
textord_tabfind_show_vlines0Debug line finding
textord_verwendung_cjk_fp_model0Use CJK fixed pitch model
poly_allow_detailed_fx0Allow feature extractors to see the original outline
tessedit_init_config_only0Only initialize with the config file. Useful if the instance is not going to be used for OCR but say only for layout analysis.
textord_equation_detect0Turn on equation detector
textord_tabfind_vertical_text1Enable vertical detection
textord_tabfind_force_vertical_text0Force using vertical text page mode
Zwischenwortabstände beibehalten0Preserve multiple interword spaces
pageseg_apply_music_mask1Detect music staff and remove intersecting components
textord_single_height_mode0Script has no xheight, so use a single mode
tosp_old_to_method0Space stats use prechopping?
tosp_old_to_constrain_sp_kn0Constrain relative values of inter and intra-word gaps for old_to_method.
tosp_only_use_prop_rows1Block stats to use fixed pitch rows?
tosp_force_wordbreak_on_punct0Force word breaks on punct to break long lines in non-space delimited langs
tosp_nutzen_vor_hacken0Space stats use prechopping?
tosp_alt_zu_bug_fix0Fix suspected bug in old code
tosp_block_use_cert_spaces1Only stat OBVIOUS spaces
tosp_row_use_cert_spaces1Only stat OBVIOUS spaces
tosp_narrow_blobs_not_cert1Only stat OBVIOUS spaces
tosp_row_use_cert_spaces11Only stat OBVIOUS spaces
tosp_wiederherstellung_isolierte_reihen_statistiken1Use row alone when inadequate cert spaces
tosp_nur_kleine_lücken_für_kern0Better guess
tosp_alle_flips_fuzzy0Pass ANY flip to context?
tosp_fuzzy_limit_all1Don't restrict kn->sp fuzzy limit to tables
textord_no_rejects0Don't remove noise blobs
textord_show_blobs0Display unsorted blobs
textord_show_boxes0Display unsorted blobs
textord_noise_rejwords1Reject noise-like words
textord_noise_rejrows1Reject noise-like rows
textord_noise_debug0Debug row garbage detector
classify_learn_debug_strClass str to debug learning
BenutzerwortdateiA filename of user-provided words.
BenutzerwortsuffixA suffix of user-provided words located in tessdata.
BenutzermusterdateiA filename of user-provided patterns.
BenutzermustersuffixA suffix of user-provided patterns located in tessdata.
Ausgabedatei für MehrdeutigkeitenOutput file for ambiguities found in the dictionary
Wort zum DebuggenWord for which stopper debug information should be printed to stdout
tessedit_char_blacklistBlacklist of chars not to recognize
tessedit_char_whitelistWhitelist of chars to recognize
tessedit_char_unblacklistList of chars to override tessedit_char_blacklist
tessedit_write_params_to_fileWrite all parameters to the given file.
applybox_exposure_pattern.expExposure 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('`"Leitsatz
chs_trailing_punct1).,;:?!1st Trailing punctuation
chs_trailing_punct2)'`"2nd Trailing punctuation
Umrisse_ungerade%|Nicht standardmäßige Anzahl von Umrissen
outlines_2ij!?%":;Nicht standardmäßige Anzahl von Umrissen
numerische_Zeichensetzung.,Punct. chs expected WITHIN numbers
unerkanntes_zeichen|Output char for unidentified blobs
ok_repeated_ch_non_alphanum_wds-?*=Allow NN to unrej
Konfliktgruppe_I_l_1Il1 []Il1 conflict set
Dateityp.tifFilename extension
tessedit_load_sublangsList of languages to load with this one
SeitentrennzeichenPage separator (default is form feed control character)
Zeichennormbereich klassifizieren0.2Character Normalization Range ...
klassifizieren_maximales_Bewertungsverhältnis1.5Veto ratio between classifier ratings
classify_max_certainty_margin5.5Veto difference between classifier certainties
matcher_good_threshold0.125Good Match (0-1)
matcher_zuverlässiges_adaptives_ergebnis0Great Match (0-1)
matcher_perfect_threshold0.02Perfect Match (0-1)
matcher_bad_match_pad0.15Bad Match Pad (0-1)
Matcher-Bewertungsmarge0.1New template margin (0-1)
matcher_avg_noise_size12Avg. noise blob length
matcher_clustering_max_angle_delta0.015Maximum angle delta for prototype clustering
Strafe für unpassende Schrottteile0Penalty to apply when a non-alnum is vertically out of its expected textline position
Bewertungsskala1.5Rating scaling factor
Gewissheitsskala20Certainty scaling factor
tessedit_class_miss_scale0.00390625Scale factor for features not used
klassifizieren_angepasster_Pruning-Faktor2.5Prune poor adapted results this much worse than best result
klassifizieren_angepasster_Beschneidungsschwellenwert-1Threshold at which klassifizieren_angepasster_Pruning-Faktor starts
classify_character_fragments_ garbage_certainty_threshold-3Exclude fragments that do not look like whole characters from training and adaption
speckle_large_max_size0.3Max large speckle size
Speckle-Bewertungsstrafe10Penalty to add to worst rating for noise
xheight_penalty_subscripts0.125Score penalty (0.1 = 10%) added if there are subscripts or superscripts in a word, but it is otherwise OK.
xheight_penalty_inconsistent0.25Score penalty (0.1 = 10%) added if an xheight is inconsistent.
segment_penalty_dict_frequent_word1Score multiplier for word matches which have good case and are frequent in the given language (lower is better).
segment_penalty_dict_case_ok1.1Score multiplier for word matches that have good case (lower is better).
segment_penalty_dict_case_bad1.3125Default score multiplier for word matches, which may have case issues (lower is better).
segment_penalty_dict_nonword1.25Score multiplier for glyph fragment segmentations which do not match a dictionary word (lower is better).
Gewissheitsskala20Certainty scaling factor
stopper_nondict_certainty_base-2.5Certainty threshold for non-dict words
stopper_phase2_certainty_rejection_offset1Reject certainty offset
stopper_certainty_per_char-0.5Certainty to add for each dict char above small word size.
stopper_allowable_character_badness3Max certaintly variation allowed in a word (in sigma)
doc_dict_pending_threshold0Worst certainty for using pending dictionary
doc_dict_certainty_threshold-2.25Worst certainty for words that can be inserted into the document dictionary
tessedit_gewissheit_schwelle-2.25Good blob limit
chop_split_dist_knob0.5Split length adjustment
chop_overlap_knob0.9Split overlap adjustment
chop_center_knob0.15Split center adjustment
chop_sharpness_knob0.06Split sharpness adjustment
chop_width_change_knob5Width change adjustment
chop_ok_split100OK split limit
chop_good_split50Good split limit
segsearch_max_char_wh_ratio2Maximales Zeichenbreiten-Höhen-Verhältnis

Um optimale Ergebnisse zu erzielen, wird empfohlen, vor der Anwendung von OCR die Bildvorverarbeitungsfilter von IronOCR zu verwenden. Diese Filter können die Genauigkeit erheblich verbessern, insbesondere bei der Arbeit mit Scans niedriger Qualität oder komplexen Dokumenten wie Tabellen.

Häufig gestellte Fragen

Wie konfiguriere ich IronTesseract für OCR in C#?

Um IronTesseract zu konfigurieren, erstellen Sie eine IronTesseract-Instanz und legen Eigenschaften wie Sprache und Konfiguration fest. Sie können die OCR-Sprache (aus 125 unterstützten Sprachen) angeben, das Lesen von Barcodes aktivieren, die durchsuchbare PDF-Ausgabe konfigurieren und eine Whitelist für Zeichen festlegen. Zum Beispiel: var tesseract = new IronOcr.IronTesseract { Language = IronOcr.OcrLanguage.English, Configuration = new IronOcr.TesseractConfiguration { ReadBarCodes = false, RenderSearchablePdf = true } };

Welche Eingabeformate werden von IronTesseract unterstützt?

IronTesseract akzeptiert verschiedene Eingabeformate über die Klasse OcrInput. Sie können Bilder (PNG, JPG, etc.), PDF-Dateien und gescannte Dokumente verarbeiten. Die Klasse OcrInput bietet flexible Methoden zum Laden dieser verschiedenen Formate, so dass die OCR für praktisch jedes Dokument, das Text enthält, problemlos durchgeführt werden kann.

Kann ich mit IronTesseract BarCodes zusammen mit Text lesen?

Ja, IronTesseract verfügt über erweiterte Funktionen zum Lesen von Barcodes. Sie können die Barcode-Erkennung aktivieren, indem Sie ReadBarCodes = true in der TesseractConfiguration einstellen. Damit können Sie in einem einzigen OCR-Vorgang sowohl Text- als auch Barcodedaten aus demselben Dokument extrahieren.

Wie erstelle ich durchsuchbare PDFs aus gescannten Dokumenten?

IronTesseract kann gescannte Dokumente und Bilder in durchsuchbare PDFs umwandeln, indem in der TesseractConfiguration RenderSearchablePdf = true gesetzt wird. Dadurch werden PDF-Dateien erzeugt, in denen der Text auswählbar und durchsuchbar ist, während das Aussehen des Originaldokuments erhalten bleibt.

Welche Sprachen werden von IronTesseract für OCR unterstützt?

IronTesseract unterstützt 125 internationale Sprachen für die Texterkennung. Sie können die Sprache festlegen, indem Sie die Spracheigenschaft Ihrer IronTesseract-Instanz einstellen, z. B. IronOcr.OcrLanguage.English, Spanisch, Chinesisch, Arabisch und viele andere.

Kann ich einschränken, welche Zeichen bei der OCR erkannt werden?

Ja, IronTesseract erlaubt das Whitelisting und Blacklisting von Zeichen über die Eigenschaft WhiteListCharacters in TesseractConfiguration. Diese Funktion trägt zur Verbesserung der Genauigkeit bei, wenn Sie den erwarteten Zeichensatz kennen, z. B. wenn Sie die Erkennung auf alphanumerische Zeichen beschränken.

Wie führe ich OCR für mehrere Dokumente gleichzeitig durch?

IronTesseract unterstützt Multithreading-Funktionen für die Stapelverarbeitung. Sie können die parallele Verarbeitung nutzen, um mehrere Dokumente gleichzeitig zu OCR zu verarbeiten, was die Leistung bei der Verarbeitung großer Mengen von Bildern oder PDFs erheblich verbessert.

Welche Version von Tesseract wird von IronOCR verwendet?

IronOCR verwendet eine angepasste und optimierte Version von Tesseract 5, bekannt als Iron Tesseract. Diese optimierte Engine bietet im Vergleich zu Standard-Tesseract-Implementierungen eine verbesserte Genauigkeit und Leistung, wobei die Kompatibilität mit .NET-Anwendungen erhalten bleibt.

Wie kann IronOCR die Datenqualität verbessern?

IronOCR verbessert die Datenqualität durch seine fortschrittlichen Erkennungsalgorithmen und Bildkorrekturfunktionen, die sicherstellen, dass der Textextraktionsprozess sowohl zuverlässig als auch genau ist.

Gibt es eine kostenlose Testversion von IronOCR?

Ja, Iron Software bietet eine kostenlose Testversion von IronOCR an, die es den Benutzern ermöglicht, die Funktionen und Fähigkeiten zu testen, bevor sie eine Kaufentscheidung treffen.

Curtis Chau
Technischer Autor

Curtis Chau hat einen Bachelor-Abschluss in Informatik von der Carleton University und ist spezialisiert auf Frontend-Entwicklung mit Expertise in Node.js, TypeScript, JavaScript und React. Leidenschaftlich widmet er sich der Erstellung intuitiver und ästhetisch ansprechender Benutzerschnittstellen und arbeitet gerne mit modernen Frameworks sowie der Erstellung gut strukturierter, optisch ansprechender ...

Weiterlesen
Rezensiert von
Jeff Fritz
Jeffrey T. Fritz
Principal Program Manager - .NET Community Team
Jeff ist außerdem Principal Program Manager für das .NET- und Visual Studio-Team. Er ist der ausführende Produzent der .NET Conf Virtual Conference Series und moderiert ‚Fritz and Friends‘, einen Livestream für Entwickler, der zweimal wöchentlich ausgestrahlt wird. Dort spricht er über Technik und schreibt gemeinsam mit den Zuschauern Code. Jeff schreibt Workshops, Präsentationen und plant Inhalte für die größten Microsoft-Entwicklerveranstaltungen, einschließlich Microsoft Build, Microsoft Ignite, .NET Conf und dem Microsoft MVP Summit.
Bereit anzufangen?
Nuget Downloads 6,175,195 | Version: 2026.7 gerade veröffentlicht
Still Scrolling Icon

Scrollst du immer noch?

Sie brauchen schnell einen Beweis? PM > Install-Package IronOcr
Führen Sie ein Beispiel aus und beobachten Sie, wie Ihr Bild zu durchsuchbarem Text wird.