help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Octave 4.0.3: normxcorr2 producing unexpected result


From: Hartmut
Subject: Re: Octave 4.0.3: normxcorr2 producing unexpected result
Date: Tue, 18 Apr 2017 12:00:13 -0700 (PDT)

When you use t = [1 1 1] you will get only 0s as result. And this is also
correct.

Reason:The normalized cross correlation is also normalized to the standard
deviation of s and t. So in places where s or t have a standard deviation of
0 (like t in your case, try std(t) ) you will get an undefined result.
Matlab decided to return a 0 value is this case. For the definition of the
normalized cross correlation as well as for this Matlab behavior, see [1].

If you want so search for image templates that are fully flat (i.e. with a
standard deviation zero) than you should probably be using something
different, but not normxcorr2. You might want to try corrcoef (in future
Octave version 4.4) for your 1-D example, your just use stdfilt or rangefilt
on real 2D images.

     Hartmut


[1] Matlab help page of normxcorr2: 
     Defintion:
https://de.mathworks.com/help/images/ref/normxcorr2.html#bvibmz_-5
     Dealing with std=0:
https://de.mathworks.com/help/images/ref/normxcorr2.html#bvh5vek-3



--
View this message in context: 
http://octave.1599824.n4.nabble.com/Octave-4-0-3-normxcorr2-producing-unexpected-result-tp4681543p4682910.html
Sent from the Octave - General mailing list archive at Nabble.com.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]