detect method
- InputArray image, {
- VecVec4f? lines,
- VecF64? width,
- VecF64? prec,
- VecF64? nfa,
Finds lines in the input image.
Parameters
-
image A grayscale (CV_8UC1) input image. If only a roi needs to be selected, use: lsd_ptr->detect(image(roi), lines, ...); lines += Scalar(roi.x, roi.y, roi.x, roi.y);
-
lines A vector of Vec4f elements specifying the beginning and ending point of a line. Where Vec4f is (x1, y1, x2, y2), point 1 is the start, point 2 - end. Returned lines are strictly oriented depending on the gradient.
-
width Vector of widths of the regions, where the lines are found. E.g. Width of line.
-
prec Vector of precisions with which the lines are found.
-
nfa Vector containing number of false alarms in the line region, with precision of 10%. The bigger the value, logarithmically better the detection.
-1 corresponds to 10 mean false alarms 0 corresponds to 1 mean false alarm 1 corresponds to 0.1 mean false alarms This vector will be calculated only when the objects type is LSD_REFINE_ADV.
Implementation
(VecVec4f lines, VecF64 width, VecF64 prec, VecF64 nfa) detect(
InputArray image, {
VecVec4f? lines,
VecF64? width,
VecF64? prec,
VecF64? nfa,
}) {
lines ??= VecVec4f(); // caller is still responsible for dispose-ing these values
width ??= VecF64();
prec ??= VecF64();
nfa ??= VecF64();
cvRun(
() => cimgproc.cv_LineSegmentDetector_detect(
ref,
image.ref,
lines!.ref,
width!.ref,
prec!.ref,
nfa!.ref,
ffi.nullptr,
),
);
final rval = (lines, width, prec, nfa);
return rval;
}