Я пытаюсь нарисовать линии из вершин блока ML Vision, но безуспешно.
const [result] = await client.textDetection('image.jpg')
const labels = result.fullTextAnnotation
var gm = require('gm').subClass({imageMagick: true})
var picGm = gm('image.jpg')
labels.pages.forEach(page => {
page.blocks.forEach(block => {
block.paragraphs.forEach(paragraph => {
picGm.stroke("#FFFFFF", 20).drawLine(block.boundingBox.vertices[0].x, block.boundingBox.vertices[0].y, block.boundingBox.vertices[1].x, block.boundingBox.vertices[1].y)
picGm.stroke("#FFFFFF", 20).drawLine(block.boundingBox.vertices[1].x, block.boundingBox.vertices[1].y, block.boundingBox.vertices[2].x, block.boundingBox.vertices[2].y)
picGm.stroke("#FFFFFF", 20).drawLine(block.boundingBox.vertices[2].x, block.boundingBox.vertices[2].y, block.boundingBox.vertices[3].x, block.boundingBox.vertices[3].y)
picGm.stroke("#FFFFFF", 20).drawLine(block.boundingBox.vertices[3].x, block.boundingBox.vertices[3].y, block.boundingBox.vertices[0].x, block.boundingBox.vertices[0].y)
})
})
})
Пожалуйста, что я делаю не так?