You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LucQuebec edited this page Jul 5, 2026
·
1 revision
Migration: OpenCV 4.x → 5.0
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.
Moved core → contrib
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 objdetect still has QR + DNN-based detection in 5.0; only the Haar/HOG
paths moved to xobjdetect.
Symptoms
Unresolved reference / cannot find symbol for org.opencv.ml.*,
HOGDescriptor, Haar-based CascadeClassifier.
Classifier XML files that no longer load.
Options
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.