« Previous - Version 8/52 (diff) - Next » - Current version
Daniil Osokin, 2014-07-14 06:01 pm


How to contribute

You can:
  1. Help others on forum.
  2. Provide feedback: report bugs, request features.
  3. Submit a code: create a ticket with the Patch tracker (issue type). Please note, that we're going to switch to pull requests from github. Here is the right project to fork: https://github.com/Itseez/opencv.
  4. Donate.
  5. Say thanks.

Below are some recommendations for contributors. They are raw, but can be used as a starting point for anybody who wants to see his code added to the library.

We would gladly accept such a contribution, but because of little resources available on our side, I would ask you to do all the preparations. Here is the checklist, including both generic items and the specific things related to your code that I found after brief inspection:

  1. A prerequisite: is the algorithm patented? If yes, then we may not be that interested in putting it in.
  2. License - the current license is fine, it's compatible with OpenCV.
  3. Interface. Here some work is needed to make this code a seamless part of OpenCV.
    • M_PI -> CV_PI
    • You should remove all the static constants from the header. it's not portable and generally a bad practice. Use defines and enumerations.
    • cv:: and std:: should not be used in the header, since all the stuff is already inside cv namespace and we already have "using std::vector", "using std::string" directives.
    • "m_" in member names should be dropped, we do not this convention in OpenCV.
  4. Implementation.
    • The code should be portable, it should compile fine on ARM too, for example. Therefore, you should not use SSE2 intrinsics outside of conditional compilation. Instead of "#ifdef USE_SSE" you should use "#if CV_SSE2".
    • Avoiding duplication of existing OpenCV functionality.
    • Writing to cerr should be replaced with CV_Error() calls.
  5. Documentation.
  6. You should provide sample code.
    • help() function should be added, check opencv/samples/cpp.
  7. Regression tests - the code should include some regression tests.
    • Please, take a look at opencv/modules/features2d/test/test_features2d.cpp. You will need to add a similar test for your code.
  8. Integration
    • Take the latest snapshot of the SVN trunk
    • Add your code to the snaphot
    • Insert documentation and add the test to the corresponding module
    • Build OpenCV, run tests. If you have access to both Linux and Windows - great! Sometimes GCC-approved code does not built with MSVC and vice versa.
    • Create patch file and either send it to me by e-mail or submit it as patch at code.opencv.org.