Skip to content

Commit

Permalink
fix matching across labels
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanPreibisch committed Aug 20, 2024
1 parent d9644f2 commit 8201c97
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -291,12 +291,24 @@ public static < V, I extends InterestPoint > List< Pair< Pair< V, V >, PairwiseR
final Map<String, ? extends List<I>> mapA = interestpoints.get( pair.getA() );
final Map<String, ? extends List<I>> mapB = interestpoints.get( pair.getB() );

final HashMap<String, String > compared = new HashMap<>();

for ( final String labelA : mapA.keySet() )
for ( final String labelB : mapB.keySet() )
{
if ( !matchAcrossLabels && !labelA.equals( labelB ) )
continue;

if ( compared.containsKey( labelA ) && compared.get( labelA ).equals( labelB ) )
continue;

// remember what we already compared
compared.put( labelA, labelB );

// for matchAcross also the inverse (A>B means we also did B>A)
if ( matchAcrossLabels && !labelA.equals( labelB ) )
compared.put( labelB, labelA );

final List< I > listA, listB;

if ( matcher.requiresInterestPointDuplication() )
Expand Down

0 comments on commit 8201c97

Please sign in to comment.