Ransac - possible bug in calculation of 'N' if pInlier = 0 #286
Comments
Hi there! Thanks a lot for reporting the issue! Do you think you could provide a simple test case that triggers the problem? You can just design a dummy distances function that returns 0 inliers right in the beginning, causing N to evaluate to -Infinity. This would be really super helpful! Best regards, |
accord-machinelearning-fitting-(ransac).zip Hi Cesar, Thanks for getting back to me so quickly, I've done a slight modification to your sample app (attached); "N=-Infinity" gets printed to the console and we see that only one loop through the while statement is done. The expected behavior would be to carry on trials until maxEvaluations is reached. Hope that's what you were after? I can provide more background to my context but didn't want to muddy the water unless needed. Cheers, James |
Thanks, I registered your example as an unit test and committed a fix! I will generate a pre-release package soon. Regards, |
Fixed on release 3.3.0. |
Hi,
I'm relatively new to Ransac but I've stumbled across an odd bug;
In the case that the distances function returns 0 inliers on it's first attempt (i.e. before
bestInliers
is set) thenN
evaluates to '-Infinty' (not sure why -Infinity rather than +Infinity?) causing the while loop to end on its first attempt (as thencount
> -Infinity).Propose for line 332 :
((bestInliers == null && inliers.Length > 0) || inliers.Length > maxInliers)
(... or something more elegant!)Cheers,
James
The text was updated successfully, but these errors were encountered: