【发布时间】:2017-06-01 09:58:23
【问题描述】:
我在探索google vision和具体功能 'detectCrops',给我作物提示。这到底是什么意思?
我尝试使用示例图像访问 api,并得到一个具有四个坐标的数组的响应。这个坐标意味着什么?纵横比是固定的吗?我可以指定特定的纵横比吗? .文档不清楚或我无法理解。
我的代码
var vision = require('@google-cloud/vision')({
projectId: Credentials.PROJECT_ID,
credentials: Credentials.AUTH_KEY
})
vision.detectCrops('img.jpg', function(err, crops, apiResponse) {
console.log('err', err)
console.log('crops', crops)
console.log('apiResponse', apiResponse)
})
回应
err null
crops [ [ { x: 0, y: 0 },
{ x: 649, y: 0 },
{ x: 649, y: 399 },
{ x: 0, y: 399 } ] ]
apiResponse { responses:
[ { faceAnnotations: [],
landmarkAnnotations: [],
logoAnnotations: [],
labelAnnotations: [],
textAnnotations: [],
fullTextAnnotation: null,
safeSearchAnnotation: null,
imagePropertiesAnnotation: null,
cropHintsAnnotation: [Object],
webDetection: null,
error: null } ] }
【问题讨论】:
标签: node.js google-vision