image with similar significance to the hypothesis rectangle (i.e. similar 𝑛 and!𝑘)
29
. Rectangle hypotheses
are rejected if their NFA is below some threshold: 𝑁𝐹𝐴
!,!
𝑛, 𝑘 < 𝜖. Optionally, a refinement pass can
attempt to tune the rectangle hypotheses to minimize their NFA Figure 6-15e.
Using the cv::lineSegmentDetector Object
The LSD algorithm is implemented in OpenCV using the more contemporary style in which features of the
library are implemented as objects which hold their various parameters and thereafter provide an
algorithmic service by means of their member functions. The object which implements the LSD algorithm
is called cv::lineSegmentDetector. The following function creates one of these objects and returns
you a cv::Ptr<> to it:
cv::Ptr<LineSegmentDetector> cv::createLineSegmentDetector(
int refine = cv::LSD_REFINE_STD,
double scale = 0.8,
double sigma_scale = 0.6,
double quant = 2.0,
double ang_th = 22.5,
double log_eps = 0,
double density_th = 0.7,
int n_bins = 1024
);
You should first notice that every argument to this function has a default value. This is not an accident.
These values were determined by the designers of the LSD algorithm to be broadly optimal. As a result,
you are unlikely to want to change them. For experts (and the experimentally minded) however, we
describe them here.
The first argument ...