RoMa icon indicating copy to clipboard operation
RoMa copied to clipboard

dedode or Dad + Roma match_keypoint

Open Bin-ze opened this issue 5 months ago • 0 comments

I want to use dad and dedode for feature extraction, and then use roma for feature point matching to achieve more robust matching and help downstream sfm tasks.

Now I integrated dedode + dual_softmax_match into my sfm framework and verified its correctness. Then I used roma instead of dualsoftmax to obtain the matching relationship between the two images. My code:


        imA_path, imB_path = data['image_path0'][0], data['image_path1'][0]
        x_A, x_B = data['keypoints0'], data['keypoints1']

        H_A, W_A = data["image0"].shape[2:]
        H_B, W_B = data["image1"].shape[2:]
        # to normlize 
        x_A, x_B = self.net.to_normalized_coordinates((x_A, x_B), H_A, W_A, H_B, W_B)
                
        # Match
        warp, certainty = self.net.match(imA_path, imB_path)
        
        # Sample matches for estimation
        # matches, _ = self.net.sample(warp, certainty, num=1000)
        # Convert to pixel coordinates (RoMa produces matches in [-1,1]x[-1,1])
        # kptsA, kptsB = self.net.to_pixel_coordinates(matches, H_A, W_A, H_B, W_B)
        # draw_matches_from_path(imA_path, imB_path, kptsA.cpu().numpy(),  kptsB.cpu().numpy(), './a.jpg')
        
        inds_A, inds_B = self.net.match_keypoints(x_A[0], x_B[0], warp, certainty, return_inds = True)


I use match_keypoints to match directly, but I find the result is very wrong

keypoint map:

Image

keypoints matching map:

Image

self.net.match map:

Image

What I have done:

  • Looked at the relevant isues discussion and noted possible problems
  • Normalized the left side of the key point to -1 - 1

Now how do I proceed?

Bin-ze avatar May 07 '25 03:05 Bin-ze