Repository navigation
Move to OpenCV 5.1; wrap ArUco and more modules - #105
Open
ViralBShah wants to merge 4 commits into
Open
ViralBShah wants to merge 4 commits into
ViralBShah wants to merge 4 commits into
Conversation
OpenCV 5 split calib3d into calib/geometry/stereo, renamed features2d to features, moved CascadeClassifier/HOGDescriptor and ml to opencv_contrib, and turned cv::MatShape into a class. Adapt the generator, and fix problems that predate 5.x: - gen_all.py maps each module to the headers it parses and searches main and contrib module roots; regenerate.jl fetches opencv_contrib too. - Non-literal defaults get C++ functions evaluated in their namespaces, and the Julia side calls them unless defval.txt maps them (unmapped defaults used to become `()`/`Int64()` or drop the keyword method). - Nested types are qualified and their flattened spellings declared; bases resolve through enclosing namespaces. - Classes handed out by cv::Ptr factories are held by Ptr, and constructors of Ptr-held classes return cv::Ptr, so both work with every method. - setproperty! covers CV_PROP_RW fields (it covered the read-only ones). - The module body is split into ~250-line functions; one function made GCC 10 run out of memory. - The dnn::Net methods taking MatShape, and 0-D/1-D Mats, are handled by hand. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Wrap ArUco/ChArUco (#42), the rest of objdetect, video, stitching, photo, ml, ximgproc, xphoto, tracking, optflow and xfeatures2d, plus the API new in 5.1 (dnn Tokenizer and KV cache, XFeat/DISK/ALIKED/LightGlue). Drop APIs removed in 5.x (TensorFlow/Caffe/Darknet/Torch importers, logPolar, convertFp16). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Mat type encoding: CV_CN_SHIFT 5 and CV_CN_MAX 128; Float16, Bool, UInt32, UInt64 and Int64 element types. - Version 5.0.0, compat OpenCV_jll/OpenCV_CUDA_jll 5.1. - Tests: YuNet (ONNX) replaces the TensorFlow face detector; new ArUco/ChArUco, per-module smoke, tracker, optical flow, QR, tokenizer and Mat round-trip tests. - Docs and README describe OpenCV 5.1 and the wrapped modules. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The single cv_core.cpp object exceeded the PE/COFF section limit on Windows
("cv_core.cpp.obj: file too big", on both i686 and x86_64 despite -mbig-obj).
Write each registration chunk to its own cv_core_partNN.cpp and compile all
cv_core*.cpp; cv_core.cpp calls the parts in order.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves OpenCV.jl to OpenCV 5.1 (released 2026-11-06) as version 5.0.0, and wraps ArUco/ChArUco (closes #42) along with many more modules.
Needs OpenCV_jll / OpenCV_CUDA_jll 5.1.0 from JuliaPackaging/Yggdrasil#15577, which builds
libopencv_juliafrom this branch'sgen/. CI here will fail until those are registered.What's wrapped
1,679 Julia functions, up from 602.
OpenCV.aruco): dictionaries,DetectorParameters,ArucoDetector, boards,CharucoDetector, drawing and marker generation.FaceDetectorYN, MCC).dnn.Tokenizer(Hugging Face BPE tokenizers), Net KV-cache control, and the XFeat/DISK/ALIKED/LightGlue learned features.Breaking
logPolar,linearPolarandconvertFp16are gone too.OpenCV.xfeatures2d.*.CV_CN_SHIFT3 → 5, at most 128 channels). Mats also gain Float16, Bool, UInt32, UInt64 and Int64 element types.Generator
OpenCV 5 needed generator changes, and several fix bugs that predate 5.x. Details are in
gen/PROVENANCE.md:gen_all.pymaps each module to the headers it parses, from both opencv and opencv_contrib.regenerate.jlnow fetches contrib too.()orInt64(), or drop the keyword method altogether.setproperty!now works forCV_PROP_RWfields. It used to cover only the read-only ones, calling setters that don't exist.cv::Ptrclasses: classes handed out bycv::Ptrfactories (Stitcher, the trackers,ml::TrainData) are now held by Ptr, and Algorithm constructors returncv::Ptr. Factory results and constructed objects now work with every method.MatShapeand small Mats:cv::MatShapeis now a class, so the fourdnn::Netmethods that take it are wrapped by hand. 0-D and 1-D Mats convert correctly.Testing
All of this was done locally on Linux x86_64 with
OpenCV_jll/OpenCV_CUDA_jll5.1.0 built and deployed from that recipe:@replblock pass.CUDA caveat. OpenCV 5.1's DNN only has the new engine. It runs a graph on the GPU only if every op has a CUDA kernel, and it inserts its own
TransformLayoutop, which has none. As a result, YuNet and ResNet-50 run entirely on the CPU even withDNN_BACKEND_CUDA; the log says "has no CUDA exec; running the whole graph on CPU". The CUDA build loads, finds CUDA 13 and cuDNN 9.28, and gives identical results, but the ~5× GPU speedup we had with 4.14 is gone. This is an upstream limitation.ENGINE_ORT(ONNX Runtime) could be a later path to GPU inference.Not covered: macOS, Windows and aarch64 builds; the Yggdrasil CI will be the first to build them. The new modules have smoke tests only.
🤖 Generated with Claude Code