patchGNU Octave - Patches: patch #8369, [octave forge] (image): imresize -...

 
 

patch #8369: [octave forge] (image): imresize - Change to imresize to reduce memory footprint

Submitter:  Ian Journeaux <ijourneaux>
Submitted:  Mon 03 Mar 2014 03:34:38 PM UTC
   
 
Category:  Forge : new feature Priority:  5 - Normal
Status:  Wont Do Privacy:  Public
Assigned to:  None Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 28 Aug 2021 01:26:29 PM UTC, comment #4: 

Closing, as @Nick suggested.

Avinoam Kalma <avinoam>
Group Member
Fri 27 Aug 2021 07:26:08 PM UTC, comment #3: 

clarification - the current version on default has removed the calls to meshgrid. the version on stable appears to still match the old code.  patch request should still be closed.

Nicholas Jankowski <nrjank>
Group Member
Fri 27 Aug 2021 07:03:40 PM UTC, comment #2: 

it appears that the current version of imresize makes no mention of meshgrid, and none of the variables in the diff below match those used in the current code. 

recommend closing this patch as it seems no longer applicable.

Nicholas Jankowski <nrjank>
Group Member
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 Files:
   
   
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
  • -email is unavailable- added by avinoam (Posted a comment)
  • -email is unavailable- added by nrjank (Posted a comment)
  • -email is unavailable- added by siko1056 (Updated the item)
  • -email is unavailable- added by fgnievinski (Posted a comment)
  • -email is unavailable- added by ijourneaux (Submitted the item)
  •  

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

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-08-28 avinoam StatusNone Wont Do
        Open/ClosedOpen Closed
    2020-01-18 siko1056 CategoryNone Forge : new feature
        Summaryimresize - Change to imresize to reduce memory footprint [octave forge] (image): imresize - Change to imresize to reduce memory footprint
    2014-03-16 ijourneaux Attached File- Added imresizediff.txt, #30920
    2014-03-03 ijourneaux Attached File- Added imresizediff.txt, #30763

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code