README.md 2.18 KB
Newer Older
1
## Repository for OpenCV's extra modules
Kirill Kornyakov's avatar
Kirill Kornyakov committed
2

3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
This repository is intended for development of so-called "extra" modules,
contributed functionality. New modules quite often do not have stable API,
and they are not well-tested. Thus, they shouldn't be released as a part of
official OpenCV distribution, since the library maintains binary compatibility,
and tries to provide decent performance and stability.

So, all the new modules should be developed separately, and published in the
`opencv_contrib` repository at first. Later, when the module matures and gains
popularity, it is moved to the central OpenCV repository, and the development team
provides production quality support for this module.

### How to build OpenCV with extra modules

You can build OpenCV, so it will include the modules from this repository.
Here is the CMake command for you:

```
$ cd <opencv_build_directory>
21
$ cmake -DOPENCV_EXTRA_MODULES_PATH=<opencv_contrib>/modules <opencv_source_directory>
22 23 24 25 26 27 28 29
$ make -j5
```

As the result, OpenCV will be built in the `<opencv_build_directory>` with all
modules from `opencv_contrib` repository. If you don't want all of the modules,
use CMake's `BUILD_opencv_*` options. Like in this example:

```
30 31
$ cmake -DOPENCV_EXTRA_MODULES_PATH=<opencv_contrib>/modules -DBUILD_opencv_legacy=OFF <opencv_source_directory>
```
Alexandre Benoit's avatar
Alexandre Benoit committed
32 33

If you prefer using the gui version of cmake (cmake-gui), then, you can add `opencv_contrib` modules within `opencv` core by doing the following:
Alexandre Benoit's avatar
Alexandre Benoit committed
34

Alexandre Benoit's avatar
Alexandre Benoit committed
35
1. start cmake-gui
Alexandre Benoit's avatar
Alexandre Benoit committed
36

Alexandre Benoit's avatar
Alexandre Benoit committed
37
2. select the opencv source code folder and the folder where binaries will be built (the 2 upper forms of the interface)
Alexandre Benoit's avatar
Alexandre Benoit committed
38

Alexandre Benoit's avatar
Alexandre Benoit committed
39
3. press the `configure` button. you will see all the opencv build parameters in the central interface
Alexandre Benoit's avatar
Alexandre Benoit committed
40

Alexandre Benoit's avatar
Alexandre Benoit committed
41
4. browse the parameters and look for the form called `OPENCV_EXTRA_MODULES_PATH` (use the search form to focus rapidly on it)
Alexandre Benoit's avatar
Alexandre Benoit committed
42

Alexandre Benoit's avatar
Alexandre Benoit committed
43
5. complete this `OPENCV_EXTRA_MODULES_PATH` by the proper pathname to the `<opencv_contrib>/modules` value using its browse button.
Alexandre Benoit's avatar
Alexandre Benoit committed
44

Alexandre Benoit's avatar
Alexandre Benoit committed
45
6. press the `configure` button followed by the `generate` button (the first time, you will be asked which makefile style to use)
Alexandre Benoit's avatar
Alexandre Benoit committed
46

Alexandre Benoit's avatar
Alexandre Benoit committed
47
7. build the `opencv` core with the method you chose (make and make install if you chose Unix makfile at step 6)