I have the following code
cv::initModule_nonfree();
std::vector<cv::KeyPoint> keypoints_1;
cv::Ptr<cv::FeatureDetector> detector = cv::FeatureDetector::create("SURF");
cv::Mat image = cv::imread("someFileNameHere",cv::IMREAD_COLOR);
// image.data is true, cv::imshow() dispalys the image
detector->detect(image, keypoints_1); // seg fault here
What can be the reason of the seg fault? I tried running gdb on it with hope that the library has enough meta data, but the stack ends at the call to detect()
imread
? You include a filename in your code? I think openCV fails ungracefully if you don't give a filename for imread. The other reason could be that you needcv::detect
instead ofdetect
. – Tellurizedetector.empty()
(yes, with a dot, not pointer) – Bedspreaddetector->empty()
and(*detector).empty()
– Riyadhxfeatured2d
I get an error thatxfeature2d is not a namespace of cv::
– Riyadh