However, I was getting poorly aligned scans. So I started looking at debugInfo output and also using exampleHelperShowLineFeaturesInScan(s1, s2, debugInfo, initGuess); This generates the two scans with their lines marked with their corresponding indices. My example identifies 10 lines in each scan.
Now the displacement between these scans is very low, and it is very easy to see manually which scans should match and I can visually write a match hypothesis: which lines in currScan match which lines in refScan.
However, debugInfo.MatchHypothesis seems to generate hypotheses that just don't make sense. Based on my understanding, the only tunable parameters that would affect the match hypothesis are CompatibilityScale and LineMergeThreshold. My LineMergeThreshold is very low since the two scans are very close by.
But after playing around with these parameters for a few days, I have no idea why the match hypotheses generated are bad. It would be interesting to know the exact algorithm being used to generate these data associations and try to troubleshoot it. This function was only introduced in 2018 and does not have any forum posts. Any other suggestions are also appreciated, thanks!