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 03 Mar 2014 03:34:38 PM UTC  
 
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 16 Mar 2014 07:40:08 PM UTC, 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 03 Mar 2014 03:34:38 PM UTC, 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));

with

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;
endif
XDs=[];
YDs=[];
[XI, YI] = meshgrid (XD, YD);
XD=[];
YD=[];

Ian Journeaux <ijourneaux>

 

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

Attach File(s):
   
   
Comment:
   

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 16 Mar 2014 11:44:13 PM UTCijourneauxAttached File-=>Added imresizediff.txt, #30920
    Mon 03 Mar 2014 03:34:38 PM UTCijourneauxAttached File-=>Added imresizediff.txt, #30763

    Back to the top


    Powered by Savane 3.1-cleanup