error: ‘SurfFeatureDetector’ is not a member of ‘cv’
I'm trying to work out how to use OpenCV on ROS.
I've gone through the cv_bridge tutorial and understand how to convert to the sensor_msgs::Image to the format used by OpenCV, in order to use the image with OpenCV libraries, and convert it back to sensor_msgs::Image. And by the cv::circle and cv::NamedWindow examples in the cv_bridge tutorial, I assumed that I can use the algorithms in the OpenCV documentation by referring to the cv namespace.
So I decided to write a simple program to try out the feature detector algorithms in OpenCV, referring to http://docs.opencv.org/doc/tutorials/features2d/feature_detection/feature_detection.html. And got to this point:
#include <ros/ros.h>
#include <image_transport/image_transport.h>
#include <cv_bridge/cv_bridge.h>
#include <sensor_msgs/image_encodings.h>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/features2d/features2d.hpp>
#include <opencv2/highgui/highgui.hpp>
int main(int argc, char** argv)
{
ros::init(argc, argv, "panda");
cv::Mat image;
image = cv::imread(argv[1], 0);
int minHessian = 400;
cv::SurfFeatureDetector detector( minHessian );
while(ros::ok())
{
cv::namedWindow( "Display window");
cv::imshow( "Display window", image );
cv::waitKey(3);
}
return 0;
}
But I got an error:
error: ‘SurfFeatureDetector’ is not a member of ‘cv’
It works with the cv::SurfFeatureDetector line commented out. I'm stuck at that point. I don't think I'm missing any headers. Any help?
Please and thank you.