首页 > 解决方案 > Google Cloud Vision 文本检测 - 忽略徽标上的文本

问题描述

我正在使用以下代码检测图像上的文本,然后将该结果作为字符串数组获取:

const [result] = await googleapis.textDetection(attachment.url);
const texts = result.fullTextAnnotation;
const parsedText = texts.text.split('\n');

但是,我的图像主要包含文本,但有时也可以包含各种徽标。我知道 Google Cloud Vision 有一个用于检测徽标的 api,所以我想知道是否可以检测到徽标,然后在进行文本检测之前“删除它们”。或者在文本检测中基本上忽略它们。

标签: node.jsocrgoogle-cloud-vision

解决方案


推荐阅读