-
Notifications
You must be signed in to change notification settings - Fork 0
Migration OpenCV5
LucQuebec edited this page Jul 5, 2026
·
1 revision
In OpenCV 5.0, several modules moved from core to opencv_contrib. Since the
official Android AAR ships core only, 4.x code that used these will fail to
resolve on the 5.0 official AAR.
| 4.x core | 5.0 location | APIs |
|---|---|---|
| Classic ML |
ml (contrib) |
SVM, KNearest, DTrees, Boost, ANN_MLP, RTrees
|
| Haar / HOG |
xobjdetect (contrib) |
Haar CascadeClassifier, HOGDescriptor
|
| Graph API |
gapi (contrib) |
cv::gapi::* |
Core
objdetectstill has QR + DNN-based detection in 5.0; only the Haar/HOG paths moved toxobjdetect.
-
Unresolved reference/cannot find symbolfororg.opencv.ml.*,HOGDescriptor, Haar-basedCascadeClassifier. - Classifier XML files that no longer load.
- Drop the moved features (official AAR only).
- Rebuild the SDK with
opencv_contrib(slow, CMake/NDK pain). - Use OpenCV Pro — prebuilt core + contrib
for 5.0; your
ml/ Haar / HOG / G-API code resolves again with one Gradle line.
Full guide: docs/migration-opencv5.md.