OpenCV: Open Source Computer Vision Library for C++, Python, and Java
OpenCV provides image processing, video analysis, object detection, camera calibration, and machine-learning algorithms through C++, Python, Java, and other language bindings.
At a glance
- What is it?
- OpenCV is an Apache-2.0 computer vision library with C++, Python, Java, and other language bindings. It covers image processing, video analysis, object detection, camera calibration, and machine learning, and is under active development as of its last push on 2026-09-28.
- Who is it for?
- OpenCV is the practical first choice for image and video processing pipelines in Python and C++, for robotics developers who need well-documented algorithms on resource-constrained hardware, and for any workflow that requires running existing deep learning models without a training framework. It is not the right tool for end-to-end model training, and it is slower to set up than MediaPipe for standardized perception tasks where MediaPipe has a pre-built solution.
- Can I use it commercially?
- Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository received new commits within the last day.
- What is it written in?
- Mainly C++, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on September 29, 2026, and from our analysis. They are not legal advice.
DEEP OPEN-SOURCE ANALYSIS
What OpenCV Solves and Who Uses It
OpenCV (Open Source Computer Vision Library) provides algorithms for image and video processing, object detection, camera calibration, and machine learning inference. Its scope covers operations on single images such as filtering, morphology, and color space conversion, as well as video analysis including optical flow and background subtraction. A dedicated DNN module supports running pre-trained deep learning models from frameworks such as TensorFlow, PyTorch, and ONNX.
The library targets three broad audiences. Computer vision researchers use it as a reference implementation and as a platform for rapid prototyping. Robotics and embedded developers use it for real-time processing on constrained hardware, including Raspberry Pi. Application developers who need image or video intelligence in a production system use the language bindings, most commonly Python via the `opencv-python` package or C++ for performance-sensitive pipelines.
Language Bindings and Build Structure
OpenCV's core is written in C++. The repository contains official bindings for Python, Java, and JavaScript (via WebAssembly), and the documentation mentions other language bindings. Python is the most widely used path to the library: the `opencv-python` package on PyPI installs prebuilt wheels that include the core modules and the extra `opencv-contrib-python` package adds community-contributed modules.
The repository is structured around a `modules/` directory that contains separate compilation units for each functional area: core, imgproc, videoio, highgui, dnn, features2d, and many others. The top-level `CMakeLists.txt` drives the build. Additional contributed functionality lives in the separate repository `opencv/opencv_contrib`. The `samples/` directory is organized by language and topic, with subdirectories for `cpp/`, `python/`, `java/`, `android/`, `opencl/`, `gpu/`, `dnn/`, and several others.
Installing OpenCV in Python and C++
The README points to the documentation at docs.opencv.org for installation guidance. For Python, the standard route is the `opencv-python` package on PyPI, which ships prebuilt binary wheels covering the core modules. The contributed modules are distributed separately as `opencv-contrib-python`. The README does not include the install commands directly; the full procedure is at docs.opencv.org/5.x/.
Building from source is required when a specific CMake configuration is needed, for example to enable CUDA acceleration or to link against a particular version of FFmpeg. The top-level `CMakeLists.txt` is the entry point for source builds. The `samples/` directory is organized by language, with subdirectories for `cpp/`, `python/`, `java/`, `android/`, `dnn/`, and others, each containing runnable examples.
Recent Releases: Parallel 4.x and 5.x Branches
As of the recent release history, OpenCV ships two concurrent lines. Version 4.14.0 was released on 2026-07-19 and version 5.0.0 was released on 2026-06-06. The repository's default branch is 4.x. Version 5 is a major release that includes API changes; the documentation at docs.opencv.org/5.x/ covers both the new APIs and migration notes.
The default branch (4.x) is the production-stable line for most existing codebases. Version 5 is the current major release. For new projects, checking which version the documentation covers and which packages are available on PyPI for the target Python version is the practical first step before choosing a version.
Core Use: Image Processing and the DNN Module
OpenCV's image processing functions operate on the `cv::Mat` type in C++ or NumPy arrays in Python. Color conversion, resizing, blurring, edge detection (Canny), contour finding, and feature detection (ORB, SIFT, SURF) are all available as documented function calls. The library documentation at docs.opencv.org provides API references and tutorials.
The DNN module loads pre-trained models and runs inference without requiring the framework that trained the model. It accepts ONNX, Caffe, TensorFlow frozen graphs, and Darknet formats. The `samples/dnn/` directory in the repository contains example scripts for object detection, face detection, semantic segmentation, and depth estimation. For object detection, models in YOLO format are a common combination with OpenCV's DNN module, though OpenCV provides only the inference side, not training.
Limitations and Cases Where OpenCV Is Not the Right Tool
OpenCV does not provide training for neural networks. It runs inference only. Teams that need to train custom models must use a framework such as PyTorch or TensorFlow, then export the trained model to ONNX or another format that OpenCV can consume.
The Python bindings expose most but not all of the C++ API. Some advanced functionality requires a C++ build. The binding generation is automated, and occasionally a function is available in C++ but not yet wrapped for Python.
Camera calibration and pose estimation functions require careful setup: the quality of results depends directly on the quality of the calibration images, the number of images, and the coverage of the camera's field of view. The library provides the algorithms but the methodology must be applied correctly. The documentation notes that incorrect calibration patterns or too few images produce unreliable intrinsic parameters.
OpenCV is also not a deep learning training framework or a data pipeline tool. For end-to-end machine learning workflows, libraries built around PyTorch or TensorFlow are more appropriate.
MediaPipe, YOLO, and Other Alternatives
MediaPipe is a Google-developed framework for building real-time perception pipelines. It ships pre-built solutions for pose estimation, hand tracking, face detection, and object detection. Unlike OpenCV, MediaPipe bundles both the models and the preprocessing logic, making it faster to reach a working demo. OpenCV is lower level: it provides the building blocks, and the developer assembles the pipeline. For standardized tasks where MediaPipe has a pre-built solution, it requires less code. For custom pipelines or platforms where MediaPipe is not available, OpenCV is the general-purpose choice.
YOLO is a family of object detection models, not a library. The comparison that comes up in search data asks whether to use YOLO or OpenCV, but these are not alternatives for the same task. OpenCV can run YOLO models through its DNN module; the two are complementary.
Maintenance and Licence
The repository is not archived. The last push was on 2026-09-28, and the project is under active development. OpenCV is released under the Apache-2.0 licence, which is permissive and compatible with both commercial and open source use. There are no licence implications for including the library in a proprietary product, though the specific terms of any third-party components included in the build should be checked separately.
The project accepts contributions following the guidelines in the CONTRIBUTING.md and SECURITY.md files. A community forum is available at forum.opencv.org. An OpenCV.ai consultancy provides professional services from the OpenCV team.
Editorial conclusion
OpenCV is the practical first choice for image and video processing pipelines in Python and C++, for robotics developers who need well-documented algorithms on resource-constrained hardware, and for any workflow that requires running existing deep learning models without a training framework. It is not the right tool for end-to-end model training, and it is slower to set up than MediaPipe for standardized perception tasks where MediaPipe has a pre-built solution. Before starting, confirm whether you need the core `opencv-python` package, the contributed modules via `opencv-contrib-python`, or a custom source build to enable hardware acceleration.
Frequently asked questions
How do you install OpenCV in Python?
The documentation at docs.opencv.org/5.x/ covers the full installation procedure. The standard Python path uses the `opencv-python` package for core modules, or `opencv-contrib-python` for the contributed modules. Building from source via CMake is required when custom compile-time options such as CUDA support are needed.
Is OpenCV still relevant?
OpenCV is under active development with a last push on 2026-09-28. It released version 5.0.0 in 2026 alongside the ongoing 4.x line. The library remains the standard for lower-level image processing and custom computer vision pipelines.
What is MediaPipe and how does it relate to OpenCV?
MediaPipe is a Google framework for real-time perception pipelines with pre-built solutions for pose estimation, hand tracking, and face detection. OpenCV is a lower-level library that provides the building blocks. They are often used together: MediaPipe for high-level tasks, OpenCV for custom preprocessing or post-processing.
Is OpenCV worth learning?
OpenCV covers image processing, video analysis, camera calibration, and DNN inference with bindings for Python, C++, and Java. It is the foundational library for computer vision in robotics, embedded systems, and research. The documentation at docs.opencv.org includes tutorials for all major language bindings.
How do you use OpenCV in Python to detect objects?
Load a pre-trained model using `cv2.dnn.readNet()` or a format-specific function such as `cv2.dnn.readNetFromONNX()`, prepare the input image with `cv2.dnn.blobFromImage()`, and run inference with `net.setInput()` and `net.forward()`. Example scripts are in the `samples/dnn/` directory of the repository.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/opencv-opencv)
Community notes