0

I am reading images from a set and extracting their features. However, for some images(very few, around 4 per mille), SiftFeatureDetector::detect( image, keypoints) cannot detect key points and returns me an empty set of key points. When I tried with SurfFeatureDetector::detect( image, keypoints), it detects the key points.

Here is the code:

    query = imread( it->path().string());

    /* Here, I resize the image in proportion so that its longest side will be 400*/

    cvtColor( query, query_gray, CV_RGB2GRAY);

    SiftFeatureDetector feature_detector;
    vector<KeyPoint> query_kp;
    feature_detector.detect( query_gray, query_kp);

    // check whether KeyPoints are detected
    if( !query_kp.size())
    {
        cerr << "KeyPoints couldn't be detected. Image " << it->path() << " is skipped." << endl;
        ++cantDetecteds;
        waitKey(0);
        continue;
    }

What is the reason behind this? Can someone explain please?

Thanks.

EDIT: Surf also cannot detect some key points , around 2 per mille.

4

0 回答 0