Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

ORB GPU random

Hi,

I use ORB GPU and I have some disturbing results. When I run multiples times my program on the same images I don't have the same results : not the same matches ... And I don't have this problem when I use ORB CPU ! Does ORB gpu have some sort of random in his code ?

Here is my code :

 (...)
    ORB_GPU orb(5000, 1.2f, 8, 31, 0, 2, 0, 31);
    orb.blurForDescriptor = true;
    GpuMat keypoints1GPU, keypoints2GPU;
    GpuMat descriptors1GPU, descriptors2GPU;

    orb(img, GpuMat(), keypoints1GPU, descriptors1GPU);

    orb(img_def, GpuMat(), keypoints2GPU, descriptors2GPU);

    //Correspondance
    vector<vector<DMatch> > matches;
    BruteForceMatcher_GPU<Hamming> matcher;
    matcher.knnMatch(descriptors1GPU, descriptors2GPU, matches, 1);

    vector<cv::DMatch> good_matches;

    for (int i = 0; i < matches.size(); ++i)
    {
        if (matches[i][0].distance < 50)
        {
            good_matches.push_back(matches[i][0]);
        }
    }

    if (good_matches.size() < 5)
    {
        retour << "Nombre de Good Matches insuffisants :" << good_matches.size() << endl;
        return stringstream_to_char(retour);
    }
    (...)