Ask Your Question

Revision history [back]

How to contribute an optimised LineSegmentDetector Algorithm?

Hello,

colleagues of mine implemented had developed this optimised LSD i an seperate project and we want to contribute an this version of the LineSegmentDetector algorithm back to the community. I'm in charge to bring this version of the Algorithm back into the OpenCV Repository via a PullRequest. I started with http://code.opencv.org/projects/opencv/wiki/How_to_contribute and cloned the repository in order to add the hopefully optimised Algorithm.

But i ran into Problems while trying to add the "new" LSD-Algorithm into the module "imgproc" where the "old" one resides. The new Algorithm needs to be compiled with "-std=c++11", but the OpenCV project isn't. That's because i'm running into errors.

In my Sandbox the files containing the optimised Algorithm are compiled as follows:

project( lsd_back_newImpl CXX )
cmake_minimum_required(VERSION 2.8)
set (CMAKE_CXX_COMPILER "g++")
set( CMAKE_CXX_FLAGS "-std=c++11 -Wall -pthread -Os -s" )

add_library( lsd_back_newImpl SHARED lsd_back_newImpl )
set_target_properties( lsd_back_newImpl PROPERTIES LINKER_LANGUAGE CXX )

This way i get a shared library that i could probably use from the opencv library compiled without -std=C++11.

In first place, i put the lsd_new.cpp into the modules/imgproc/src directory. If i put the lsd_back_newImpl.cpp to modules/imgproc/src it will be automatically compiled, but without the compile flag "-std=C++11".

The CMakeLists.txt of modules/imgproc "only" contains

set(the_description "Image Processing")
ocv_define_module(imgproc opencv_core WRAP java python)

How would i accomplish to compile all files in imgproc/* like before, except the lsd_new.cpp file and instead compiling this file with the different Compiler_Flags in order to add a shared library that is compiled with the required flags?

How to contribute an optimised LineSegmentDetector Algorithm?

Hello,

colleagues of mine implemented had developed this optimised LSD i an in a seperate project and we want to contribute an this version of the LineSegmentDetector algorithm back to the community. I'm in charge to bring this version of the Algorithm back into the OpenCV Repository via a PullRequest. I started with http://code.opencv.org/projects/opencv/wiki/How_to_contribute and cloned the repository in order to add the hopefully optimised Algorithm.

But i ran into Problems while trying to add the "new" LSD-Algorithm into the module "imgproc" where the "old" one resides. The new Algorithm needs to be compiled with "-std=c++11", but the OpenCV project isn't. That's because i'm running into errors.

In my Sandbox the files containing the optimised Algorithm are compiled as follows:

project( lsd_back_newImpl CXX )
cmake_minimum_required(VERSION 2.8)
set (CMAKE_CXX_COMPILER "g++")
set( CMAKE_CXX_FLAGS "-std=c++11 -Wall -pthread -Os -s" )

add_library( lsd_back_newImpl SHARED lsd_back_newImpl )
set_target_properties( lsd_back_newImpl PROPERTIES LINKER_LANGUAGE CXX )

This way i get a shared library that i could probably use from the opencv library compiled without -std=C++11.

In first place, i put the lsd_new.cpp into the modules/imgproc/src directory. If i put the lsd_back_newImpl.cpp to modules/imgproc/src it will be automatically compiled, but without the compile flag "-std=C++11".

The CMakeLists.txt of modules/imgproc "only" contains

set(the_description "Image Processing")
ocv_define_module(imgproc opencv_core WRAP java python)

How would i accomplish to compile all files in imgproc/* like before, except the lsd_new.cpp file and instead compiling this file with the different Compiler_Flags in order to add a shared library that is compiled with the required flags?