【发布时间】:2019-04-03 01:16:15
【问题描述】:
目前使用 google cloud vision api 从文档图像中提取文本。
现状 - API 运行良好,可返回大量数据,包括单词所在位置的边界框。
期望的结果 - 仅查询从图像中提取的单词,而不是所有关于单词边界框和顶点位置的元数据(这就像 99% 的响应并出来大约 250k,当我想要的只是文字时,这是一个巨大的浪费)
const vision = require('@google-cloud/vision');
const client = new vision.ImageAnnotatorClient();
// Performs label detection on the image file
client
.documentTextDetection('../assets/images_to_ocr/IMG_0942-min.jpg')
.then(results => {
console.log('result:', result);
})
.catch(err => {
console.error('ERROR:', err);
});
【问题讨论】:
-
我看到这个已经回答了,但是由于 GCV 工程师应该阅读了这些线程,所以这里有另一个对这个功能的请求。我得到了很多话,对于我不需要的大部分多余的东西来说,这是一个完整的兆字节。应该能够在请求中说明您要请求什么数据!