help-octave
[Top][All Lists]
Advanced

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

RE: imrotate: Differences between Matlab and Octabe


From: Journeaux, Ian
Subject: RE: imrotate: Differences between Matlab and Octabe
Date: Sat, 20 Mar 2010 19:32:49 -0500

Søren

I very much appreciate you having the opportunity to look at this small 
difference.

Is there a way to take advantage of the changes you have made. Do I just ned to 
download interp2.m

-----Original Message-----
From: Søren Hauberg [mailto:address@hidden 
Sent: Saturday, March 20, 2010 4:28 PM
To: Journeaux, Ian
Cc: address@hidden
Subject: Re: imrotate: Differences between Matlab and Octabe

Hi

Sorry about the late reply

man, 15 03 2010 kl. 09:17 -0500, skrev Journeaux, Ian:
> For our purposes, we were mainly interested in the nearest procedure
> as we want to minimize smoothing of the pixel values in the images.
> 
> We observed that the nearest versions of Matlab and Octave are not
> quite the same producing small differences in the results. About half
> (roughly) of Matlab pixels are 1 grey level above that of Octave, the
> rest being equal. This suggests a different way of rounding. The
> central pixel (100,100) where the major shift occurs there is a much
> larger difference - 8 grey levels. In all cases Matlab grey levels are
> exactly where they should be wrt the original image.
> 
>  
> 
> The results for "nearest" are probably good enough for us but since we
> had dug into it, and observed some differences, I  though we should
> share the results.

Thanks for sharing this stuff. 'imrotate' simply use the interpolation
function 'interp2', so your results made me look at this function.

The following example illustrates the difference

        X = meshgrid (1:4)
        interp2 (X, 2.5, 2.5, 'nearest')

In Matlab, this gives me '3', whereas Octave gives '2', which I guess is
the cause of the differences you observed.

I pushed the following changeset

  http://hg.savannah.gnu.org/hgweb/octave/rev/62bb59f927b1

which seems to fix this situation.

Søren


This electronic message contains information from NewPage Corporation or 
subsidiary companies, 
which may be confidential, privileged or otherwise protected from disclosure. 
The information is 
intended to be used solely by the recipient(s) named. If you are not an 
intended recipient, be 
aware that any review, disclosure, copying, distribution or use of this 
transmission or its 
contents is prohibited. If you have received this transmission in error, please 
notify NewPage 
immediately at address@hidden




reply via email to

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