help-octave
[Top][All Lists]
Advanced

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

Re: Normalisation


From: Joel Holder
Subject: Re: Normalisation
Date: Tue, 29 Aug 2017 06:34:45 -0700 (MST)

This really makes clear what's going on here.

Thank you, Harmut.

On Mon, Aug 28, 2017 at 12:35 PM Hartmut [via Octave] <
address@hidden> wrote:

> Welcome to Octave!
>
> Please have a look here [1] where this question of your Udacity course has
> been answered previously.
>
> Short summary:
>
> Your Udacity course works with an old version of Octave's image package.
> Those results where buggy, and have now been (mostly) corrected.
>
> Try this Octave code:
>
> clear
> pkg load image                        % using image 2.6.1 release
> s = [-1 0 0 1 1 1 0 -1 -1 0 1 0 0 -1]
> t = [1 1 0]
> x = normxcorr2(t,s);
> x(~isfinite(x))=0                       % to fix inf values (bug 50151)
> [maxVal maxRawIndex] = max(x)
>
> The resulting output is (slightly rounded):
> x = 1 -0.5 -0.5 -1 -0.5 0 1 0.87 0.5 -1 -0.87 0.5 0.5 1 -0.5 -0.5
> maxVal = 1
> maxRawIndex = 7
>
> The maxRawIndex could equally well be 1 or 14 instead of this 7. Those are
> all the positions where x has the value 1 (the position 7 seems to be
> closest to 1 because of machine precision).
>
> The index 7 position corresponds to "1 1 0" in s, and the index 14
> position corresponds to "0 0 -1" in s. Both have the same maximum
> normalized cross correlation to t. The index position 1 is just an artifact
> of padding the borders (those padded borders are also currently not
> perfectly Matlab compatible).
>
> This raw index can the be transferred to the index in the original array s
> if you like. You might do something like "index =
> rawIndex-(length(t)-1)/2". Then you will get the center element in s that
> corresponds to your matching substring. This value would then be 6 and
> would properly correspond to the part "1 1 0" in s.
>
> Have fun with Octave and the image package
>
>     Hartmut
>
> [1]
> http://octave.1599824.n4.nabble.com/Octave-4-0-3-normxcorr2-producing-unexpected-result-td4681543.html
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://octave.1599824.n4.nabble.com/Normalisation-tp4682870p4684700.html
> To unsubscribe from Normalisation, click here
> <http://octave.1599824.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4682870&code=amNsb3N1cmVAZ21haWwuY29tfDQ2ODI4NzB8MzI1MTExODY2>
> .
> NAML
> <http://octave.1599824.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
-- 
Sent from Gmail Mobile




--
View this message in context: 
http://octave.1599824.n4.nabble.com/Normalisation-tp4682870p4684708.html
Sent from the Octave - General mailing list archive at Nabble.com.



reply via email to

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