Skip to content

Instantly share code, notes, and snippets.

@yushulx
Created July 17, 2020 03:21
Show Gist options
  • Save yushulx/e73d3caa22d6c45bbed3462a7892a89b to your computer and use it in GitHub Desktop.
Save yushulx/e73d3caa22d6c45bbed3462a7892a89b to your computer and use it in GitHub Desktop.
if (results != null) {
for (index in results) {
let result = results[index];
let upperLeft = new cv.Point(result.x1, result.y1)
let bottomLeft = new cv.Point(result.x2, result.y2)
let upperRight = new cv.Point(result.x3, result.y3)
let bottomRight = new cv.Point(result.x4, result.y4)
img.drawLine(
upperLeft,
bottomLeft,
drawParams
)
img.drawLine(
bottomLeft,
upperRight,
drawParams
)
img.drawLine(
upperRight,
bottomRight,
drawParams
)
img.drawLine(
bottomRight,
upperLeft,
drawParams
)
img.putText(result.value, new cv.Point(result.x1, result.y1 + 10), fontFace, fontScale, textColor, thickness);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment