The use of createLineSegmentDetector and LineSegmentDetectorImpl above opencv4.0

In opencv4.0, due to the copyright relationship, the function interface of the LSD algorithm is canceled, resulting in the following error when using related functions:

lsd.cpp:143: error: (-213:The function/feature is not implemented)

And because in imgproc.hppthe file, the LSD algorithm of opencv3.3.1 and opencv4.0 versions are defined by the same class, class declaration, which ensures that the code can be compiled and passed. Therefore, one way is to go to the opencv official website to download the previous version, find the " lsd.cpp" file and put it in the corresponding directory of version 4.0. This is handy for windows users, but for linux users, recompiling is a bit of a hassle.

The other method is to create a new .hpp file under the corresponding cpp file, and put the code of the lsd algorithm into it. Obviously, the latter is more convenient. For the convenience of readers, I directly give the my_lsd.hpp file I wrote, just include it, and the corresponding createLineSegmentDetector is changed to mycreateLineSegmentDetector; LineSegmentDetectorImpl is changed to myLineSegmentDetectorImpl, and the same is true for the call:

/*M///
//
//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
//  By downloading, copying, installing or using the software you agree to this license.
//  If you do not agree to this license, do not download, install,
//  copy or use t

Guess you like

Origin blog.csdn.net/gwplovekimi/article/details/123926754