Google Cloud Vision API - client.DetectText 正在跳过 0
Google Cloud Vision API - client.DetectText is Skipping 0's
我目前正在尝试从一些图像中读取文本,google api 似乎跳过了一些 0。
代码如下:
Google.Cloud.Vision.V1.Image image = Google.Cloud.Vision.V1.Image.FromFile(imagepath);
ImageAnnotatorClient client = ImageAnnotatorClient.Create();
IReadOnlyList<EntityAnnotation> response = client.DetectText(image);
string test = string.Empty;
foreach (EntityAnnotation annotation in response)
{
if (annotation.Description != null)
{
Console.WriteLine(annotation.Description);
test += Environment.NewLine + annotation.Description;
}
}
这是它正在尝试的图像:Attempt 1Attempt 2Attempt 3
是否需要更改设置以使其接受 0?
这也是
的输出
尝试 1:https://pastebin.com/dNxRt7QK
results above
尝试 2:https://pastebin.com/XVZzmtTg
results above
尝试 3:https://pastebin.com/2kQMiC8h
results above
它真的很擅长读取所有内容,但它真的很讨厌读取 0。
死亡特别是在尝试 2/3 中。
编辑:
添加一些来自 google 拖放测试的结果:
Attempt 1
Attempt 2
为了获得更好的效果,建议不要使用有损格式(有损格式示例:JPEG)。使用或减小此类有损格式的文件大小可能会导致图像质量下降,从而降低 Vision API 准确性。
图像的推荐尺寸为 1024 x 768,用于特征 TEXT_DETECTION 和 DOCUMENT_TEXT_DETECTION。作为补充说明:
The Vision API requires images to be a sufficient size so that
important features within the request can be easily distinguished.
Sizes smaller or larger than these recommended sizes may work.
However, smaller sizes may result in lower accuracy, while larger
sizes may increase processing time and bandwidth usage without
providing comparable benefits in accuracy. Image size should not
exceed 75M pixels (length x width) for OCR analysis.
上面讨论的项目可以在这个 article.
中找到
使用您正在使用的代码,您可以交替使用 DOCUMENT_TEXT_DETECTION 功能和 select 那些可以给您带来更好结果的功能。我看到您正在为 DOCUMENT_TEXT_DETECTION.
使用此 link for TEXT_DETECTION. Try using the code in this link 中的代码
如果在执行建议操作后问题仍然存在,我建议您联系 Google 云平台支持或通过此 link 创建一个 public 问题。
我目前正在尝试从一些图像中读取文本,google api 似乎跳过了一些 0。
代码如下:
Google.Cloud.Vision.V1.Image image = Google.Cloud.Vision.V1.Image.FromFile(imagepath);
ImageAnnotatorClient client = ImageAnnotatorClient.Create();
IReadOnlyList<EntityAnnotation> response = client.DetectText(image);
string test = string.Empty;
foreach (EntityAnnotation annotation in response)
{
if (annotation.Description != null)
{
Console.WriteLine(annotation.Description);
test += Environment.NewLine + annotation.Description;
}
}
这是它正在尝试的图像:Attempt 1Attempt 2Attempt 3
是否需要更改设置以使其接受 0?
这也是
的输出
尝试 1:https://pastebin.com/dNxRt7QK
results above
尝试 2:https://pastebin.com/XVZzmtTg
results above
尝试 3:https://pastebin.com/2kQMiC8h
results above
它真的很擅长读取所有内容,但它真的很讨厌读取 0。 死亡特别是在尝试 2/3 中。
编辑: 添加一些来自 google 拖放测试的结果: Attempt 1 Attempt 2
为了获得更好的效果,建议不要使用有损格式(有损格式示例:JPEG)。使用或减小此类有损格式的文件大小可能会导致图像质量下降,从而降低 Vision API 准确性。
图像的推荐尺寸为 1024 x 768,用于特征 TEXT_DETECTION 和 DOCUMENT_TEXT_DETECTION。作为补充说明:
The Vision API requires images to be a sufficient size so that important features within the request can be easily distinguished. Sizes smaller or larger than these recommended sizes may work. However, smaller sizes may result in lower accuracy, while larger sizes may increase processing time and bandwidth usage without providing comparable benefits in accuracy. Image size should not exceed 75M pixels (length x width) for OCR analysis.
上面讨论的项目可以在这个 article.
中找到使用您正在使用的代码,您可以交替使用 DOCUMENT_TEXT_DETECTION 功能和 select 那些可以给您带来更好结果的功能。我看到您正在为 DOCUMENT_TEXT_DETECTION.
使用此 link for TEXT_DETECTION. Try using the code in this link 中的代码如果在执行建议操作后问题仍然存在,我建议您联系 Google 云平台支持或通过此 link 创建一个 public 问题。