octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #41480] normxcorr2 yields different result fro


From: anonymous
Subject: [Octave-bug-tracker] [bug #41480] normxcorr2 yields different result from matlab
Date: Thu, 06 Feb 2014 13:00:09 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:26.0) Gecko/20100101 Firefox/26.0 Iceweasel/26.0

URL:
  <http://savannah.gnu.org/bugs/?41480>

                 Summary: normxcorr2 yields different result from matlab
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Do 06 Feb 2014 13:00:01 UTC
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.6.4
        Operating System: GNU/Linux

    _______________________________________________________

Details:

In Octave, normxcorr2(b,a) = xcorr2(a,b,"coeff") yields different results from
the corresponding matlab function.

Example:


I1 = [17  24   1   8  15
      23   5   7  14  16
       4   6  13  20  22
      10  12  19  21   3
      11  18  25   2   9];

 I2 = [8   1   6
       3   5   7
       4   9   2];


Octave:


>>> normxcorr2(I2,I1)
ans =

   0.11847   0.40482   0.57568   0.28310   0.36871   0.58190   0.23694
   0.34173   0.73907   0.50847   0.47886   0.70345   0.65064   0.29440
   0.55586   0.55445   0.58357   0.86717   0.80696   0.70386   0.48815
   0.43382   0.46527   0.86184   0.85369   0.88917   0.57327   0.44587
   0.44634   0.67240   0.80942   0.89965   0.67134   0.54880   0.54640
   0.54589   0.59350   0.72946   0.58994   0.51489   0.56853   0.31844
   0.35541   0.33415   0.46358   0.34730   0.56910   0.16062   0.47388

>>> xcorr2(I1,I2,"coeff")
ans =

   0.11847   0.40482   0.57568   0.28310   0.36871   0.58190   0.23694
   0.34173   0.73907   0.50847   0.47886   0.70345   0.65064   0.29440
   0.55586   0.55445   0.58357   0.86717   0.80696   0.70386   0.48815
   0.43382   0.46527   0.86184   0.85369   0.88917   0.57327   0.44587
   0.44634   0.67240   0.80942   0.89965   0.67134   0.54880   0.54640
   0.54589   0.59350   0.72946   0.58994   0.51489   0.56853   0.31844
   0.35541   0.33415   0.46358   0.34730   0.56910   0.16062   0.47388


matlab:


>> normxcorr2(I2,I1)

ans =

   -0.4108   -0.0198    0.3791   -0.2491   -0.1202    0.4424   -0.1369
   -0.1786    0.5409   -0.2540   -0.2876    0.1927    0.2119   -0.3070
    0.2647   -0.1667   -0.5097    0.4875    0.0346    0.0207   -0.0455
    0.0058   -0.4321    0.3851    0.2236    0.3851   -0.3321    0.0054
   -0.0898    0.0285    0.0346    0.4875   -0.5097   -0.1686    0.3119
    0.3150    0.0516    0.1444   -0.2254   -0.2513    0.3038   -0.1351
    0.1369   -0.1790   -0.0662   -0.2105    0.4124   -0.4579    0.4108



Appended to this bug report is a function, that yields:


>>> xcorr2coeff_alt(I1,I2)
ans =

 Columns 1 through 6:

  -0.4107919  -0.0198289   0.3790535  -0.2491009  -0.1202259   0.4424397
  -0.1785776   0.5409279  -0.2539863  -0.2875655   0.1926779   0.2119488
   0.2646599  -0.1666714  -0.5097419   0.4874667   0.0345582   0.0207020
   0.0058150  -0.4320922   0.3850770   0.2236068   0.3850770  -0.3320513
  -0.0897610   0.0285326   0.0345582   0.4874667  -0.5097419  -0.1685608
   0.3149997   0.0516398   0.1443996  -0.2253609  -0.2513123   0.3038059
   0.1369306  -0.1790197  -0.0661733  -0.2105287   0.4124105  -0.4578508

 Column 7:

  -0.1369306
  -0.3069852
  -0.0454723
   0.0054447
   0.3119203
  -0.1350676
   0.4107919


which is, up to rounding, the same as the matlab function yields (where
arguments are interchanged, as the normxcorr2-wrapper interchanges arguments
as stated and illustrated above). I would be glad if the corresponding 8 lines
of code would be integrated in Octave (and I appologize for the poor coding
style).



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Do 06 Feb 2014 13:00:01 UTC  Name: xcorr2coeff_alt.m  Size: 1kB   By:
None

<http://savannah.gnu.org/bugs/download.php?file_id=30470>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?41480>

_______________________________________________
  Nachricht gesendet von/durch Savannah
  http://savannah.gnu.org/




reply via email to

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