Skip to content

Bug fix visual sort voting logic #123

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rbezentrigo
Copy link

@rbezentrigo rbezentrigo commented May 28, 2025

Fixes in Visual Voting Logic

This PR addresses two critical issues in the visual association logic that caused suboptimal assignment of observations to tracks:

1. Fallback Matching for Non-Best Matches

Problem:

In the previous implementation of BestFitVoting, if multiple observations preferred the same track, only the highest-scoring one would be matched. All others were immediately assigned to themselves (fallback), even if they had other suitable — but slightly less optimal — track options.

Fix:

Introduced BestFitVotingWithFallback, which iterates through each observation’s ranked candidates and assigns it to the best available track. Only if none are available, it falls back to self-assignment.

2. Self-Assigned Observations Blocked Positional Voting

Problem:

Observations that failed to match any track via feature distance were assigned to themselves (to fulfill API expectations). These were mistakenly treated as “matched” and were excluded from the positional (geometry-based) assignment phase.

Fix:

Self-assigned observations are now filtered out from feature_winners, allowing them to continue into the positional voting stage. This enables geometry-based matching as a true fallback path.

Combined Result:

  • Observations now have a fairer chance of being matched to a valid track, even if their top match is already taken.
  • Observations without any strong feature match are no longer prematurely blocked from positional matching.

@bwsw
Copy link
Contributor

bwsw commented May 28, 2025

@rbezentrigo thank you for your PR, I will review it soon.

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.

2 participants