I have been working on an image stitching project using OpenCV 3.0. I use the findHomography function like so:
findHomography(imageOnePoints, imageTwoPoints, CV_RANSAC);
but when I try to compile my code, I am returned the following error messages:
stitch.cpp:111:75: error: ‘CV_RANSAC’ was not declared in this scope
Mat homographyMatrix = findHomography(imageOnePoints, imageTwoPoints, CV_RANSAC);
stitch.cpp:111:84: error: ‘findHomography’ was not declared in this scope
Mat homographyMatrix = findHomography(imageOnePoints, imageTwoPoints, CV_RANSAC);
I have already declared that I am using "namespace cv" so I do not need the preceeding "cv::". I am not sure what the problem is. Any advice on these errors would be greatly appreciated. Thank you!
It turns out the header file for findHomography
was missing:
#include "opencv2/calib3d/calib3d.hpp"
Latest OpenCV version, CV_RANSAC is renamed to RANSAC.
just use H = findHomography(ref, tst, RANSAC)
This should work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With