This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
您还可以自定义 API 以限制要执行 OCR 的图像区域。在这种情况下,您可以在图像上创建一个矩形以访问所需区域。以下是从图像的特定区域提取文本的步骤。
在字符串变量中设置图像的路径。
准备一个缓冲区来存储 OCR 结果。
使用 aspose::ocr::page_rect(const char *image_path, wchar_t *buffer, size_t buffer_size, int x, int y, int w, int h) 函数执行 OCR。
打印 OCR 结果。
以下代码示例展示了如何使用 C++ 将图像的特定区域转换为文本。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters