-
Notifications
You must be signed in to change notification settings - Fork 41
OpenCV 3.0 compatibility (partly-done) #109
Description
This is probably another low-priority-until-its-suddenly-not kind of issue—there's a few small changes required to support OpenCV 3.0 (it's mostly very similar to 2.x but there's a few changes to APIs, and at least one library has been split).
Transition Guide from OpenCV here: http://docs.opencv.org/master/db/dfa/tutorial_transition_guide.html#gsc.tab=0
So far I've seen:
Algorithm classes need to be wrapped in cv::Ptr<>
e.g. cv::SimpleBlobDetector in imaging/cv_mat/filters.cpp and cv::StereoSGBM in imaging/stereo/point_cloud.cpp (its just plumbing not a major rewrite in these cases)
in imaging/stereo its a bit more complex, because boost_program_options is currently being used to write variables directly which are no longer exposed (they now need to be passed in on construction, not set post-construction), and there may be more that are blocked by those errors
cv::Ptr<> has been back-ported to 2.4.11 but not earlier versions, so may need some preprocessor testing of CV_MAJOR_VERSION == 2 vs 3 for true compatibility between OpenCV v2 and v3
cv:Mat::datastart is (now?) const
cv::Mat::datastart has been used in a lot of places as the start pointer for cv:Mat::data but it's (now?) const so you have to use cv::Mat::data instead for a writable data pointer. i haven't yet checked if the cv::Mat::data pointer exists in v2.x, but am assuming it'll also need some preprocessor testing for cross-compatibility
I had a go at it, but the imaging/stereo and related apps were beyond my skills/understanding/time-constraints (to be honest i'm not 100% sure i've fixed the others correctly, just as best i can tell from the docs—some member vars have changed names so its not clear if its a 1:1 mapping for StereoSBGM for example. Hopefully this is useful for someone to pick up when 3.0 compatibility is necessary