ORB GPU random

asked 2015-03-23 04:15:16 -0500

Whysùerhill gravatar image


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);

    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)

    if (good_matches.size() < 5)
        retour << "Nombre de Good Matches insuffisants :" << good_matches.size() << endl;
        return stringstream_to_char(retour);
edit retag flag offensive close merge delete


We're experiencing the same issue on opencv 2.4.11 it's rather worrying that the feature detection and descriptor computation is not repeatable whilst the CPU implementation is

eddiechum gravatar imageeddiechum ( 2016-03-18 17:46:37 -0500 )edit

Hi, it may interest you that I posted an issue and received some suggested changes that fixed this issue, it has not been merged back yet

eddiechum gravatar imageeddiechum ( 2016-05-13 03:37:48 -0500 )edit