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

question about visual_match #9

Open
faithzxr opened this issue Oct 15, 2024 · 4 comments
Open

question about visual_match #9

faithzxr opened this issue Oct 15, 2024 · 4 comments

Comments

@faithzxr
Copy link

Hello, I would like to ask about the matching pairs in the two images. If we are using the "coarse" mode, what is the dimensionality of the patch_feature? Additionally, why is it patch_feature0[0] that is passed to the match_batch_tensor function instead of patch_feature0? Thank you.

您好,想问一下,如果对于两张图中的匹配对,如果是coarse这种模式,这个patch_feature是什么维度呢?为什么match_batch_tensor(patch_feature0[0], patch_feature1, img_size=(224,224))这里传进去的是,patch_feature0[0],为什么不是patch_feature0呢,谢谢。

@Lu-Feng
Copy link
Owner

Lu-Feng commented Oct 15, 2024

您好,match_batch_tensor()传入的第一个参数是单个查询图像的特征(需要去掉batch维度所以直接加了[0]),第二个参数是包含batch维度的数据集图像的特征。

@faithzxr
Copy link
Author

谢谢作者的及时回答,如果我想看两张图之间的匹配,我的的特征都是196*768,我传入的查询是(196,768),第二个我加了一个维度1相当于batch=1,即传进去的是(1,196,768)这样是对的嘛?

@Lu-Feng
Copy link
Owner

Lu-Feng commented Oct 15, 2024

是的。

@faithzxr
Copy link
Author

是的。

当inlier_keypoints_one = kps[idx1.cpu().numpy()]
inlier_keypoints_two = kps[idx2.cpu().numpy()]只有一对匹配对的时候,kp_all1.append(cv2.KeyPoint(inlier_keypoints_one[k, 0].astype(float), inlier_keypoints_one[k, 1].astype(float), 1, -1, 0, 0, -1))这一部分好像会报错,因为当只有一对点的时候,他是这种[152 104]一维的,但当是多对点的时候[[8 8] [24 8]]就是这种[[8 8] [24 8]]二维的就没问题,当是一对点的时候,我处理了一下,这样是对的嘛,还是我搞错了呢?

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

2 participants