lsd_lines_extraction.cpp (opencv_contrib) [closed]

asked 2017-07-27 07:18:22 -0500

updated 2017-09-13 11:31:16 -0500

Hi, i compiled OpenCV and Contrib with examples. ( Windows -Visual Studio 2015 )

when i try to run lsd_lines_extraction.cpp i get "OpenCV was built without features2d module"

i modified line 44 #ifdef HAVE_OPENCV_FEATURES2D -> #if 1 and solved the problem.

the question is why i needed to modify the source ? probably i am doing something wrong in cmake or Visual Studio but maybe someone lead me to find my way.

thank you in advance

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by sturkmen
close date 2017-09-13 11:31:36.277365


though i think, the ifdef shouldnt be there in the 1st place, HAVE_OPENCV_FEATURES2D is defined (or not) in opencv_modules.hpp, which should be in your install/includes/opencv2 folder

oh, can you check, which include paths are generated for the sample there ? it probably cannot access the opencv_modules header from there !

berak gravatar imageberak ( 2017-07-27 07:50:52 -0500 )edit

hi @berak, do you have line_descriptor-example-lsd_lines_extraction.exe what happens when you run it?

sturkmen gravatar imagesturkmen ( 2017-07-27 08:07:20 -0500 )edit

whole module did not compile for some reason(mingw), will have to try again, and see. (but i guess, it all depends on how you build the sample)

berak gravatar imageberak ( 2017-07-27 08:17:33 -0500 )edit

don't waste your time :) maybe @LBerger will try it. i am sure he has line_descriptor-example-lsd_lines_extraction.exe

sturkmen gravatar imagesturkmen ( 2017-07-27 08:21:16 -0500 )edit
berak gravatar imageberak ( 2017-07-27 08:26:14 -0500 )edit

bingo! thank you..

sturkmen gravatar imagesturkmen ( 2017-07-27 08:34:26 -0500 )edit

and: at builttime of the samples, there is no install folder , heh (the samples are actually part of the install)

so the opencv_modules.hpp is in build/opencv2, that needs to be on your include path for the sample

berak gravatar imageberak ( 2017-07-27 08:36:25 -0500 )edit

i see better now.

sturkmen gravatar imagesturkmen ( 2017-07-27 08:38:22 -0500 )edit

move line 44 to 46

LBerger gravatar imageLBerger ( 2017-07-27 09:29:39 -0500 )edit

hi @LBerger yes it solves the problem. thank you :) maybe you will provide a PR

sturkmen gravatar imagesturkmen ( 2017-07-27 09:29:44 -0500 )edit