Hi,
With reference to my previous post about an assertion in fcvNCCPatchesOnRectu8 I can confirm that with fastcv 1.6 I don't get the assertion anymore and as expected fastcv fcvNCCPatchesOnRectu8 performs faster than opencv matchTemplate.
Now I'm finding another problem with the same function. I get the right match locations but the bestNCC I get doesn't look right to me. The reference says: “bestNCC: NCC value of the best match blocks. It's quantized to integer value in Q7 (between -128 and 128). “
I assume 128 is perfect correlation and -128 is perfect anti-correlation.
In my project I was getting very low values for bestNCC even when the match was correct. Then I tested fcvNCCPatchesOnRectu8 to match patches from an image against the same image. I would expect perfect matches all the time, ie bestNCC=128 . However to my surprise in a substantial number of cases the bestNCC was very low!
I attach a file with some code to test for this. The code first loads a test image, then it tests a few of the locations where I was getting unexpected low bestNCC value despite of the correct match location.
When I run the code I get the following output:
0
61, 40 --> 61, 40 -- 6
89, 19 --> 89, 19 -- 28
107, 45 --> 107, 45 -- 21
126, 48 --> 126, 48 -- 22
The first column are the patch locations, the second are the matches (which are correct) then the last number is the bestNCC. I would expect 128 in all the 4 cases, but that's not the case!
Any help would be highly appreciated.
Hi,
Thank you for reporting the issue. We investigated it and found an overflow issue when patch size is big. The bug will be fixed in next release (1.7.0).
Appreciate your support and patience.
Cheers,
-Jeff
Ok, thanks.
I look forward to try version 1.7.0