Defining a new module in opencv_contrib

asked 2017-08-30 17:52:07 -0600

mihaibujanca gravatar image

Are there any guidelines on creating new modules in opencv_contrib?

I am trying to port my standalone project to a contrib module.

Most modules in contrib have a description and ocv_define_module(module_name [list of opencv modules used]), however I am met with various errors such as "Exporting the target is not allowed since its linker language cannot be determined" (normally fixed by project(NAME C CXX)). How is this dealt with when contributing to opencv?

edit retag flag offensive close merge delete

Comments

see plot module. it is a good prototype for beginning

sturkmen gravatar imagesturkmen ( 2017-08-30 18:20:59 -0600 )edit

@sturkmen Thanks for the suggestion - I have already checked a few of the other modules. There are a few things that are more complicated, I think and I'm not sure how to deal with - such as requiring C++11 only for my module (if I altered CMAKE_CXX_FLAGS inside my cmake file, that would be carried on to any other modules), or adding my Doxygen targets and my tests so that opencv builds them

mihaibujanca gravatar imagemihaibujanca ( 2017-08-30 18:38:15 -0600 )edit

I guess one of the following flags can help you to check if C++11 has been enabled: flag1 or flag2. You should make this a hard dependency and else force user to set it before building it. Best is to return an error in CMAKE config that it is missing and therefore your module is not build. Same happens with some modules that depend on CERES solver.

StevenPuttemans gravatar imageStevenPuttemans ( 2017-08-31 03:40:48 -0600 )edit