octave-patch-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-patch-tracker] [patch #8369] imresize - Change to imresize to re


From: Ian Journeaux
Subject: [Octave-patch-tracker] [patch #8369] imresize - Change to imresize to reduce memory footprint
Date: Mon, 03 Mar 2014 15:34:39 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36

URL:
  <http://savannah.gnu.org/patch/?8369>

                 Summary: imresize - Change to imresize to reduce memory
footprint
                 Project: GNU Octave
            Submitted by: ijourneaux
            Submitted on: Mon 03 Mar 2014 03:34:38 PM GMT
                Category: None
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

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=[];




    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Mon 03 Mar 2014 03:34:38 PM GMT  Name: imresizediff.txt  Size: 672B  
By: ijourneaux

<http://savannah.gnu.org/patch/download.php?file_id=30763>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/patch/?8369>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]