【发布时间】:2020-11-29 02:22:39
【问题描述】:
我目前正在使用 client.DetectText 方法从一些图像中提取数据。图像本身永远不会使用特定数据改变位置,我想获取图像特定区域的数据。
我是否应该只引用文本返回中的位置(特定的换行符)并希望始终如此,或者是否有办法使用此代码:
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;
}
}
我可以添加参数来强制一个特定的图像位置。或者我想我可以在提交代码之前以某种方式裁剪图像?
谢谢。
【问题讨论】: