如何在C#中使用Iron Tesseract
在 C# 中使用 Iron Tesseract 的方法是創建一個 IronTesseract 實例,並根據語言和 OCR 設置進行配置,然後調用包含您圖像或 PDF 的 OcrInput 物件上的 Read() 方法。 這會使用 Tesseract 5 的優化引擎將文本圖像轉換為可搜尋的 PDF。
IronOCR 提供了一個直覺的 API,用於使用自訂和優化的 Tesseract 5,即 Iron Tesseract。 通過使用 IronOCR 和 IronTesseract,您將能夠將文本圖像和掃描文件轉換為文本和可搜尋的 PDF。 該程式庫支援125 種國際語言,並包含條碼讀取和電腦視覺等先進功能。
此範例演示了如何使用特定設置配置 IronTesseract 並在一行代碼中執行 OCR。
-
1使用 IronOCR 安裝 NuGet Package Manager
-
2複製並運行這段程式碼。
var result = new IronOcr.IronTesseract { Language = IronOcr.OcrLanguage.English, Configuration = new IronOcr.TesseractConfiguration { ReadBarCodes = false, RenderSearchablePdf = true, WhiteListCharacters = "ABCabc123" } }.Read("image.png");Dim result = New IronOcr.IronTesseract With { .Language = IronOcr.OcrLanguage.English, .Configuration = New IronOcr.TesseractConfiguration With { .ReadBarCodes = False, .RenderSearchablePdf = True, .WhiteListCharacters = "ABCabc123" } }.Read("image.png")Dim result = New IronOcr.IronTesseract With { .Language = IronOcr.OcrLanguage.English, .Configuration = New IronOcr.TesseractConfiguration With { .ReadBarCodes = False, .RenderSearchablePdf = True, .WhiteListCharacters = "ABCabc123" } }.Read("image.png") -
3部署到您的生產環境進行測試
立即在您的項目中開始使用 IronOCR,並使用 免費試用
基本 OCR 工作流程
- 使用 NuGet 安裝 OCR 程式庫以讀取圖像
- 利用自訂
Tesseract 5執行 OCR - 加載所需的文件,如圖像或PDF文件進行處理
- 將提取的文字輸出到控制台或文件
- 將結果保存為可搜尋的PDF
我如何創建 IronTesseract 實例?
使用此代碼初始化 Tesseract 物件:
using IronOcr;
IronTesseract ocr = new IronTesseract();using IronOcr;
IronTesseract ocr = new IronTesseract();Imports IronOcr
Dim ocr As New IronTesseract()Imports IronOcr
Dim ocr As New IronTesseract()您可以通過選擇不同的語言、啟用條碼讀取以及白名單/黑名單字符來自定義 IronTesseract 的行為。 IronOCR 提供了全面的配置選項以微調您的 OCR 流程:
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
};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
}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
}配置完成後,您可以使用 Tesseract 功能來讀取 OcrInput 物件。 OcrInput 類提供了靈活的方法來加載各種輸入格式:
IronTesseract ocr = new IronTesseract();
using OcrInput input = new OcrInput();
input.LoadImage("attachment.png");
OcrResult result = ocr.Read(input);
string text = result.Text;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 UsingDim 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對於複雜場景,您可以利用多執行緒功能來同時處理多個文件,大大提高批處理操作的性能。 IronTesseract 還公開了兩個限制並行運行工作的屬性:MaxDegreeOfParallelism 限制在單個 Read 調用中同時進行 OCR 的頁數,而 MultiThreaded 則完全關閉並行讀取,以實現最低且最可預測的內存佔用。 這兩者都包含在異步和多執行緒指南中。
什麼是高級 Tesseract 配置變數?
IronOcr Tesseract 介面允許通過IronOcr.TesseractConfiguration 類完全控制 Tesseract 配置變數。 這些高級設置使您能針對特定的使用案例優化 OCR 性能,例如修復低質量掃描或讀取特定文件類型。
如何在代碼中使用 Tesseract 配置?
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);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)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 還提供了不同文件類型的專業化配置。例如,在掃描護照或處理 MICR 支票時,您可以應用特定的預處理過濾器和區域檢測來提高準確性。
財務文件的配置範例:
// 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);// 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 UsingImports 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完整的 Tesseract 配置變數列表是什麼?
這些可以通過 IronTesseract.Configuration.TesseractVariables["key"] = value; 來設置。 配置變數可讓您針對特定文件微調 OCR 行為,以獲得最佳效果。 有關優化 OCR 性能的詳細指導,請參考我們的快速 OCR 配置指南。
| Tesseract 配置變數 | Default | 意義 |
|---|---|---|
| classify_num_cp_levels | 3 | 類別剪枝器等級數 |
| textord_debug_tabfind | 0 | 調試選項卡查找 |
| textord_debug_bugs | 0 | 啟用與製表符查找錯誤相關的輸出 |
| textord_testregion_left | -1 | 調試報告矩形的左邊緣 |
| textord_testregion_top | -1 | 調試報告矩形的頂部邊緣 |
| textord_testregion_right | 2147483647 | 調試矩形的右邊緣 |
| textord_testregion_bottom | 2147483647 | 調試矩形的底部邊緣 |
| textord_tabfind_show_partitions | 0 | 顯示分區邊界,如果大於 1 則等待。 |
| devanagari_split_debuglevel | 0 | 拆分 shiro-rekha 進程的調試等級。 |
| edges_max_children_per_outline | 10 | 角色輪廓內子角色的最大數量 |
| edges_max_children_layers | 5 | 角色輪廓內嵌套子角色的最大層數 |
| edges_children_per_grandchild | 10 | 拋擲輪廓的重要性比率 |
| edges_children_count_limit | 45 | 斑點中允許的最大孔數 |
| edges_min_nonhole | 12 | 方框內潛在字元的最小像素 |
| edges_patharea_ratio | 40 | 可接受的兒童輪廓的最大鏡頭面積/面積 |
| textord_fp_chop_error | 2 | 最大允許的切割單元彎曲度 |
| textord_tabfind_show_images | 0 | 顯示影像斑點 |
| textord_skewsmooth_offset | 4 | 對於平滑因子 |
| textord_skewsmooth_offset2 | 1 | 對於平滑因子 |
| textord_test_x | -2147483647 | 測試點座標 |
| textord_test_y | -2147483647 | 測試點座標 |
| textord_min_blobs_in_row | 4 | 梯度計數前的最小斑點數 |
| textord_spline_minblobs | 8 | 每個樣條曲線段中的最小斑點 |
| textord_spline_medianwin | 6 | 樣條分割視窗的大小 |
| textord_max_blob_overlaps | 4 | 一個大斑點可以重疊的最大斑點數量 |
| textord_min_xheight | 10 | 最小可信像素 x 高度 |
| textord_lms_line_trials | 12 | 要進行的線性擬合次數 |
| oldbl_holed_losscount | 10 | 使用備用線路之前的最大損失 |
| pitsync_linear_version | 6 | 使用新的快速演算法 |
| pitsync_fake_depth | 1 | 最大程度的偽造 |
| textord_tabfind_show_strokewidths | 0 | 顯示筆畫寬度 |
| textord_dotmatrix_gap | 3 | 像素間距破損時的最大像素間隙 |
| textord_debug_block | 0 | 阻塞以進行調試 |
| textord_pitch_range | 2 | 球場上的最大射程測試 |
| textord_words_veto_power | 5 | 推翻否決所需的票數 |
| equationdetect_save_bi_image | 0 | 儲存輸入的雙影像 |
| equationdetect_save_spt_image | 0 | 保存特殊字元影像 |
| equationdetect_save_seed_image | 0 | 保存種子影像 |
| equationdetect_save_merged_image | 0 | 儲存合併後的影像 |
| poly_debug | 0 | 調試舊多邊形 |
| poly_wide_objects_better | 1 | 更精確的近似值適用於寬泛的事物 |
| wordrec_display_splits | 0 | 顯示分割 |
| textord_debug_printable | 0 | 使調試Windows可列印 |
| textord_space_size_is_variable | 0 | 如果屬實,則假定單字分隔符空格的寬度是可變的,即使字元的間距是固定的。 |
| textord_tabfind_show_initial_partitions | 0 | 顯示分區邊界 |
| textord_tabfind_show_reject_blobs | 0 | 顯示被判定為噪音的斑點 |
| textord_tabfind_show_columns | 0 | 顯示列邊界 |
| textord_tabfind_show_blocks | 0 | 顯示最終區塊邊界 |
| textord_tabfind_find_tables | 1 | 運行表檢測 |
| devanagari_split_debugimage | 0 | 是否為拆分 shiro-rekha 程序建立調試鏡像。 |
| textord_show_fixed_cuts | 0 | 繪製固定間距單元格邊界 |
| edges_use_new_outline_complexity | 0 | 使用新的大綱複雜度模組 |
| edges_debug | 0 | 啟用此模組的調試功能 |
| edges_children_fix | 0 | 移除焦炭狀子代的方形盒子狀父母 |
| gapmap_debug | 0 | 說明哪些區塊有表格 |
| gapmap_use_ends | 0 | 在行的開頭和結尾留出較大的空間 |
| gapmap_no_isolated_quanta | 0 | 確保間隙寬度不小於 2 量子 |
| textord_heavy_nr | 0 | 強力消除噪音 |
| textord_show_initial_rows | 0 | 顯示行累積 |
| textord_show_parallel_rows | 0 | 顯示頁面相關行 |
| textord_show_expanded_rows | 0 | 展開後顯示行 |
| textord_show_final_rows | 0 | 最終擬合後的顯示行 |
| textord_show_final_blobs | 0 | 預先分配後顯示斑點邊界 |
| textord_test_landscape | 0 | 測試指的是陸地/港口 |
| textord_parallel_baselines | 1 | 力平行基線 |
| textord_straight_baselines | 0 | 強迫直線底線 |
| textord_old_baselines | 1 | 使用舊的基線演算法 |
| textord_old_xheight | 0 | 使用舊的 xheight 演算法 |
| textord_fix_xheight_bug | 1 | 使用樣條基線 |
| textord_fix_makerow_bug | 1 | 防止出現多個基線 |
| textord_debug_xheights | 0 | 測試 x 高度演算法 |
| textord_biased_skewcalc | 1 | 線長度偏差估計 |
| textord_interpolating_skew | 1 | 跨越間隙進行插值 |
| textord_new_initial_xheight | 1 | 使用測試 x 高度機制 |
| textord_debug_blob | 0 | 列印測試斑點訊息 |
| textord_really_old_xheight | 0 | 使用原始的wiseowl x高度 |
| textord_oldbl_debug | 0 | 調試舊基線生成 |
| textord_debug_baselines | 0 | 調試基線生成 |
| textord_oldbl_paradef | 1 | 使用預設機制 |
| textord_oldbl_split_splines | 1 | 分裂階梯樣條 |
| textord_oldbl_merge_parts | 1 | 合併可疑分割區 |
| oldbl_corrfix | 1 | 提高身高相關性 |
| oldbl_xhfix | 0 | 修復模式閾值中 x 高度的錯誤 |
| textord_ocropus_mode | 0 | 為蛸蛸建立基線 |
| textord_tabfind_only_strokewidths | 0 | 僅運行筆畫寬度 |
| textord_tabfind_show_initialtabs | 0 | 顯示標籤候選 |
| textord_tabfind_show_finaltabs | 0 | 顯示標籤頁向量圖 |
| textord_show_tables | 0 | 顯示表格區域 |
| textord_tablefind_show_mark | 0 | 詳細調試表標記步驟 |
| textord_tablefind_show_stats | 0 | 顯示用於表格查找的頁面統計信息 |
| textord_tablefind_recognize_tables | 0 | 啟用表格識別器,用於表格佈局和篩選。 |
| textord_all_prop | 0 | 所有文件均為比例文字 |
| textord_debug_pitch_test | 0 | 固定音高測試調試 |
| textord_disable_pitch_test | 0 | 關閉 DP 固定螺距演算法 |
| textord_fast_pitch_test | 0 | 實現更快的音調演算法 |
| textord_debug_pitch_metric | 0 | 寫出完整的公制單位內容 |
| textord_show_row_cuts | 0 | 繪製行級切口 |
| textord_show_page_cuts | 0 | 繪製頁面級切口 |
| textord_pitch_cheat | 0 | 使用固定/私有財產的正確答案 |
| textord_blockndoc_fixed | 0 | 嘗試整個文檔/模組固定音高 |
| textord_show_initial_words | 0 | 顯示單獨的詞語 |
| textord_show_new_words | 0 | 顯示單獨的詞語 |
| textord_show_fixed_words | 0 | 顯示強制固定音高詞語 |
| textord_blocksall_fixed | 0 | 抱怨支撐塊 |
| textord_blocksall_prop | 0 | 抱怨固定螺距塊 |
| textord_blocksall_testing | 0 | 抱怨時丟棄統計資料 |
| textord_test_mode | 0 | 進行當前測試 |
| textord_pitch_rowsimilarity | 0.08 | 相同情況下 x 高度的分數 |
| words_initial_lower | 0.5 | 最大初始簇大小 |
| words_initial_upper | 0.15 | 最小初始簇間距 |
| words_default_prop_nonspace | 0.25 | x高度的分數 |
| words_default_fixed_space | 0.75 | x高度的分數 |
| words_default_fixed_limit | 0.6 | 允許的尺寸偏差 |
| textord_words_definite_spread | 0.3 | 非模糊間距區域 |
| textord_spacesize_ratiofp | 2.8 | 最小空間/非空間比率 |
| textord_spacesize_ratioprop | 2 | 最小空間/非空間比率 |
| textord_fpiqr_ratio | 1.5 | 音調四分位距/間隙四分位距閾值 |
| textord_max_pitch_iqr | 0.2 | Xh 分數噪聲 |
| textord_fp_min_width | 0.5 | 體面斑點的最小寬度 |
| textord_underline_offset | 0.1 | 要忽略的 x 的比例 |
| ambigs_debug_level | 0 | 單字元歧義的調試級別 |
| classify_debug_level | 0 | 對調試等級進行分類 |
| classify_norm_method | 1 | 歸一化方法… |
| matcher_debug_level | 0 | 匹配器調試級別 |
| matcher_debug_flags | 0 | 匹配器調試標誌 |
| classify_learning_debug_level | 0 | 學習調試等級: |
| matcher_permanent_classes_min | 1 | 永久課程的最低數量 |
| matcher_min_examples_for_prototyping | 3 | 可靠配置閾值 |
| 用於原型設計的充分範例匹配器 | 5 | 即使尚未發現歧義,也應啟用適應機制。 |
| classify_adapt_proto_threshold | 230 | 自適應 0-255 期間良好原型的閾值 |
| classify_adapt_feature_threshold | 230 | 自適應0-255期間良好特徵的閾值 |
| classify_class_pruner_threshold | 229 | 分類修剪器閾值 0-255 |
| classify_class_pruner_multiplier | 15 | 類剪枝器乘數 0-255: |
| classify_cp_cutoff_strength | 7 | 修枝剪剪切強度: |
| classify_integer_matcher_multiplier | 10 | 整數匹配器乘數 0-255: |
| dawg_debug_level | 0 | 設定為 1 顯示常規偵錯訊息,設定為 2 顯示更多詳細信息,設定為 3 顯示所有偵錯訊息 |
| hyphen_debug_level | 0 | 連字符單字的調試等級。 |
| stopper_smallword_size | 2 | 字典詞的大小將被視為非字典詞 |
| stopper_debug_level | 0 | 停止工具偵錯等級 |
| tessedit_truncate_wordchoice_log | 10 | 清單中最多保留多少個單字 |
| max_permuter_attempts | 10000 | 排列組合過程中要考慮的不同字元選擇的最大數量。當使用者指定模式時,此限制尤其有用,因為過於通用的模式會導致搜尋演算法探索過多的選項。 |
| repair_unchopped_blobs | 1 | 修復未被切碎的塊狀物 |
| chop_debug | 0 | 切割調試 |
| chop_split_length | 10000 | 分離式長度 |
| chop_same_distance | 2 | 相同距離 |
| chop_min_outline_points | 6 | 輪廓上的最小點數 |
| chop_seam_pile_size | 150 | seam_pile 中的最大接縫數 |
| chop_inside_angle | -50 | 最小內角彎曲 |
| chop_min_outline_area | 2000 | 最小輪廓區域 |
| chop_centered_maxwidth | 90 | (較小)切碎塊的寬度,我們不在乎切碎塊是否靠近中心。 |
| chop_x_y_weight | 3 | X/Y 長度重量 |
| wordrec_debug_level | 0 | wordrec 的調試級別 |
| wordrec_max_join_chunks | 4 | 要關聯的碎片最大數量 |
| segsearch_debug_level | 0 | SegSearch 偵錯級別 |
| segsearch_max_pain_points | 2000 | 佇列中儲存的最大痛點數量 |
| segsearch_max_futile_classifications | 20 | 每個資料區塊中未能找到更佳詞語選擇的痛點分類的最大數量。 |
| language_model_debug_level | 0 | 語言模型調試級別 |
| language_model_ngram_order | 8 | 字元n元語法模型的最大階數 |
| language_model_viterbi_list_max_num_prunable | 10 | BLOB_CHOICEs 中記錄的每個維特比清單中可修剪條目(PrunablePath() 為 true 的條目)的最大數量 |
| language_model_viterbi_list_max_size | 500 | BLOB_CHOICEs 中記錄的維特比列表的最大大小 |
| language_model_min_compound_length | 3 | 複合詞的最小長度 |
| wordrec_display_segmentations | 0 | 顯示段落 |
| tessedit_pageseg_mode | 6 | 頁面段模式:0=僅 OSD,1=自動+OSD,2=僅自動,3=自動,4=列,5=塊垂直,6=塊,7=行,8=單詞,9=單字圓圈,10=字符,11=稀疏文字,12=稀疏文字+OSD,13=原始行(值來自 tess,/publictypes.hser 中的枚舉) |
| tessedit_ocr_engine_mode | 2 | 選擇要運作的 OCR 引擎(Tesseract、LSTM 或兩者都使用)。預設會載入並運行最精確的可用引擎。 |
| pageseg_devanagari_split_strategy | 0 | 在梵文文檔進行頁面分割時,是否使用頂行分割過程。 |
| ocr_devanagari_split_strategy | 0 | 在對梵文文檔進行 OCR 時,是否使用頂行拆分流程? |
| bidi_debug | 0 | 雙向調試級別 |
| applybox_debug | 1 | 偵錯等級 |
| applybox_page | 0 | 要套用方框的頁碼 |
| tessedit_bigram_debug | 0 | 用於二元語法糾錯的調試輸出量。 |
| debug_noise_removal | 0 | 調試小輪廓的重新分配 |
| noise_maxperblob | 8 | 應用於某個圖形的最大變音符號 |
| noise_maxperword | 16 | 單字可套用的最大變音符號 |
| debug_x_ht_level | 0 | 重新估算調試 |
| quality_min_initial_alphas_reqd | 2 | 好詞中的字母 |
| tessedit_tess_adaption_mode | 39 | 用於 TES 的自適應決策演算法 |
| multilang_debug_level | 0 | 列印多語言偵錯資訊。 |
| paragraph_debug_level | 0 | 列印段落調試資訊。 |
| tessedit_preserve_min_wd_len | 2 | 僅保留 wd 超過此期限 |
| crunch_rating_max | 10 | 每通道評級中的調整長度 |
| crunch_pot_indicators | 1 | 需要多少潛在指標 |
| crunch_leave_lc_strings | 4 | 不要對包含長串小寫字母的單字進行壓縮 |
| crunch_leave_uc_strings | 4 | 不要對包含長串小寫字母的單字進行壓縮 |
| crunch_long_repetitions | 3 | 重複咀嚼單字 |
| crunch_debug | 0 | 正如它所說 |
| fixsp_non_noise_limit | 1 | 兩側各有幾個非噪音氣泡? |
| fixsp_done_mode | 1 | 間距構成要素是什麼? |
| debug_fix_space_level | 0 | 上下文固定空間調試 |
| x_ht_acceptance_tolerance | 8 | 允許的最大偏差範圍為斑點頂部超出字體資料範圍 |
| x_ht_min_change | 8 | 在實際嘗試之前,xht 的最小變化 |
| superscript_debug | 0 | 下標和上標修復器的調試級別 |
| jpg_quality | 85 | 設定 JPEG 品質級別 |
| user_defined_dpi | 0 | 指定輸入影像的DPI |
| min_characters_to_try | 50 | 指定 OSD 期間嘗試的最小字元數 |
| suspect_level | 99 | 可疑標記水平 |
| suspect_short_words | 2 | 不要懷疑字典單字長度超過這個限制。 |
| tessedit_reject_mode | 0 | 拒絕演算法 |
| tessedit_image_border | 2 | Rej blbs 靠近影像邊緣限制 |
| min_sane_x_ht_pixels | 8 | 拒絕任何小於或等於此值的 x-ht 或 eq。 |
| tessedit_page_number | -1 | -1 -> 所有頁面,否則指定要處理的頁面 |
| tessedit_parallelize | 1 | 盡可能並行運行 |
| lstm_choice_mode | 2 | 允許在 hOCR 輸出中包含備選符號選項。有效輸入值為 0、1 和 2。預設值為 0。輸入值為 1 時,每個時間步的備選符號選項都會被包含在內。輸入值為 2 時,備選符號選項將從 CTC 過程而非格中擷取。這些選項是按字元映射的。 |
| lstm_choice_iterations | 5 | 設定 lstm_choice_mode 中 Beamsearch 的級聯迭代次數。請注意,lstm_choice_mode 的值必須大於 0 才能產生結果。 |
| tosp_debug_level | 0 | 偵錯資料 |
| tosp_enough_space_samples_for_median | 3 | 或者我們應該用「均值」這個詞。 |
| tosp_redo_kern_limit | 10 | 重新估計行所需的樣本數 |
| tosp_few_samples | 40 | 無需預留間隙,只需預留一個大間隙即可作為工作台。 |
| tosp_short_row | 20 | 使用證書時,無需預留太多證書空間。 |
| tosp_sanity_method | 1 | 如何避免犯傻 |
| textord_max_noise_size | 7 | 雜訊的像素尺寸 |
| textord_baseline_debug | 0 | 基線調試級別 |
| textord_noise_sizefraction | 10 | 最大值所佔尺寸的比例 |
| textord_noise_translimit | 16 | 正常斑點的過渡 |
| textord_noise_sncount | 1 | 超級規範區塊以保存行 |
| use_ambigs_for_adaption | 0 | 利用歧義詞決定是否要改編某個角色 |
| prioritize_division | 0 | 優先考慮塊狀分割而非切割 |
| classify_enable_learning | 1 | 啟用自適應分類器 |
| tess_cn_matching | 0 | 字元歸一化匹配 |
| tess_bn_matching | 0 | 基線歸一化匹配 |
| classify_enable_adaptive_matcher | 1 | 啟用自適應分類器 |
| classify_use_pre_adapted_templates | 0 | 使用預先適應的分類器模板 |
| classify_save_adapted_templates | 0 | 將修改後的範本儲存到文件 |
| classify_enable_adaptive_debugger | 0 | 啟用匹配調試器 |
| classify_nonlinear_norm | 0 | 非線性筆畫密度歸一化 |
| disable_character_fragments | 1 | 不要將字元片段包含在分類器的結果中 |
| classify_debug_character_fragments | 0 | 為片段訓練打開圖形調試視窗 |
| matcher_debug_separate_windows | 0 | 使用兩個不同的Windows來調試匹配:一個用於原型,一個用於特徵。 |
| classify_bln_numeric_mode | 0 | 假設輸入為數字 [0-9]。 |
| load_system_dawg | 1 | 載入系統單字 dawg。 |
| load_freq_dawg | 1 | 載入常用字“dawg”。 |
| load_unambig_dawg | 1 | 載入明確的單字 dawg。 |
| load_punc_dawg | 1 | 加載帶有標點符號的狗。 |
| load_number_dawg | 1 | 用數字圖案加載狗。 |
| load_bigram_dawg | 1 | 用特殊單字組合加載狗。 |
| use_only_first_uft8_step | 0 | 計算對數機率時,僅使用給定字串的第一個 UTF-8 步長。 |
| stopper_no_acceptable_choices | 0 | 使 AcceptableChoice() 始終傳回 false。當需要探索所有細分時非常有用。 |
| segment_nonalphabetic_script | 0 | 不要使用任何字母特有的技巧。對於草書或固有固定音高的腳本,請在 trainingdata 設定檔中將其設為 true。 |
| save_doc_words | 0 | 儲存文件 Words |
| merge_fragments_in_matrix | 1 | 合併評分矩陣中的碎片,合併後刪除碎片。 |
| wordrec_enable_assoc | 1 | 關聯器啟用 |
| force_word_assoc | 0 | 強制關聯器運行,無論 enable_assoc 的值為何。這用於中日韓語,因為中日韓語需要進行組件分組。 |
| chop_enable | 1 | 啟用斬波 |
| chop_vertical_creep | 0 | 垂直蠕變 |
| chop_new_seam_pile | 1 | 使用新的縫隙堆 |
| assume_fixed_pitch_char_segment | 0 | 在字符分割中加入固定音調啟發式方法 |
| wordrec_skip_no_truth_words | 0 | 僅對 BlamerBundle 中記錄為「真實」的字詞執行 OCR。 |
| wordrec_debug_blamer | 0 | 列印 blamer 調試訊息 |
| wordrec_run_blamer | 0 | 試圖找出錯誤的責任人 |
| save_alt_choices | 1 | 儲存在分割和分段搜尋過程中找到的備選路徑 |
| language_model_ngram_on | 0 | 啟用/停用字元n元語法模型 |
| language_model_ngram_use_only_first_uft8_step | 0 | 計算對數機率時,僅使用給定字串的第一個 UTF-8 步長。 |
| language_model_ngram_space_delimited_language | 1 | 單字之間以空格分隔。 |
| language_model_use_sigmoidal_certainty | 0 | 使用S型曲線評分評估確定性 |
| tessedit_resegment_from_boxes | 0 | 從盒文件中取得分割和標籤 |
| tessedit_resegment_from_line_boxes | 0 | 將單字/行框文件轉換為字元框文件 |
| tessedit_train_from_boxes | 0 | 從帶框字元產生訓練資料 |
| tessedit_make_boxes_from_boxes | 0 | 從帶框字元產生更多框 |
| tessedit_train_line_recognizer | 0 | 將輸入拆分成行,並重新映射框(如果存在)。 |
| tessedit_dump_pageseg_images | 0 | 轉儲頁面分割過程中產生的中間影像 |
| tessedit_do_invert | 1 | 嘗試在LSTMRecognizeWord中反轉影像。 |
| tessedit_ambigs_training | 0 | 進行歧義培訓 |
| tessedit_adaption_debug | 0 | 產生並列印適配調試訊息 |
| applybox_learn_chars_and_char_frags_mode | 0 | 學習字元片段(如在特殊低曝光模式下所做的那樣)以及完整的字元。 |
| applybox_learn_ngrams_mode | 0 | 假設每個邊界框都包含 n 元語法。只學習那些輪廓在水平方向上重疊的 n 元語法。 |
| tessedit_display_outwords | 0 | 繪製輸出詞 |
| tessedit_dump_choices | 0 | 轉儲字元選擇 |
| tessedit_timing_debug | 0 | 列印計時統計資料 |
| tessedit_fix_fuzzy_spaces | 1 | 嘗試改進模糊空間 |
| tessedit_unrej_any_wd | 0 | 別費心考慮措詞的合理性了。 |
| tessedit_fix_hyphens | 1 | 雙連字符? |
| tessedit_enable_doc_dict | 1 | 將單字加入文件詞典中 |
| tessedit_debug_fonts | 0 | 每個字元輸出字體訊息 |
| tessedit_debug_block_rejection | 0 | 區塊和行統計 |
| tessedit_enable_bigram_correction | 1 | 啟用基於二元詞詞典的糾錯功能。 |
| tessedit_enable_dict_correction | 0 | 啟用基於字典的單字糾錯功能。 |
| enable_noise_removal | 1 | 當小輪廓線幹擾版面分析,導致無法區分變音符號和雜訊時,應移除並根據情況重新分配它們。 |
| tessedit_minimal_rej_pass1 | 0 | 對第一遍輸出進行最小程度的剔除 |
| tessedit_test_adaption | 0 | 測試適應性標準 |
| test_pt | 0 | 測試點 |
| paragraph_text_based | 1 | 對帖子文字辨識進行段落檢測(更準確) |
| lstm_use_matrix | 1 | 使用 LSTM 的評級矩陣/束搜索 |
| tessedit_good_quality_unrej | 1 | 減少對優秀文檔的拒稿 |
| tessedit_use_reject_spaces | 1 | 拒絕空格? |
| tessedit_preserve_blk_rej_perfect_wds | 1 | 僅 rej 部分拒絕了塊拒絕中的單字 |
| tessedit_preserve_row_rej_perfect_wds | 1 | 行拒絕中只有部分拒絕的詞 |
| tessedit_dont_blkrej_good_wds | 0 | 使用分詞品質指標 |
| tessedit_dont_rowrej_good_wds | 0 | 使用分詞品質指標 |
| tessedit_row_rej_good_docs | 1 | 對優秀文檔應用程式拒絕規則 |
| tessedit_reject_bad_qual_wds | 1 | 拒絕所有劣質wds |
| tessedit_debug_doc_rejection | 0 | 頁面統計 |
| tessedit_debug_quality_metrics | 0 | 輸出資料到調試文件 |
| bland_unrej | 0 | 未檢查的拒絕潛力 |
| unlv_tilde_crunching | 0 | 標記壞字以進行波浪線壓縮 |
| hocr_font_info | 0 | 將字體資訊加入 hocr 輸出 |
| hocr_char_boxes | 0 | 將每個字元的座標加入 hocr 輸出中 |
| crunch_early_merge_tess_fails | 1 | 文字處理之前? |
| crunch_early_convert_bad_unlv_chs | 0 | 提前取出~^? |
| crunch_terrible_garbage | 1 | 正如它所說 |
| crunch_leave_ok_strings | 1 | 不要觸碰敏感的弦 |
| crunch_accept_ok | 1 | 在 okstring 中使用可接受性 |
| crunch_leave_accept_strings | 0 | 不要用鍋子碾碎敏感的弦 |
| crunch_include_numerals | 0 | 小提琴字母 |
| tessedit_prefer_joined_punct | 0 | 獎勵標點符號連接 |
| tessedit_write_block_separators | 0 | 在輸出中寫入區塊分隔符 |
| tessedit_write_rep_codes | 0 | 編寫重複字元程式碼 |
| tessedit_write_unlv | 0 | 寫入 .unlv 輸出文件 |
| tessedit_create_txt | 0 | 寫入 .txt 輸出文件 |
| tessedit_create_hocr | 0 | 寫入 .html hOCR 輸出文件 |
| tessedit_create_alto | 0 | 寫入 .xml ALTO 文件 |
| tessedit_create_lstmbox | 0 | 寫入用於 LSTM 訓練的 .box 文件 |
| tessedit_create_tsv | 0 | 寫入 .tsv 輸出文件 |
| tessedit_create_wordstrbox | 0 | 以 WordStr 格式寫入 .box 輸出文件 |
| tessedit_create_pdf | 0 | 寫入 .pdf 輸出文件 |
| textonly_pdf | 0 | 建立僅包含一個不可見文字圖層的 PDF 文件 |
| suspect_constrain_1Il | 0 | UNLV 保留 1Il 字元被拒絕 |
| tessedit_minimal_rejection | 0 | 僅拒絕測試失敗 |
| tessedit_zero_rejection | 0 | 不要拒絕任何事 |
| tessedit_word_for_word | 0 | 確保每個 WERD 輸出恰好包含一個單字 |
| tessedit_zero_kelvin_rejection | 0 | 什麼都不要拒絕 |
| tessedit_rejection_debug | 0 | 適配調試 |
| tessedit_flip_0O | 1 | 上下文 0O O0 翻轉 |
| rej_trust_doc_dawg | 0 | 在 11l 設定偵測器中使用 DOC dawg |
| rej_1Il_use_dict_word | 0 | 使用字典測試 |
| rej_1Il_trust_permuter_type | 1 | 不要重複檢查 |
| rej_use_tess_accepted | 1 | 個體拒絕控制 |
| rej_use_tess_blanks | 1 | 個體拒絕控制 |
| rej_use_good_perm | 1 | 個體拒絕控制 |
| rej_use_sensible_wd | 0 | 擴展、切換、檢查 |
| rej_alphas_in_number_perm | 0 | 擴展、切換、檢查 |
| tessedit_create_boxfile | 0 | 輸出帶框的文字 |
| tessedit_write_images | 0 | 從IPE擷取影像 |
| interactive_display_mode | 0 | 以互動方式運行? |
| tessedit_override_permuter | 1 | 根據 dict_word |
| tessedit_use_primary_params_model | 0 | 在多語言模式下,使用主要語言的參數模型 |
| textord_tabfind_show_vlines | 0 | 調試行查找 |
| textord_use_cjk_fp_model | 0 | 採用中日韓固定螺距模型 |
| poly_allow_detailed_fx | 0 | 讓特徵提取器查看原始輪廓 |
| tessedit_init_config_only | 0 | 僅使用設定檔進行初始化。如果實例不用於 OCR,而僅用於佈局分析等用途,則此方法很有用。 |
| textord_equation_detect | 0 | 開啟方程式偵測器 |
| textord_tabfind_vertical_text | 1 | 啟用垂直偵測 |
| textord_tabfind_force_vertical_text | 0 | 強制使用垂直文字頁面模式 |
| preserve_interword_spaces | 0 | 保留多個詞間空格 |
| pageseg_apply_music_mask | 1 | 偵測五線譜並移除交叉部分 |
| textord_single_height_mode | 0 | 腳本沒有 x 高度,因此請使用單模式 |
| tosp_old_to_method | 0 | 太空統計資料是否使用預切? |
| tosp_old_to_constrain_sp_kn | 0 | 約束 old_to_method 的詞間和詞內間隙的相對值。 |
| tosp_only_use_prop_rows | 1 | 區塊統計資料是否適用於固定間距行? |
| tosp_force_wordbreak_on_punct | 0 | 強制以標點符號斷詞,以斷開非空格分隔語言中的長行 |
| tosp_use_pre_chopping | 0 | 太空統計資料是否使用預切? |
| tosp_old_to_bug_fix | 0 | 修復舊代碼中疑似的錯誤 |
| tosp_block_use_cert_spaces | 1 | 僅統計明顯的空間 |
| tosp_row_use_cert_spaces | 1 | 僅統計明顯的空間 |
| tosp_narrow_blobs_not_cert | 1 | 僅統計明顯的空間 |
| tosp_row_use_cert_spaces1 | 1 | 僅統計明顯的空間 |
| tosp_recovery_isolated_row_stats | 1 | 當憑證空間不足時,單獨使用行。 |
| tosp_only_small_gaps_for_kern | 0 | 更好的猜測 |
| tosp_all_flips_fuzzy | 0 | 將任何翻轉傳遞給上下文? |
| tosp_fuzzy_limit_all | 1 | 不要將 kn->sp 模糊限制在表中 |
| textord_no_rejects | 0 | 不要移除雜訊區塊 |
| textord_show_blobs | 0 | 顯示未分類的斑點 |
| textord_show_boxes | 0 | 顯示未分類的斑點 |
| textord_noise_rejwords | 1 | 拒絕類似噪音的詞語 |
| textord_noise_rejrows | 1 | 剔除噪音行 |
| textord_noise_debug | 0 | 調試行垃圾偵測器 |
| classify_learn_debug_str | 類別 str 用於調試學習 | |
| user_words_file | 使用者提供的單字的檔案名稱。 | |
| user_words_suffix | tessdata 中使用者提供的單字的後綴。 | |
| user_patterns_file | 使用者提供的模式的檔案名稱。 | |
| user_patterns_suffix | tessdata 中使用者提供的模式的後綴。 | |
| output_ambig_words_file | 字典中發現的歧義的輸出文件 | |
| word_to_debug | 應該將哪個停止器偵錯資訊列印到標準輸出的單字 | |
| tessedit_char_blacklist | 不識別字元黑名單 | |
| tessedit_char_whitelist | 要辨識的字元白名單 | |
| tessedit_char_unblacklist | 要覆蓋 tessedit_char_blacklist 的字元列表 | |
| tessedit_write_params_to_file | 將所有參數寫入指定檔案。 | |
| applybox_exposure_pattern | .exp | 曝光值在影像檔案名稱中遵循此模式。圖像檔案名稱應採用 [lang].[fontname].exp [num].tif 格式。 |
chs_leading_punct('"</td><td>前導標點</td><td></td></tr> <tr><td>chs_trailing_punct1</td><td>).,;:?!</td><td>第一行末尾標點符號 </td></tr> <tr><td>chs_trailing_punct2)'" | 第2刪除句號 | |
| outlines_odd | %| | 非標準數量的輪廓 |
| outlines_2ij!?%":; | 非標準數量的輪廓 | |
| numeric_punctuation | ., | 標點符號。預計在數字範圍內。 |
| unrecognised_char | | | 未識別斑點的輸出字符 |
| ok_repeated_ch_non_alphanum_wds | -?*= | 允許神經網路取消拒絕 |
| conflict_set_I_l_1 | Il1 [] | Il1衝突集 |
| file_type | .tif | 檔案副檔名 |
| tessedit_load_sublangs | 要使用此外掛程式載入的語言列表 | |
| page_separator | 頁面分隔符號(預設為換頁控製字元) | |
| classify_char_norm_range | 0.2 | 字元歸一化範圍... |
| classify_max_rating_ratio | 1.5 | 分類器評級之間的否決比率 |
| classify_max_certainty_margin | 5.5 | 分類器確定性之間的否決差異 |
| matcher_good_threshold | 0.125 | 精彩對決(0-1) |
| matcher_reliable_adaptive_result | 0 | 精彩比賽(0-1) |
| matcher_perfect_threshold | 0.02 | 完美匹配(0-1) |
| matcher_bad_match_pad | 0.15 | 糟糕的比賽墊(0-1) |
| matcher_rating_margin | 0.1 | 新模板邊距(0-1) |
| matcher_avg_noise_size | 12 | 平均噪音斑點長度 |
| matcher_clustering_max_angle_delta | 0.015 | 原型聚類的最大角度變化 |
| classify_misfit_junk_penalty | 0 | 當非字母元素垂直偏離其預期的文字行位置時,將適用懲罰。 |
| rating_scale | 1.5 | 評級縮放因子 |
| certainty_scale | 20 | 確定性縮放因子 |
| tessedit_class_miss_scale | 0.00390625 | 未使用特徵的比例因子 |
| classify_adapted_pruning_factor | 2.5 | 修剪效果不佳的結果比最佳結果還要糟糕得多 |
| classify_adapted_pruning_threshold | -1 | classify_adapted_pruning_factor 開始的閾值 |
| 分類字元片段垃圾確定性閾值 | -3 | 將看起來不像完整字符的片段從訓練和適應過程中排除。 |
| speckle_large_max_size | 0.3 | 最大大斑點尺寸 |
| speckle_rating_penalty | 10 | 噪音處罰將加到最差評級。 |
| xheight_penalty_subscripts | 0.125 | 如果單字中有下標或上標,則加罰分(0.1 = 10%),否則沒問題。 |
| xheight_penalty_inconsistent | 0.25 | 如果 x 高度不一致,則加罰分(0.1 = 10%)。 |
| segment_penalty_dict_frequent_word | 1 | 對於大小寫匹配良好且在給定語言中頻繁出現的單詞,得分倍數(越低越好)。 |
| segment_penalty_dict_case_ok | 1.1 | 區分大小寫的單字配對得分倍數(數值越低越好)。 |
| segment_penalty_dict_case_bad | 1.3125 | 單字匹配的預設得分倍數,可能存在大小寫問題(數值越低越好)。 |
| segment_penalty_dict_nonword | 1.25 | 對於與字典詞不符的字形片段分割結果,得分倍數(數值越低越好)。 |
| certainty_scale | 20 | 確定性縮放因子 |
| stopper_nondict_certainty_base | -2.5 | 非字典詞的確定性閾值 |
| stopper_phase2_certainty_rejection_offset | 1 | 拒絕確定性補償 |
| stopper_certainty_per_char | -0.5 | 確定要為字典中每個大於小單字長度的字元添加內容。 |
| stopper_allowable_character_badness | 3 | 一個字中允許的最大確定性變化(以西格瑪為單位) |
| doc_dict_pending_threshold | 0 | 使用待定字典的最差確定性 |
| doc_dict_certainty_threshold | -2.25 | 可插入文件字典的詞語的最差確定性 |
| tessedit_certainty_threshold | -2.25 | 良好的斑點限制 |
| chop_split_dist_knob | 0.5 | 分離式長度調節 |
| chop_overlap_knob | 0.9 | 分割重疊調整 |
| chop_center_knob | 0.15 | 分離式中心調節 |
| chop_sharpness_knob | 0.06 | 分割銳利度調整 |
| chop_width_change_knob | 5 | 寬度變化調整 |
| chop_ok_split | 100 | OK 分割限制 |
| chop_good_split | 50 | 良好的分攤限額 |
| segsearch_max_char_wh_ratio | 2 | 最大字元寬高比 |
為了獲得最佳效果,建議在應用 OCR 之前使用 IronOCR 的圖像預處理過濾器。 這些過濾器可以顯著提高準確性,特別是在處理低質量掃描或表格等複雜文件時。
常見問題
如何在C#中設置Iron Tesseract進行OCR?
要在C#中使用Iron Tesseract,建立一個IronTesseract實例,使用您所需的語言和OCR設定進行配置,然後在包含您的圖像或PDF的OcrInput對象上調用Read()方法。此設置允許將文本高效識別並轉換為可搜尋的PDF。
Iron Tesseract支持哪些高級功能?
Iron Tesseract,基於優化的Tesseract 5引擎,支持條碼閱讀、電腦視覺和多語言OCR處理。它包括字符白名單/黑名單設置和可自定義的配置變量以實現量身訂做的OCR過程。
Iron Tesseract能處理多種語言嗎?
是的,Iron Tesseract支持125種國際語言的OCR。您可以設置最符合您文件需求的語言配置以實現準確的文本抽取。
如何提高Iron Tesseract的OCR準確性?
要提高Iron Tesseract的OCR準確性,利用其圖像預處理濾鏡。這些濾鏡可優化輸入圖像,特別是在處理低質量掃描或複雜文件佈局時,改善OCR結果。
Iron Tesseract可以讀取條碼嗎?
是的,可以通過配置Iron Tesseract的TesseractConfiguration選項來啟用條碼閱讀,允許在提取文本的同時提取條碼數據。
如何配置Iron Tesseract以處理金融文件?
為了處理金融文件,配置Iron Tesseract以將PageSegmentationMode設置為SingleBlock,並為金融文本中常見的數字和符號指定字符白名單。應用如校正偏斜和提高解析度的預處理濾鏡以提高準確性。
多執行緒在Iron Tesseract中的作用是什麼?
多執行緒使Iron Tesseract能夠同時處理多個文件,大大提高批量操作的性能,允許從大型數據集中更快地提取文本。
如何在Iron Tesseract中將OCR結果保存為可搜尋的PDF?
要在Iron Tesseract中將OCR結果保存為可搜尋的PDF,請確保在TesseractConfiguration中將RenderSearchablePdf設置為true。這將配置輸出為可搜尋的PDF,保留文本佈局並提高文件的易用性。
什麼是Tesseract配置變量,如何使用?
Iron Tesseract中的Tesseract配置變量允許自定義OCR處理。它們可以通過IronTesseract.Configuration.TesseractVariables設置,從而優化如修復低質量掃描或針對特定文件格式的任務。
如何使用Iron Tesseract加載圖像進行OCR?
您可以使用OcrInput類在Iron Tesseract中加載圖像進行OCR。此類提供了加載多種格式如PNG、JPEG或PDF的方法,然後可以由IronTesseract實例進行處理以提取和閱讀文本。
Curtis Chau 擁有卡爾頓大學計算機科學學士學位,專注於前端開發,擅長於 Node.js、TypeScript、JavaScript 和 React。Curtis 熱衷於創建直觀且美觀的用戶界面,喜歡使用現代框架並打造結構良好、視覺吸引人的手冊。