boxPoints function
BoxPoints finds the four vertices of a rotated rect. Useful to draw the rotated rectangle.
return: bottom left, top left, top right, bottom right
For further Details, please see:
https:///docs.opencv.org/3.3.0/d3/dc0/group__imgproc__shape.html#gaf78d467e024b4d7936cf9397185d2f5c
Implementation
VecPoint2f boxPoints(RotatedRect rect, {VecPoint2f? pts}) {
if (pts == null) {
final p = calloc<cimgproc.VecPoint2f>();
cvRun(() => cimgproc.BoxPoints(rect.ref, p));
return VecPoint2f.fromPointer(p);
}
cvRun(() => cimgproc.BoxPoints(rect.ref, pts.ptr));
return pts;
}