Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Here's how mine was added.

  1. Create a new folder in opencv_contrib/modules with the name of your new module.
  2. Add a file CmakeLists.txt
  3. To CMakeLists.txt make the first line: set(the_description "Descripton here")
  4. To CMakeLists.txt make the second line: set(OPENCV_MODULE_IS_PART_OF_WORLD OFF) or ON, if you want it included in Opencv_contrib_world
  5. The third line is: ocv_define_module(name dependencies WRAP python) name is the name of your module, and dependencies is the name of all the modules that must be compiled before your module is. ex: opencv_core opencv_imgproc opencv_calib3d....
  6. In the folder of your module, add folders include and src.
  7. Copy the existing .hpp and .cpp files from an existing module (I used saliency) and replace all the parts that actually do something with your own code.

Now, when you run cmake again, it should find your module and include it. The appropriate files are generated and everything works.