Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
O

opencv_contrib

> 编程语言
Open source

Repository for OpenCV's extra modules

10.2K stars0 likes2 views
WebsiteGitHub

About

Repository for OpenCV's extra modules

Repository for OpenCV's extra modules

This repository is intended for the 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 the 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. Contrib modules are under constant development and it is recommended to use them alongside the master branch or latest releases of OpenCV.

Here is the CMake command for you:

$ cd <opencv_build_directory>
$ cmake -DOPENCV_EXTRA_MODULES_PATH=<opencv_contrib>/modules <opencv_source_directory>
$ 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:

$ cmake -DOPENCV_EXTRA_MODULES_PATH=<opencv_contrib>/modules -DBUILD_opencv_legacy=OFF <opencv_source_directory>

If you also want to build the samples from the "samples" folder of each module, also include the "-DBUILD_EXAMPLES=ON" option.

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:

  1. Start cmake-gui.

  2. Select the opencv source code folder and the folder where binaries will be built (the 2 upper forms of the interface).

  3. Press the configure button. You will see all the opencv build parameters in the central interface.

  4. Browse the parameters and look for the form called OPENCV_EXTRA_MODULES_PATH (use the search form to focus rapidly on it).

  5. Complete this OPENCV_EXTRA_MODULES_PATH by the proper pathname to the <opencv_contrib>/modules value using its browse button.

  6. Press the configure button followed by the generate button (the first time, you will be asked which makefile style to use).

  7. Build the opencv core with the method you chose (make and make install if you chose Unix makefile at step 6).

  8. To run, linker flags to contrib modules will need to be added to use them in your code/IDE. For example to use the aruco module, "-lopencv_aruco" flag will be added.

Update the repository documentation

In order to keep a clean overview containing all contributed modules, the following files need to be created/adapted:

  1. Update the README.md file under the modules folder. Here, you add your model with a single-line description.

  2. Add a README.md inside your own module folder. This README explains which functionality (separate functions) is available, links to the corresponding samples, and explains in somewhat more detail what the module is expected to do. If any extra requirements are needed to build the module without problems, add them here also.

Issues· 728 open

View all issuesOpen on GitHub
  • #4209

    cudaimgproc: cuda::demosaicing (and cuda::cvtColor with Bayer codes) on a GpuMat ROI whose x offset is not a multiple of 4 (8U) / 2 (16U) pixels fails with a sticky "misaligned address" CUDA error

    Updated Sep 21, 2026
  • #3879

    EMD L1 interpreting every input matrix as 1-dimensional data

    Updated Sep 16, 2026
  • #4153

    CUDA SeparableLinearFilter might fail because of too large grid dimensions

    Updated Sep 10, 2026
  • #4213

    cudaarithm: cuda::multiply / sqr compute the 16U product in int and do not saturate (65535*65535 = 0); a 32S product with dtype=CV_32F is wrapped too

    Updated Sep 8, 2026
  • #4212

    cudaarithm: cuda::abs does not saturate the most negative 8S/16S/32S value (abs(-128) = -128), and cuda::norm(NORM_INF) can return 0 or a negative value for such inputs

    Updated Sep 8, 2026
  • #4211

    cudaarithm: bitwise_and/or/xor/not on a GpuMat ROI whose data pointer is not 4-byte (2-byte) aligned fail with a sticky "misaligned address" CUDA error

    Updated Sep 8, 2026
  • #4210

    cudaimgproc: calcHist / histEven / equalizeHist on a GpuMat ROI with x offset > 4 count pixels outside the ROI (the offsetX handling from #3475 only works for offsets 0..4)

    Updated Sep 8, 2026
  • #4207

    EdgeDrawing::ValidateCircles() reads an uninitialised ellipse point for odd perimeters

    Updated Sep 2, 2026
  • #3429

    EdgeDrawing segmentation fault

    bugcategory: ximgprocUpdated Sep 2, 2026
  • #4203

    EdgeDrawing::detectEllipses() modifies the caller's input image when Params::Sigma < 1.0

    Updated Sep 2, 2026

> Tags

C++opencv

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 29, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言