mirror of
https://github.com/opencv/opencv.git
synced 2026-12-02 21:22:43 -06:00
Merge pull request #30977 from varun-jaiswal17/docs-5x-version-wording
documentation fix 5.0 to 5.x - #30977 Replace stale "OpenCV 5.0" current-version wording with "5.x" in the 5.x docs (landing page, sidebar, prebuilt-binaries and transition-guide tutorials) ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [ ] The PR is proposed to the proper branch - [ ] There is a reference to the original bug report and related work - [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [ ] The feature is well documented and sample code can be built with the project CMake
This commit is contained in:
@@ -12,7 +12,7 @@ Transition guide {#tutorial_transition_guide}
|
||||
|
||||
Changes overview {#tutorial_transition_overview}
|
||||
================
|
||||
This document is intended to software developers who want to migrate their code to OpenCV 5.0.
|
||||
This document is intended to software developers who want to migrate their code to OpenCV 5.x.
|
||||
|
||||
For the full list of breaking changes and porting notes, see
|
||||
[Learn more](https://github.com/opencv/opencv/wiki/OpenCV-4-to-5-migration).
|
||||
|
||||
@@ -12,7 +12,7 @@ Goal
|
||||
----
|
||||
|
||||
The objective of this tutorial is to show how to configure a local build environment to use
|
||||
pre-built OpenCV 5.0 binaries that are already present on your device.
|
||||
pre-built OpenCV 5.x binaries that are already present on your device.
|
||||
|
||||
By the end of this guide you will know how to reference, link, and use an existing OpenCV
|
||||
installation from your own C++ or Python application, without rebuilding the library from
|
||||
@@ -25,7 +25,7 @@ When OpenCV is installed via an installer, a system package manager (apt, Homebr
|
||||
or built into a local workspace directory, it exports configuration scripts that let build
|
||||
tools locate and link it automatically.
|
||||
|
||||
Because OpenCV 5.0 modernizes its build requirements, keep two things in mind:
|
||||
Because OpenCV 5.x modernizes its build requirements, keep two things in mind:
|
||||
|
||||
- **C++17 is required.** The library headers use modern language features, so your project
|
||||
must be compiled with the C++17 standard or higher.
|
||||
@@ -55,14 +55,14 @@ my_opencv_project/
|
||||
cmake_minimum_required(VERSION 3.22)
|
||||
project(OpenCV5_Local_Project)
|
||||
|
||||
# OpenCV 5.0 requires C++17
|
||||
# OpenCV 5.x requires C++17
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
# Locate the pre-built OpenCV installation. If CMake cannot find it
|
||||
# automatically, pass the path explicitly:
|
||||
# cmake -DOpenCV_DIR=/absolute/path/to/opencv/build/ ..
|
||||
find_package(OpenCV 5.0 REQUIRED)
|
||||
find_package(OpenCV 5 REQUIRED)
|
||||
|
||||
message(STATUS "Found OpenCV version: ${OpenCV_VERSION}")
|
||||
message(STATUS "OpenCV include directories: ${OpenCV_INCLUDE_DIRS}")
|
||||
@@ -142,6 +142,6 @@ Troubleshooting
|
||||
|
||||
- **CMake: "Could not find a package configuration file ..."** — CMake cannot locate
|
||||
the install. Pass the path explicitly: `cmake -DOpenCV_DIR=/path/to/opencv/build/ ..`
|
||||
- **Compiler: "OpenCV 5.0 requires C++17"** — the toolchain fell back to an older
|
||||
- **Compiler: "OpenCV 5.x requires C++17"** — the toolchain fell back to an older
|
||||
standard. Add `-std=c++17` to the g++ command, or `set(CMAKE_CXX_STANDARD 17)` before
|
||||
`find_package` in CMake.
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<nav class="page-toc" aria-label="{{ _('Resources') }}">
|
||||
<ul class="visible nav section-nav flex-column">
|
||||
<li class="toc-h2 nav-item toc-entry"><a class="reference external nav-link" href="https://github.com/opencv/opencv/wiki">OpenCV Wiki</a></li>
|
||||
<li class="toc-h2 nav-item toc-entry"><a class="reference external nav-link" href="https://github.com/opencv/opencv/wiki/OpenCV-5">What's new in 5.0</a></li>
|
||||
<li class="toc-h2 nav-item toc-entry"><a class="reference external nav-link" href="https://github.com/opencv/opencv/wiki/OpenCV-5">What's new in OpenCV 5.x</a></li>
|
||||
<li class="toc-h2 nav-item toc-entry"><a class="reference external nav-link" href="https://forum.opencv.org">Forum</a></li>
|
||||
<li class="toc-h2 nav-item toc-entry"><a class="reference external nav-link" href="https://stackoverflow.com/questions/tagged/opencv">Stack Overflow</a></li>
|
||||
<li class="toc-h2 nav-item toc-entry"><a class="reference external nav-link" href="https://github.com/opencv/opencv/issues">Issue tracker</a></li>
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
OpenCV (Open Source Computer Vision Library) is an open-source computer vision and machine learning software library. It has more than 2,500 optimised algorithms, a comprehensive mix of both classic and state-of-the-art computer vision and machine learning methods. These can be used to detect and recognise faces, identify objects, classify human actions in video, track camera and object motion, extract 3D models, stitch images together to produce high-resolution panoramas, and much more. The library has interfaces for C++, Python, Java, and JavaScript, runs on Windows, Linux, macOS, Android, and iOS, and accelerates work on CPU (SIMD), CUDA, OpenCL, and Vulkan.
|
||||
|
||||
OpenCV 5.0 is a major release built on OpenCV 4.x. C++17 is now the minimum required standard, Python 2 support has been dropped (Python 3.6+ is required), and the legacy C API has been fully removed. New data types (CV_16BF, CV_32U, CV_64U, CV_64S, CV_Bool) and proper 0D/1D array support extend the core, while the former calib3d module is split into the geometry, calib, stereo, and ptcloud modules. A next-generation DNN engine now covers over 80% of the ONNX specification (up from under 23%), with ONNX Runtime integration and models hosted on Hugging Face. Performance gains include Universal Intrinsics 2.0 (SSE/AVX/NEON/SVE/RISC-V), Vulkan compute support, image-warping speed-ups of 10% to over 300%, and USAC as the default framework for robust estimation.
|
||||
OpenCV 5 is the major version that follows OpenCV 4.x, starting with the 5.0 release. C++17 is the minimum required standard, Python 2 support has been dropped (Python 3.6+ is required), and the legacy C API has been fully removed. New data types (CV_16BF, CV_32U, CV_64U, CV_64S, CV_Bool) and proper 0D/1D array support extend the core, while the former calib3d module is split into the geometry, calib, stereo, and ptcloud modules. A next-generation DNN engine loads ONNX and TFLite models, with ONNX Runtime integration and models hosted on Hugging Face. As of OpenCV 5.1.0, OpenCV DNN scores 83.67% on the [ONNX Backend Scoreboard](https://onnx.ai/backend-scoreboard/) and supports 170 of the 205 ONNX operators (see the [OpenCV DNN details](https://onnx.ai/backend-scoreboard/opencv_details_stable.html)). Performance gains include Universal Intrinsics 2.0 (SSE/AVX/NEON/SVE/RISC-V), Vulkan compute support, image-warping speed-ups of 10% to over 300%, and USAC as the default framework for robust estimation.
|
||||
|
||||
OpenCV 5.1 builds on this foundation:
|
||||
|
||||
- **DNN:** the classic engine has been removed, so all models run on the new engine, which gains initial CUDA support and faster CPU inference. LLM and VLM support improved with KV-cache pre-allocation, quantized `MatMulNBits` models and WordPiece/Unigram tokenizers.
|
||||
- **Core:** NumPy-style broadcasting for element-wise operations, `cv::texpr` for fused element-wise expressions, FP8 data types and a complete N-D array API (`concat`, `split`, `slice`, `squeeze`, `unsqueeze` and more).
|
||||
- **Imgproc:** text rendering based on HarfBuzz for complex scripts, `cv::alphaComposite` and the Oklab color space; IPP is now called through the HAL.
|
||||
- **New functionality:** the `cv::XFeat` feature detector, the `cv::linearAssignment` solver, the `cv::viz3d` OpenGL visualizer with 3D Gaussian Splatting, and monocular visual odometry in `cv::slam`.
|
||||
- **Video I/O and platforms:** camera enumeration and encoder controls in `VideoWriter`, plus new optimizations for Windows on ARM and RISC-V.
|
||||
|
||||
See the [change log](https://github.com/opencv/opencv/wiki/OpenCV-Change-Logs#version510) for the full list of changes in 5.1, including the migration notes.
|
||||
|
||||
@@ -20,7 +20,7 @@ The engine performs automatic attention fusion: the `MatMul` → `Softmax` → `
|
||||
|
||||
`ENGINE_OPENCV` also introduces native support for Large Language Models and Vision-Language Models. Built-in tokenizers, attention layers, decoding blocks, and KV-caching allow models such as Qwen, Gemma, and PaliGemma to run end-to-end through the standard `Net` API, with no external runtime required.
|
||||
|
||||
In OpenCV 5.0, `ENGINE_OPENCV` runs on CPU only. Support for CUDA and other non-CPU backends is planned for a subsequent release. Users requiring GPU acceleration should use `ENGINE_ORT`.
|
||||
OpenCV 5.1 introduces initial GPU support for `ENGINE_OPENCV` through a CUDA backend. This work is still in progress: layer coverage and performance are being extended, and layers without a CUDA implementation run on CPU. In OpenCV 5.0 the new engine (then `ENGINE_NEW`) was CPU-only, and CUDA inference required the classic engine, which has since been removed. The CUDA backend is built when OpenCV is configured with CUDA, cuBLAS and either cuDNN (`WITH_CUDNN`) or the cuDNN graph API (`WITH_CUDNNJIT`). To try it, call `net.setPreferableBackend(DNN_BACKEND_CUDA)` and `net.setPreferableTarget(DNN_TARGET_CUDA)` or `DNN_TARGET_CUDA_FP16`.
|
||||
|
||||
@note The Darknet, Caffe and TensorFlow parsers have been removed in OpenCV 5; ONNX is the recommended format. TFLite models are still supported and are executed via `ENGINE_OPENCV`.
|
||||
|
||||
@@ -38,7 +38,7 @@ cmake -DWITH_ONNXRUNTIME=ON ..
|
||||
cmake -DWITH_ONNXRUNTIME=ON -DDOWNLOAD_ONNXRUNTIME_GPU=ON ..
|
||||
```
|
||||
|
||||
ORT execution providers are supported, including CUDA for NVIDIA hardware. This makes `ENGINE_ORT` the recommended choice for GPU-accelerated inference while native GPU support for `ENGINE_OPENCV` is still in development.
|
||||
ORT execution providers are supported, including CUDA for NVIDIA hardware. This makes `ENGINE_ORT` the recommended choice for GPU-accelerated inference while GPU support for `ENGINE_OPENCV` is still in development.
|
||||
|
||||
### Selecting an Engine
|
||||
|
||||
|
||||
Reference in New Issue
Block a user