使用 IronOCR 從掃描影像中提取表格資料:現場演示回顧
從掃描影像中提取資料是一個常見的挑戰,尤其是在涉及表格等結構化資料時。 借助 IronOCR 的先進機器學習功能,您現在可以無縫提取表格資料,包括單元格值及其位置。 在本示範中,軟體銷售工程師 Shadman Majid將逐步解說程式碼實現,而銷售和市場總監 Anne Lazarakis將分享 Iron Software 客戶的真實用例。
實際應用案例

由銷售和市場總監 Anne Lazarakis 講解*
保險理賠處理(Opyn市場)
在美國監管嚴格的醫療保險行業,像Opyn Market這樣的公司仍然透過傳真接收許多文件。 這些掃描文件通常包含表格資料,必須準確地提取這些資料並輸入到內部系統中。 借助 IronOCR,他們能夠實現這一過程的自動化,減少人工操作,並消除人為錯誤的可能性。
物流與食品配送(iPAP)
美國最大的乳酪分銷商iPAP使用 IronOCR 管理 200 多個客戶訂單。 他們的發票格式各異,表格佈局也不統一。 IronOCR 可以幫助他們有效率地從掃描文件中提取採購訂單號碼、出貨日期和商品詳情,即使文件格式各異。 這項自動化措施每年為他們節省了 4 萬至 4.5 萬美元。

技術概述

與軟體銷售工程師Shadman Majid進行線上程式設計展示*
IronOCR 使用專有的機器學習模型來偵測和擷取掃描文件中的表格資料。 此功能支援:
- 提取表格單元格及其座標
- 對掃描影像和多幀PDF進行OCR識別
- 相容於 C#、VB.NET、.NET Standard、.NET Framework 和 .NET Core

要使用此功能,您需要:
IronOCRNuGet 套件IronOcr.Extensions.AdvancedScanning用於透過機器學習模型進行表格檢測的 NuGet 套件
這些軟體包包含用於表格結構檢測和精確 OCR 的訓練好的 ML 模型。
提取表格的範例程式碼
以下是一個 C# 程式碼範例片段,示範如何使用 IronOCR 從影像中擷取表格資料:
// Import the necessary IronOCR namespaces
using IronOcr;
// Initialize the IronTesseract to handle OCR processes
var Ocr = new IronTesseract();
// Load the image containing the table
using (var input = new OcrInput("invoice.jpg"))
{
// Perform OCR and extract text data including tables
var result = Ocr.Read(input);
// Iterate through each page in the document
foreach (var page in result.Pages)
{
// Iterate through each table found on the page
foreach (var table in page.Tables)
{
Console.WriteLine("Table found:");
// Iterate through each row in the table
foreach (var row in table.Rows)
{
// Convert the row of cells to a comma-separated string
var cells = string.Join(", ", row.Cells.Select(cell => cell.Text));
Console.WriteLine(cells);
}
}
}
}
// Import the necessary IronOCR namespaces
using IronOcr;
// Initialize the IronTesseract to handle OCR processes
var Ocr = new IronTesseract();
// Load the image containing the table
using (var input = new OcrInput("invoice.jpg"))
{
// Perform OCR and extract text data including tables
var result = Ocr.Read(input);
// Iterate through each page in the document
foreach (var page in result.Pages)
{
// Iterate through each table found on the page
foreach (var table in page.Tables)
{
Console.WriteLine("Table found:");
// Iterate through each row in the table
foreach (var row in table.Rows)
{
// Convert the row of cells to a comma-separated string
var cells = string.Join(", ", row.Cells.Select(cell => cell.Text));
Console.WriteLine(cells);
}
}
}
}
' Import the necessary IronOCR namespaces
Imports IronOcr
' Initialize the IronTesseract to handle OCR processes
Private Ocr = New IronTesseract()
' Load the image containing the table
Using input = New OcrInput("invoice.jpg")
' Perform OCR and extract text data including tables
Dim result = Ocr.Read(input)
' Iterate through each page in the document
For Each page In result.Pages
' Iterate through each table found on the page
For Each table In page.Tables
Console.WriteLine("Table found:")
' Iterate through each row in the table
For Each row In table.Rows
' Convert the row of cells to a comma-separated string
Dim cells = String.Join(", ", row.Cells.Select(Function(cell) cell.Text))
Console.WriteLine(cells)
Next row
Next table
Next page
End Using
-載入圖片:腳本首先初始化 IronTesseract 引擎,然後載入名為 invoice.jpg 的映像文件,該圖片檔案是要處理的。
- OCR 執行:對輸入執行 OCR 以提取文字資料,尤其側重於任何表格。 -表格擷取:此腳本遍歷偵測到的每個表格及其行,以結構化的方式輸出儲存格內容。
在執行此腳本之前,請確保已安裝 IronOCR 所需的 NuGet 套件。
結論
IronOCR 可以輕鬆地從掃描文件中自動提取複雜的表格資料。 無論你身處醫療保健、物流、金融或製造業,解決方案都能提供可靠性、準確性和節省成本的效率。 只需幾行程式碼,即可消除手動資料輸入並減少人為錯誤。
想看看它的實際效果嗎? 點擊這裡預約與我們工程師的線上演示。
常見問題解答
如何使用C#從掃描圖像中提取表格數據?
您可以使用IronOCR的先進機器學習功能從掃描圖像中提取表格數據。該過程涉及使用IronTesseract引擎在圖像上執行OCR並提取資訊,包括單元格值及其座標。
從掃描文件中提取表格數據的一些現實應用是什麼?
實際應用包括通過從傳真文件中提取表格數據來自動化保險理賠處理,並在物流管理中管理客戶訂單,其中發票以不同格式和不一致的表格佈局出現,正如公司如Opyn Market和iPAP所展示的那樣。
IronOCR為表格數據提取提供了哪些技術能力?
IronOCR提供了如提取表格單元格和座標,掃描圖像和多幀PDF的OCR,並兼容C#、VB.NET、.NET Standard、.NET Framework和.NET Core等功能。
使用IronOCR提取表格數據的代碼步驟有哪些?
該過程涉及初始化IronTesseract引擎、載入圖像、執行OCR以提取文本數據,並遍歷每個檢測到的表格及其行以輸出單元格內容。
使用IronOCR提取表格數據需要哪些包?
您需要IronOCR的NuGet包以及IronOcr.Extensions.AdvancedScanning包以利用必要的ML模型進行表格檢測和精確OCR。
IronOCR如何提高醫療保健和物流行業的效率?
IronOCR通過從掃描文件中自動提取複雜表格數據來減少人工勞動和人為錯誤,為如醫療保健和物流行業提供了顯著的效率和成本節省。
我可以看到IronOCR功能的現場演示嗎?
可以,您可以預約Iron Software的一位工程師進行現場演示,以了解IronOCR的功能並看到它在提取表格數據方面的表現。

