pydegensac icon indicating copy to clipboard operation
pydegensac copied to clipboard

unstable results while running serveral times

Open fuzzypants123 opened this issue 4 years ago • 2 comments

Hi , I used pydensac and get prefer results instead of cv2.ransac most of times, thanks for the excellent work! But I got a trouble and found that give the same input, it would produce unstable results, and some of them even worse than cv2.ransac. Besides, It will keep the same results for about ten times, but when I try dozens of times, the results will be inconsistent. I understand that the algorithm is somewhat random, but is there any way to reduce this randomness as much as possible?

fuzzypants123 avatar Nov 06 '20 06:11 fuzzypants123

Hi,

You can solve that by fixing the random seed in all places here: https://github.com/ducha-aiki/pydegensac/search?q=seed

E.g. seed = rand(); -> seed = rand(0);

Unfortunately, that requires recompilation of the C part of the library. I don't have time now to recompile and check all the python wheelsm but might do it later (created https://github.com/ducha-aiki/pydegensac/issues/5 for not forgetting). However, don't expect it to be done this month.

Best, Dmytro

ducha-aiki avatar Nov 06 '20 09:11 ducha-aiki

hi thanks for the reply! I tried but got an error like this image seems rand() doesn't accpet any arguments. I guess seed = rand() should generates a different value every time? so I tried seed=time(NULL). Seem it gets worse results, and didn't solve my problem:(. Am I doing right?

fuzzypants123 avatar Nov 07 '20 16:11 fuzzypants123