I am trying to match two contours with the matchShapes method but I always get assertion failed.
I know this must have something to do with the wrong Mat format but I can’t seem to be able to solve it.
The findContours is working very well:
vector<vector<cv::Point> > contours;
cv::findContours(incomingimage,
contours,
CV_RETR_EXTERNAL,
CV_CHAIN_APPROX_SIMPLE);
vector<vector<cv::Point> > contourstwo;
cv::findContours(incomingimagetwo,
contourstwo,
CV_RETR_EXTERNAL,
CV_CHAIN_APPROX_SIMPLE);
I get good output from these methods but then
matchShapes(Mat(contours), Mat(contourstwo), CV_CONTOURS_MATCH_I3, 0);
returns
OpenCV Error: Assertion failed
I am a bit in the dark here.
Any help would be highly appreciated.
Thank you very much.
I’m also beginner at openCV, but I just figure out how to solve this today
(after many trial and error).
Please try this one