跳過到頁腳內容
使用 IRONOCR
HTML 到 PDF:C# .NET 快速教程

使用 IronOCR 從掃描影像中提取表格數據:現場演示回顧

從掃描圖像中提取數據是一個常見的挑戰,尤其當涉及到像表格這樣的結構化數據時。 憑藉IronOCR的先進機器學習功能,您現在可以無縫地提取表格數據,包括單元格的值及其位置。 在此演示中,Shadman Majid,軟體銷售工程師,逐步講解代碼實現,而Anne Lazarakis,銷售和行銷總監,分享Iron Software客戶的實際應用案例。

實際應用案例

Ironocr Extract Table Data 4 related to 實際應用案例

由Anne Lazarakis,銷售和行銷總監解釋*

保險理賠處理(Opyn Market)

在美國高度監管的醫療保險行業中,像Opyn Market這樣的公司仍然通過傳真接收許多文件。 這些掃描文件通常包含必須準確提取並輸入內部系統的表格數據。 利用IronOCR,他們能夠自動化此過程,減少手工作業並消除人為錯誤的可能性。

物流和食物分銷(iPAP)

iPAP,美國最大的奶酪分銷商,使用IronOCR來管理超過200個客戶訂單。 他們的發票以各種格式出現,表格佈局不一致。 IronOCR幫助他們從掃描文檔中高效提取訂單號、裝運日期和項目詳細信息,即使格式多變。 該自動化每年為他們節省了40,000至45,000美元。

Ironocr Extract Table Data 2 related to 物流和食物分銷(iPAP)


技術概覽

Ironocr Extract Table Data 5 related to 技術概覽

Shadman Majid的實時編碼會議,軟體銷售工程師*

IronOCR使用專有的機器學習模型從掃描文檔中檢測和提取表格數據。 此功能支持:

  • 提取表格單元格和坐標
  • 掃描圖像和多頁PDF的OCR
  • 與C#、VB.NET、.NET Standard、.NET Framework和.NET Core的兼容性

Ironocr Extract Table Data 3 related to 技術概覽

要使用此功能,您需要:

這些包包含檢測表格結構和準確OCR所需的訓練ML模型。

提取表格的示例代碼

以下是展示如何使用IronOCR從圖像中提取表格數據的C#代碼片段示例:

// 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
$vbLabelText   $csharpLabel
  • 加載圖像:腳本開始時初始化IronTesseract引擎並加載您要處理的名為invoice.jpg的圖像文件。
  • 執行OCR:它對輸入進行OCR以提取文本數據,特別關注任何表格。
  • 表格提取:腳本遍歷每個檢測到的表格及其行,結構化地輸出單元格內容。

在運行此腳本之前,確保您已安裝必要的NuGet包IronOCR


結論

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的功能並看到它在提取表格數據方面的表現。

Kannaopat Udonpant
軟體工程師
在成為软件工程師之前,Kannapat 從日本北海道大學完成了環境資源博士學位。在追逐學位期间,Kannapat 還成為了生產工程系一部份——汽車机器人实验室的成員。2022 年,他利用他的 C# 技能加入 Iron Software 的工程團隊, 專注於 IronPDF。Kannapat 珍惜他的工作,因为他直接向编写大部分 IronPDF 使用的代码的开发者学习。除了同行学习,Kannapat 还喜欢在 Iron Software 工作的社交十环。当他不编写代码或文档时,Kannapat 通常在他的 PS5 上打游戏或重看《The Last of Us》。