LumiGuide / haskell-opencv

Haskell binding to OpenCV-3.x
Other
154 stars 44 forks source link

Port OpenCV.Extra.Tracking to OpenCV-3.3.0 #99

Closed basvandijk closed 6 years ago

basvandijk commented 7 years ago

The API of the OpenCV tracking module has changed between 3.2.0 and 3.3.0. Building the corresponding Haskell module results in the following errors:

src/OpenCV/Extra/Tracking.cpp: In function ‘Ptr_Tracker* inline_c_OpenCV_Extra_Tracking_0_efe6eac7c3946190981535cdf313473c4fadfc96(const char*)’:

src/OpenCV/Extra/Tracking.cpp:14:9: error:
     error: ‘create’ is not a member of ‘cv::Tracker’
             cv::Tracker::create ( cv::String(ctrackerType_27_inline_c_0));
             ^~
src/OpenCV/Extra/Tracking.cpp: In function ‘Ptr_MultiTracker* inline_c_OpenCV_Extra_Tracking_3_f3a6cc587d88595f175227bf695c32d2015f0e8d(const char*)’:

src/OpenCV/Extra/Tracking.cpp:49:68: error:
     error: no matching function for call to ‘cv::MultiTracker::MultiTracker(cv::String)’
           new cv::MultiTracker ( cv::String(ctrackerType_27_inline_c_0));
                                                                        ^

In file included from /nix/store/g42jnrpnx4rsra9nq6x6ysmqkghxjzv5-opencv-3.3.0/include/opencv2/tracking.hpp:304:0: error:
    0,
                     from src/OpenCV/Extra/Tracking.cpp:4:

/nix/store/g42jnrpnx4rsra9nq6x6ysmqkghxjzv5-opencv-3.3.0/include/opencv2/tracking/tracker.hpp:1312:11: error:
     note: candidate: cv::MultiTracker::MultiTracker()
       CV_WRAP MultiTracker();
               ^~~~~~~~~~~~

/nix/store/g42jnrpnx4rsra9nq6x6ysmqkghxjzv5-opencv-3.3.0/include/opencv2/tracking/tracker.hpp:1312:11: error:
     note:   candidate expects 0 arguments, 1 provided

/nix/store/g42jnrpnx4rsra9nq6x6ysmqkghxjzv5-opencv-3.3.0/include/opencv2/tracking/tracker.hpp:1305:20: error:
     note: candidate: cv::MultiTracker::MultiTracker(const cv::MultiTracker&)
     class CV_EXPORTS_W MultiTracker : public Algorithm
                        ^~~~~~~~~~~~

/nix/store/g42jnrpnx4rsra9nq6x6ysmqkghxjzv5-opencv-3.3.0/include/opencv2/tracking/tracker.hpp:1305:20: error:
     note:   no known conversion for argument 1 from ‘cv::String’ to ‘const cv::MultiTracker&’
`cc' failed in phase `C Compiler'. (Exit code: 1)

I disabled the module for now so that the rest can be build with OpenCV-3.3.0.

@tolysz do you have an opportunity to look into this?

tolysz commented 7 years ago

https://github.com/LumiGuide/haskell-opencv/pull/100 Fixes the compilation, and allows to track objects again.

tolysz commented 7 years ago

The basic support is back. The OpenCV library changed the usage a bit. If someone has time, there is a room for converting Trackers into a class (or something) as each tracker takes parameters of a different type. The new tracker uses some big blob so there is a rough edge there.