bugGNU Octave - Bugs: bug #50151, [octave forge] (image) normxcorr2...


bug #50151: [octave forge] (image) normxcorr2 is not compatible with Matlab

Submitted by:  Avinoam Kalma <avinoam>
Submitted on:  Thu 26 Jan 2017 04:45:59 AM UTC  
Category: Octave Forge PackageSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: NoneAssigned to: None
Originator Name: AvinoamOpen/Closed: Open
Release: otherOperating System: Any

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Mon 30 Jan 2017 05:52:23 AM UTC, comment #3:

I did not see problems which are not in the margins.
Probably a problem of padding policy.
In such small images and templates, Matlab is probably using
direct calculation and not FFT, which is efficient in larger images.

Avinoam Kalma <avinoam>
Project Member
Sun 29 Jan 2017 01:01:30 PM UTC, comment #2:

Here is another normxcorr2 result from Matlab and Octave, to compare:

This strengthens my suspicion that the significant differences are mainly around the border pixels, where some kind of extrapolation needed to be done.

Hartmut <hardy>
Thu 26 Jan 2017 10:00:19 PM UTC, comment #1:

It might be a non-trivial task to fix this:

Matlab sometimes does calculations in the spatial or the frequency domain, it sounds quite convoluted:
(see http://de.mathworks.com/help/images/ref/normxcorr2.html#f6-308857)

In contrast, the Octave version of normxcorr2 does simply use the convn function, always in the spatial domain.

Question: Are there also significant differences between Matlab and Octave output for "center pixels"? I mean differences for pixels that are further away from the image border than the width of the template? Or is this always only an issue for pixels near the image border?

Hartmut <hardy>
Thu 26 Jan 2017 04:45:59 AM UTC, original submission:

For example, use the following script (check_norm.m):

Running in Matlab:

Running in Octave:

The two first entries and the two last entries are different.

Avinoam Kalma <avinoam>
Project Member


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by jwe (Updated the item)
  • -unavailable- added by hardy (Posted a comment)
  • -unavailable- added by avinoam (Submitted the item)
  • -unavailable- added by avinoam
  • -unavailable- added by avinoam
  • -unavailable- added by avinoam

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 12 Aug 2017 07:11:58 PM UTCjweSummaryimage package: normxcorr2 is not compatible with Matlab=>[octave forge] (image) normxcorr2 is not compatible with Matlab
    Thu 26 Jan 2017 04:45:59 AM UTCavinoamCarbon-Copy-=>Added -unavailable-
      Carbon-Copy-=>Added -unavailable-
      Carbon-Copy-=>Added -unavailable-

    Back to the top

    Powered by Savane 3.1-cleanup1