bugGNU Octave - Bugs: bug #59773, [octave forge] (image) iradon is...

 
 

bug #59773: [octave forge] (image) iradon is not Matlab compatible when using filter

Submitter:  Avinoam Kalma <avinoam>
Submitted:  Mon 28 Dec 2020 09:15:28 PM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Ready For Test Assigned to:  avinoam
Originator Name:  Open/Closed:  * Open
Release:  * other Release: 
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 03 Jul 2025 04:46:20 AM UTC, comment #4: 

Pushed:

https://sourceforge.net/p/octave/image/ci/1bbdf3df010846c05c87235e905f57b474db1b7f/

This fix will be part of version 2.18.0 of the Image package.
Please review.

Avinoam Kalma <avinoam>
Group Member
Wed 25 Jun 2025 04:48:52 PM UTC, comment #3: 

A correct patch

(file #57327)

Avinoam Kalma <avinoam>
Group Member
Wed 25 Jun 2025 04:45:16 PM UTC, comment #2: 

A better fix is in the attached patch.

Please review.
Thanks


(file #57326)

Avinoam Kalma <avinoam>
Group Member
Wed 11 Jun 2025 04:52:54 AM UTC, comment #1: 

It appears that the implementation of the RAM-LAK filter is not compatible with MATLAB.

Using the Stackoverflow question
https://stackoverflow.com/questions/6709871/matlab-how-to-implement-a-ram-lak-filter-ramp-filter-in-the-frequency-domain
The implementation should be:

  n = int_len / 2;
  filt = zeros (n+1, 1);
  filt(1) = 1./4;
  for i=2:2:n+1
    filt(i) = -1 / (pi*(i-1))^2;
  end
  filt = [filt; filt(end-1:-1:2)];
  rho = 2*real (fft (filt));

Please review the attached patch.


(file #57285)

Avinoam Kalma <avinoam>
Group Member
Mon 28 Dec 2020 09:15:28 PM UTC, original submission:  

Examples:

Octave:


>> iradon(radon(ones(2,2),0:5),0:5, 'nearest')
ans =

  -0.3677   0.7481   0.7127  -0.3903
  -0.3677   0.7481   0.7127  -0.3903
  -0.3677   0.7481   0.7127  -0.3903
  -0.3677   0.7481   0.7127  -0.3903


Matlab:


>> iradon(radon(ones(2,2),0:5),0:5, 'nearest')

ans =

   -0.3593    0.7563    0.7210   -0.3820
   -0.3593    0.7563    0.7210   -0.3820
   -0.3593    0.7563    0.7210   -0.3820
   -0.3593    0.7563    0.7210   -0.3820


but if filter is 'none' Octave is compatible.

Ocatve:


>> iradon(radon(ones(2,2),0:5),0:5, 'nearest', 'none')
ans =

   0.4264   2.7859   2.7152   0.3557
   0.4264   2.7859   2.7152   0.3557
   0.4264   2.7859   2.7152   0.3557
   0.4264   2.7859   2.7152   0.3557


Matlab:


>> iradon(radon(ones(2,2),0:5),0:5, 'nearest', 'none')

ans =

    0.4264    2.7859    2.7152    0.3557
    0.4264    2.7859    2.7152    0.3557
    0.4264    2.7859    2.7152    0.3557
    0.4264    2.7859    2.7152    0.3557



Avinoam Kalma <avinoam>
Group Member

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #57327:  bug_59773.patch added by avinoam (3KiB - application/octet-stream)
file #57326:  bug_59773.patch added by avinoam (3KiB - application/octet-stream)
file #57285:  bug_59773.patch added by avinoam (588B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by avinoam (Submitted the item)
  • -email is unavailable- added by avinoam
  • -email is unavailable- added by avinoam
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2025-07-03 avinoam StatusPatch Submitted Ready For Test
    2025-06-25 avinoam Attached File- Added bug_59773.patch, #57327
    2025-06-25 avinoam Attached File- Added bug_59773.patch, #57326
        Assigned toNone avinoam
    2025-06-11 avinoam Attached File- Added bug_59773.patch, #57285
        StatusNone Patch Submitted
    2020-12-28 avinoam Carbon-Copy- Added carandraug
        Carbon-Copy- Added hardy

    Back to the top

    Powered by Savane 3.15-e6e5.
    Corresponding source code