[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #41480] image package :normxcorr2 yields diffe
[Octave-bug-tracker] [bug #41480] image package :normxcorr2 yields different result from matlab
Sat, 15 Feb 2014 23:01:03 +0000
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20140205 Firefox/24.0 Iceweasel/24.3.0
Follow-up Comment #5, bug #41480 (project octave):
I finally got down to adjusting the tests. The bolstered up file is appended.
There is a remaining problem of principle: How to behave at the boundaries?
Matlab is not a role model here, as it fails
normxcorr2(tmplt,-img) == -normxcorr2(tmplt,img)
The "correct" behaviour would be to only consider the overlapping parts of
template and image and only subtract the differences of these overlapping
parts in all three places. However, I could not find a clever way to achieve
this without interpreted loops, which would be unacceptable. I went for the
next-to-ideal solution from my point of view, which consists in centring the
whole image (line 39 in the appended file) which makes sure that images that
differ only by a constant offset yield the same normalized cross correlation
with the same template.
I hope you find my reasoning acceptable although the result is that in some
cases the function will yield different results than matlab near the boundary
(for example, my version ensures
normxcorr2(tmplt,-img) == -normxcorr2(tmplt,img) ).
Also note that I have the function issue a warning, if the template is larger
than the image (as this most likely happens by mistake). I hope this is
acceptable for Octave.
Additional Item Attachment:
File name: normxcorr2.m Size:3 KB
Reply to this item at:
Nachricht gesendet von/durch Savannah