How to contribute
Version 11 (Kirill Kornyakov, 2014-07-14 06:01 pm) → Version 12/52 (Daniil Osokin, 2014-07-14 06:01 pm)
h1. How to contribute
We suppose that you've seen the http://opencv.org/contribute.html page, and want to share some code. If so, good news for you, OpenCV project now has a mirror on the GitHub! And if you're familiar with that hosting, you can contribute in a familiar and friendly way. So, the preferred way to propose your code is to create a pull request on the GitHub. This way it will be automatically tested and reviewed: http://pullrequest.opencv.org. Here is the right project to fork: https://github.com/itseez/opencv.
h2. Overall process
OpenCV uses "Fork & Pull model" for code contribution:
# Create your You fork of OpenCV repository: https://github.com/Itseez/opencv (see https://help.github.com/articles/fork-a-repo for details).
# Code OpenCV, code and work, according to work on all prerequisites from below.
# When you are done, create You make a pull request with your commits (see https://help.github.com/articles/using-pull-requests for details). Choose the right "base branch" onto pull request will be applied.
OpenCV has three different branch for development:
# "current major version" (right now it's "2.4") - used for the next minor releases of OpenCV (e.g. 2.4.3, 2.4.4, etc). This branch that is good for contributing performance optimizations, bugfixes, new functionality. But note, it can contain only binary compatible with current major version changes.
# "master" - used for processed according to the future major releases of OpenCV. It can contain binary incompatible with current major version changes.
# "cuda-dev" - used by OpenCV for CUDA developers.
Pull request testing and merging with OpenCV:
# Your pull request will be automatically tested by OpenCV's buildbot (testing status see here: http://pullrequest.opencv.org). If any builders are failed, you should fix the issue.
# When all builders are green, one of OpenCV developers will review your code. Reviewer could ask you to modify your pull request. process described below. Please provide timely response for reviewers, otherwise you submission could be postponed or even rejected.
# Repeat from the beginning =)
Here is how pull requests are processed:
!https://docs.google.com/drawings/pub?id=1_m7oVQ4CvoMxZn63N1_TyhhazmLLWY5uLEGUyPCERLo&w=960&h=720!
h2. Prerequisites
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:
# A prerequisite: is the algorithm patented? If yes, then we may not be that interested in putting it in.
# License - the current license is fine, it's compatible with OpenCV.
# 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.
# 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.
# Documentation.
** Documentation in RST format should be provided for the functionality. Check http://docs.opencv.org/modules/features2d/doc/feature_detection_and_description.html#orb as example.
# You should provide sample code.
** help() function should be added, check opencv/samples/cpp.
# 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.
# Integration
** Take the latest version of our repository or fork from our github mirror at https://github.com/Itseez/opencv/
** Add your code
** 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 pull request on github.com or create patch file or and submit it as patch at http://code.opencv.org/projects/opencv/issues/new.
We suppose that you've seen the http://opencv.org/contribute.html page, and want to share some code. If so, good news for you, OpenCV project now has a mirror on the GitHub! And if you're familiar with that hosting, you can contribute in a familiar and friendly way. So, the preferred way to propose your code is to create a pull request on the GitHub. This way it will be automatically tested and reviewed: http://pullrequest.opencv.org. Here is the right project to fork: https://github.com/itseez/opencv.
h2. Overall process
OpenCV uses "Fork & Pull model" for code contribution:
# Create your You fork of OpenCV repository: https://github.com/Itseez/opencv (see https://help.github.com/articles/fork-a-repo for details).
# Code OpenCV, code and work, according to work on all prerequisites from below.
# When you are done, create You make a pull request with your commits (see https://help.github.com/articles/using-pull-requests for details). Choose the right "base branch" onto pull request will be applied.
OpenCV has three different branch for development:
# "current major version" (right now it's "2.4") - used for the next minor releases of OpenCV (e.g. 2.4.3, 2.4.4, etc). This branch that is good for contributing performance optimizations, bugfixes, new functionality. But note, it can contain only binary compatible with current major version changes.
# "master" - used for processed according to the future major releases of OpenCV. It can contain binary incompatible with current major version changes.
# "cuda-dev" - used by OpenCV for CUDA developers.
Pull request testing and merging with OpenCV:
# Your pull request will be automatically tested by OpenCV's buildbot (testing status see here: http://pullrequest.opencv.org). If any builders are failed, you should fix the issue.
# When all builders are green, one of OpenCV developers will review your code. Reviewer could ask you to modify your pull request. process described below. Please provide timely response for reviewers, otherwise you submission could be postponed or even rejected.
# Repeat from the beginning =)
Here is how pull requests are processed:
!https://docs.google.com/drawings/pub?id=1_m7oVQ4CvoMxZn63N1_TyhhazmLLWY5uLEGUyPCERLo&w=960&h=720!
h2. Prerequisites
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:
# A prerequisite: is the algorithm patented? If yes, then we may not be that interested in putting it in.
# License - the current license is fine, it's compatible with OpenCV.
# 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.
# 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.
# Documentation.
** Documentation in RST format should be provided for the functionality. Check http://docs.opencv.org/modules/features2d/doc/feature_detection_and_description.html#orb as example.
# You should provide sample code.
** help() function should be added, check opencv/samples/cpp.
# 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.
# Integration
** Take the latest version of our repository or fork from our github mirror at https://github.com/Itseez/opencv/
** Add your code
** 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 pull request on github.com or create patch file or and submit it as patch at http://code.opencv.org/projects/opencv/issues/new.