compareSegments method
Draws two groups of lines in blue and red, counting the non overlapping (mismatching) pixels.
Parameters - size The size of the image, where lines1 and lines2 were found. - lines1 The first group of lines that needs to be drawn. It is visualized in blue color. - lines2 The second group of lines. They visualized in red color. - image Optional image, where the lines will be drawn. The image should be color(3-channel) in order for lines1 and lines2 to be drawn in the above mentioned colors.
Implementation
(int rval, Mat imageOut) compareSegments(
InputArray image,
(int, int) size,
VecVec4f lines1,
VecVec4f lines2, {
Mat? imageOut,
}) {
imageOut ??= Mat.empty();
final sz = size.toSize();
final prval = calloc<ffi.Int>();
cvRun(
() => cimgproc.cv_LineSegmentDetector_compareSegments(
ref,
sz.ref,
lines1.ref,
lines2.ref,
imageOut!.ref,
prval,
ffi.nullptr,
),
);
final rval = (prval.value, imageOut);
calloc.free(prval);
sz.dispose();
return rval;
}