How to contribute

Version 11 (Daniil Osokin, 2014-07-14 06:01 pm)

1 1
h1. How to contribute
2 1
3 11 Daniil Osokin
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.
4 1
5 11 Daniil Osokin
h2. Overall process
6 1
7 11 Daniil Osokin
# You fork OpenCV, code and work on all prerequisites from below.
8 11 Daniil Osokin
# You make a pull request that is processed according to the process described below. Please provide timely response for reviewers, otherwise you submission could be postponed or even rejected.
9 11 Daniil Osokin
# Repeat from the beginning =)
10 11 Daniil Osokin
11 11 Daniil Osokin
Here is how pull requests are processed:
12 11 Daniil Osokin
!https://docs.google.com/drawings/pub?id=1_m7oVQ4CvoMxZn63N1_TyhhazmLLWY5uLEGUyPCERLo&w=960&h=720!
13 11 Daniil Osokin
14 11 Daniil Osokin
h2. Prerequisites
15 11 Daniil Osokin
16 11 Daniil Osokin
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.
17 11 Daniil Osokin
18 11 Daniil Osokin
> 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:
19 1
20 4 Daniil Osokin
# A prerequisite: is the algorithm patented? If yes, then we may not be that interested in putting it in.
21 4 Daniil Osokin
# License - the current license is fine, it's compatible with OpenCV.
22 4 Daniil Osokin
# Interface. Here some work is needed to make this code a seamless part of OpenCV.
23 4 Daniil Osokin
** @M_PI -> CV_PI@
24 4 Daniil Osokin
** You should remove all the static constants from the header. it's not portable and generally a bad practice. Use defines and enumerations.
25 4 Daniil Osokin
** 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.
26 4 Daniil Osokin
** "m_" in member names should be dropped, we do not this convention in OpenCV.
27 4 Daniil Osokin
# Implementation.
28 4 Daniil Osokin
** 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".
29 4 Daniil Osokin
** Avoiding duplication of existing OpenCV functionality. 
30 4 Daniil Osokin
** Writing to cerr should be replaced with CV_Error() calls.
31 4 Daniil Osokin
# Documentation.
32 4 Daniil Osokin
** 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.
33 4 Daniil Osokin
# You should provide sample code.
34 4 Daniil Osokin
** help() function should be added, check opencv/samples/cpp.
35 4 Daniil Osokin
# Regression tests - the code should include some regression tests.
36 4 Daniil Osokin
** Please, take a look at opencv/modules/features2d/test/test_features2d.cpp. You will need to add a similar test for your code.
37 4 Daniil Osokin
# Integration
38 9 Daniil Osokin
** Take the latest version of our repository or fork from our github mirror at https://github.com/Itseez/opencv/
39 9 Daniil Osokin
** Add your code
40 4 Daniil Osokin
** Insert documentation and add the test to the corresponding module
41 4 Daniil Osokin
** 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.
42 9 Daniil Osokin
** 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.