How opencv/opencv_contrib works
Overall Project Structure and Purpose
• The repository is intended to collect “extra” modules that contribute functionality not yet added to the core OpenCV. Modules may be experimental or maturing and are integrated via a CMake build process.
• The repository is structured with individual modules located in the “modules” folder. Each module has its own subdirectories for source code (src), headers (include), documentation (doc), samples, tests, and sometimes configuration files such as CMakeLists.txt.
Main Components
a. OpenCV Build Integration:
– Represent a central “OpenCV Core” (or main OpenCV repository) that “includes” the extra modules via the CMake parameter OPENCV_EXTRA_MODULES_PATH.
b. Contrib Modules Collection:
– Show a large container labeled “Extra Modules” or “Contrib Modules” which houses many modular components (for example, aruco, bioinspired, bgsegm, etc.). You may choose to group them if desired (or simply list a few representative module blocks) to reflect their independently developed nature.
– For each module, show sub-components: source, header files, documentation, samples, and tests.
c. Samples and Tests:
– Indicate a “Samples” component at the top level (and within individual modules) that demonstrates usage.
– Include “Tests” components that validate each module’s functionality.
d. Optional Dependencies and Build Options:
– Include a component for “CMake Configuration” which takes parameters such as OPENCV_EXTRA_MODULES_PATH and BUILD_EXAMPLES. This illustrates that the extra modules are only included if provided properly during the configuration process.
– Mention that some modules might rely on external dependencies (e.g., other libraries, optional modules) and may have separate build options (like BUILD_opencv_legacy).
Architectural Relationships and Data Flow
• Dependency lines from individual modules to the OpenCV Core indicating that these modules extend or rely on core computer vision routines.
• Optionally, if modules share sample applications or tests, show communication flows among “Module Samples” and “Test Suites.”