圖像用C ++庫發短信
將圖像變成文字
更多的展示 >AsposeOCRInput source;
source.url = file_path_str.c_str();
vector<AsposeOCRInput> content = {source};
// Extract text from the image
AsposeOCRRecognitionResult result
= asposeocr_recognize(content.data(), content.size());
// Output the recognized text
size_t size = 0;
wchar_t* result = asposeocr_serialize_result(result, size);
> Install-Package Aspose.Ocr.Cpp
為什麼aspose.ocr用於c ++?
在本地應用程序,Web服務或云中創建並識別任何佈局和復雜性的機器可讀形式。我們的解決方案適用於任何規模的項目 - 從簡單的調查和測驗到期末考試和選舉。單擊下面的項目以了解有關我們的功能和好處的更多信息。

照片OCR
從智能手機照片中提取文字,具有掃描級別的精度。
可搜索的PDF
將任何掃描轉換為完全可搜索且可索引的文檔。
URL識別
識別來自URL的圖像而無需在本地下載。
散裝認可
閱讀來自多頁文檔,文件夾和檔案的所有圖像。
任何字體和样式
識別並識別所有流行字體和样式中的文本。
實時代碼樣本
體驗簡單性:將圖像轉換為文本僅在三行C ++代碼中!
將圖像轉換為文字
發現更多例子 > string file = "source.png";
AsposeOCRInput source;
source.url = file.c_str();
vector<AsposeOCRInput> content = {source};
RecognitionSettings settings;
settings.language_alphabet = language::eng;
size_t size = 0;
wchar_t* buffer = asposeocr_serialize_result(result, size);
wcout << wstring(buffer) << endl;
asposeocr_free_result(result);
到處都是C ++電源
aspose.ocr for C ++在任何平台上無縫操作。
支持的文件格式
Aspose.OCR for C++ 可以使用任何 文件 您可以從掃描儀或相機中獲得。識別結果可以保存,導入到數據庫或實時分析。
圖像
- JPEG
- PNG
- TIFF
- BMP
批量OCR
- Multi-page PDF
- ZIP
- Folder
識別結果
- Text
- Microsoft Word
- Microsoft Excel
- RTF
- JSON
- XML
安裝
C ++的Aspose.ocr庫以nuget軟件包或[可下載文件](https://releases.aspose.com/ocr/cpp/)分發,具有最小的依賴關係。輕鬆[install](https://docs.aspose.com/ocr/cpp/installation/)將其進入您的項目,您可以用多種支持的語言識別文本並以各種格式識別識別結果。
[請求試用許可證](https://purchase.aspose.com/temporary-license),以啟動無限制的功能性OCR應用程序的開發。
C ++電源
我們的庫完全支持C ++ 11及以後的庫,使您的應用程序能夠在任何平台上無縫運行 - 台式Windows,Windows Server,MacOS,Linux和Cloud。
140多種識別語言
我們的C ++ OCR API識別出多種語言和流行的寫作腳本,包括混合語言:
將語言檢測留在圖書館或自己定義語言以增強識別性能和可靠性。
- 延長拉丁語字母:英語,西班牙語,法語,印尼,葡萄牙語,德國,越南語,土耳其語,意大利語,波蘭語等80歲以上;
- 西里爾字母:俄羅斯,烏克蘭,哈薩克,塞爾維亞,白俄羅斯,保加利亞語;
- 阿拉伯語,波斯語,烏爾都語;
- 中文和devanagari劇本,包括印地語,馬拉地語,博伊布里等。
授權的功能和功能
Aspose.OCR for C++ 發現C ++的Aspose.ocr的高級功能。
照片OCR
從智能手機照片中提取文字,具有掃描級別的精度。
可搜索的PDF
將任何掃描轉換為完全可搜索且可索引的文檔。
URL識別
識別來自URL的圖像而無需在本地下載。
散裝認可
閱讀來自多頁文檔,文件夾和檔案的所有圖像。
任何字體和样式
識別並識別所有流行字體和样式中的文本。
微調識別
調整每個OCR參數以獲得最佳識別結果。
拼寫檢查器
通過自動糾正拼寫錯誤的單詞來改善結果。
在圖像中找到文字
在一組圖像中搜索文本或正則表達式。
比較圖像文本
無論情況和佈局如何,都比較兩個圖像上的文本。
限制識別範圍
限制OCR引擎將要尋找的字符集。
檢測圖像缺陷
自動發現圖像的潛在問題領域。
認識區域
找到並僅讀取圖像的特定區域,而不是全部文本。
C ++代碼樣本
深入探究代碼樣本,將C ++的Aspose.ocr無縫集成到您的應用程序中。
C ++安裝精通
後安裝後,您可以立即開始使用Aspose.ocr進行C ++,儘管有某些限制。臨時許可將使所有試用版本限制30天。利用此期間啟動功能齊全的OCR應用程序的開發,使您可以在以後的階段做出明智的購買aspose.ocr.ocr。
C ++照片的OCR
克服缺乏廣泛掃描儀的OCR應用的挑戰。我們的API擁有功能強大的內置圖像預處理過濾器,這些過濾器巧妙地處理旋轉,偏斜和嘈雜的圖像。結合對所有圖像格式的支持,它即使在智能手機照片中也可以確保可靠的識別。大多數預處理和圖像校正都是自動化的,只需要在具有挑戰性的情況下進行干預。您也可以預先定義圖像區域。
設置偏斜校正和定義識別區域的自定義角度-C ++
string file = "photo.png";
AsposeOCRInput source;
source.url = file.c_str();
std::vector<AsposeOCRInput> content = { source };
// Fine-tune recognition
RecognitionSettings settings;
settings.detect_areas_mode = detect_areas_mode_enum::PHOTO;
// Extract text from the photo
auto result = asposeocr_recognize(content.data(), content.size(), settings);
// Output the recognized text
wchar_t* buffer = asposeocr_serialize_result(result, buffer_size, export_format::text);
std::wcout << std::wstring(buffer) << std::endl;
// Release the resources
asposeocr_free_result(result);
檢測圖像缺陷
圖像缺陷可以顯著影響OCR的準確性。它們可能是由圖像採集過程,環境條件以及用於捕獲圖像的硬件的質量引起的。為了提高識別精度,必須盡可能地預處理和增強圖像來減輕這些缺陷。c ++的aspose.ocr可以[自動找到](https://docs.aspose.com/ocr/cpp/cpp/detecting-image-defects/)在識別過程中可能會出現圖像的問題區域。您可以在預覽圖像時突出顯示問題區域,甚至使用替代識別設置來獲得更好的結果。
識別模糊,扭曲和低對比度圖像的文字-C ++
// Provide the image
string file = "source.png";
AsposeOCRInput source;
source.url = file.c_str();
vector<AsposeOCRInput> content = {source};
// Activate detection of low-contrast areas
RecognitionSettings settings;
settings.defect_type = defect_type::ASPOSE_OCR_DETECT_DARK_IMAGES;
// Find and show low-contrast areas
AsposeOCRRecognitionResult result = asposeocr_recognize(content.data(), content.size(), settings);
for (size_t p_number = 0; p_number < result.pages_amount; ++p_number)
{
cout << "Page " << p_number << ";\n";
const auto& page = result.recognized_pages[p_number];
for (size_t defect_number = 0; defect_number < page.defects_count; ++defect_number)
{
const auto& defect_area = page.defect_areas[defect_number];
cout << "Low-contrast area " << defect_number << ":" << defect_area.area << std::endl;
}
}
// Release the resources
asposeocr_free_result(result);
批處理處理
OCR API通過提供各種批處理方法,使您無法一一識別每個圖像,從而使您可以在一個呼叫中識別多個圖像:
- 識別多頁PDF和TIFF文件。
- 識別文件夾中的所有文件。
- 識別存檔中的所有文件。
識別郵政編碼-C ++
// Provide a ZIP archive
string file = "pages.zip";
AsposeOCRInput source;
source.url = file.c_str();
std::vector<AsposeOCRInput> content = { source };
// Fine-tune recognition
RecognitionSettings settings;
settings.detect_areas_mode = detect_areas_mode_enum::COMBINE;
// Extract texts
auto result = asposeocr_recognize(content.data(), content.size(), settings);