i try to get SURF descriptor with OpenCV 2.4.6.0, but FeatureDetector object cannot be specified SURF parameters. using FeatureDetector object, I can get descriptors Mat, then it contains unkown data.
i.e. -431602080.
about 35000's above data is contained in descriptors Mat. code is below,
void getDescriptors(char* image) {
///// load image
cv::Mat img = cv::imread(image, CV_LOAD_IMAGE_GRAYSCALE);
if(img.empty()) return;
///// detect keypoints /////
cv::vector<cv::KeyPoint> keyPoints; // keypoint vector
// create feature detector
cv::Ptr<cv::FeatureDetector> detector = cv::FeatureDetector::create("SURF");
if(detector.empty()) return;
// detect key points (feature point)
detector->detect(image, keyPoints);
///// compute descriptors /////
cv::Mat descriptor; // descriptors mat
// create descriptor extractor
cv::Ptr<cv::DescriptorExtractor> extractor = cv::DescriptorExtractor::create(method);
if(extractor.empty()) return;
// compute descriptor
extractor->compute(image, keyPoints, descriptor);
return descriptor;
}