patchGNU Octave - Patches: patch #8369, imresize - Change to imresize to...


patch #8369: imresize - Change to imresize to reduce memory footprint

Submitted by:  Ian Journeaux <ijourneaux>
Submitted on:  Mon Mar 3 15:34:38 2014  
Category: NonePriority: 5 - Normal
Status: NonePrivacy: Public
Assigned to: NoneOpen/Closed: Open

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

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


Sun Mar 16 19:40:08 2014, comment #1:

Thanks for the diff, Ian. It seems to have been generated in reverse though, i.e., diff old new vs diff new old. Would it be possible to regenerate it, please?

Also, since this is related to bug #41674, could you please attach the modified diff files there, so that we avoid duplicates.

Can someone please close the present one.

(Developers would prefer to receive a changeset file, instead of a plain diff file, in case you're inclined to learn how to prepare it on your own.)

Felipe G. Nievinski <fgnievinski>
Mon Mar 3 15:34:38 2014, original submission:

I would propose the following change to imresize to reduce the memory footprint. This is similar to a change proposed for imremap.

The issue is that meshgrid returns double when single should be sufficient.

The change involves replacing

[XI, YI] = meshgrid (linspace (1, inCols, outCols), linspace (1, inRows, outRows));


XD = linspace (1, inCols, outCols);
YD = linspace (1, inRows, outRows);
XDs = single(XD);
YDs = single(YD);
%# absolute tolerance equality
isequalAbs = @(x,y,tol) (abs(x-y) <= tol );
if(all(isequalAbs(XD, XDs, eps(XDs))) && all(isequalAbs(YD, YDs, eps(YDs))))
XD = XDs;
YD = YDs;
[XI, YI] = meshgrid (XD, YD);

Ian Journeaux <ijourneaux>


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

Attach File(s):

Attached Files
file #30920:  imresizediff.txt added by ijourneaux (697B - text/plain - Corrected Diff files.)
file #30763:  imresizediff.txt added by ijourneaux (672B - text/plain)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by fgnievinski (Posted a comment)
  • -unavailable- added by ijourneaux (Submitted the item)

    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 logged-in users can vote.


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



    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun Mar 16 23:44:13 2014ijourneauxAttached File-=>Added imresizediff.txt, #30920
    Mon Mar 3 15:34:38 2014ijourneauxAttached File-=>Added imresizediff.txt, #30763

    Back to the top

    Powered by Savane 3.1-cleanup1