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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] 2900 Move WunschLineMatcher to kornia.feature.matching #2909

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

lappemic
Copy link
Contributor

This PR builds on the discussions from #2900 and supersedes PR #2901 by integrating the WunschLineMatcher into kornia.feature.matching. I am proposing this update as a work-in-progress to gather initial feedback on the approach before finalizing.

Please review the approach and let me know if any modifications are required. Your feedback is highly appreciated.

In my understanding this would in the end work like this:

import torch
from kornia.feature.matching import WunschLineMatcher

# Example line segments and descriptors
line_seg1 = torch.tensor([[[0, 0], [1, 1]], [[1, 0], [0, 1]]], dtype=torch.float32)
line_seg2 = torch.tensor([[[0, 0], [1, 1]], [[1, 1], [0, 0]]], dtype=torch.float32)
desc1 = torch.randn(1, 256, 32, 32)
desc2 = torch.randn(1, 256, 32, 32)

# Initialize the matcher with default configuration
matcher = WunschLineMatcher()

# Find matches
matches = matcher(line_seg1, line_seg2, desc1, desc2)

print("Matches:", matches)

Expected output (example):

Matches: tensor([ 0, -1])

In this output:

  • 0 indicates that the first line segment in line_seg1 matches with the first line segment in line_seg2.
  • -1 indicates that the second line segment in line_seg1 has no valid match in line_seg2.

Type of change

  • 馃敩 New feature (non-breaking change which adds functionality)

@lappemic lappemic marked this pull request as draft May 16, 2024 12:47
@edgarriba edgarriba requested a review from ducha-aiki May 17, 2024 09:07
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

Successfully merging this pull request may close these issues.

None yet

1 participant