Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where to get the matching information of apap matching points? #29

Open
NiaBie opened this issue Feb 23, 2020 · 0 comments
Open

Where to get the matching information of apap matching points? #29

NiaBie opened this issue Feb 23, 2020 · 0 comments

Comments

@NiaBie
Copy link

NiaBie commented Feb 23, 2020

I'm trying to get the information of matching points and their matches, just like the sample image in the paper.
I have tried using pairwise_matches but the matching seemed incorrectly:

    Mat img1 = images_data[m1].img;
    Mat img2 = images_data[m2].img;
    Mat result = Mat::zeros(max(img1.rows, img2.rows),
                            img1.cols + img2.cols,
                            CV_8UC3);
    // 分割矩阵
    Mat left (result, Rect(0, 0, img1.cols, img1.rows));
    Mat right(result, Rect(img1.cols, 0, img2.cols, img2.rows));
    // 复制矩阵
    img1.copyTo(left);
    img2.copyTo(right);
    for (int i = 0; i < pairwise_matches[pm_index].matches.size(); i ++) {
      int src  = pairwise_matches[pm_index].matches[i].queryIdx;
      int dest = pairwise_matches[pm_index].matches[i].trainIdx;

      Point2 src_p  = images_data[m1].mesh_2d->getVertices()[src];
      Point2 dest_p = images_data[m2].mesh_2d->getVertices()[dest];
      Scalar color(rand() % 256, rand() % 256, rand() % 256);
      circle(result, src_p, 3, color, -1);
      line(result, src_p, dest_p + Point2(img1.cols, 0), color, 1, LINE_AA);
      circle(result, dest_p + Point2(img1.cols, 0), 3, color, -1);
    }
    imwrite(parameter.debug_dir + "matching_points" + to_string(i) + ".png", result);

Could you tell me the right way to do this? Besides, how to display only the good matches(how to judge the quality of a match)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant