Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Image rotation and NaNs...
Date: Sun, 7 Jun 2009 08:06:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 16
Message-ID: <h0fsd9$ej3$1@fred.mathworks.com>
References: <gvivk5$q0m$1@fred.mathworks.com> <h0dehc$8ui$1@fred.mathworks.com> <h0dgsc$5jr$1@fred.mathworks.com> <h0e94l$h1a$1@fred.mathworks.com> <h0edfg$ld0$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1244361961 14947 172.30.248.35 (7 Jun 2009 08:06:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 7 Jun 2009 08:06:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1693326
Xref: news.mathworks.com comp.soft-sys.matlab:545294


"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <h0edfg$ld0$1@fred.mathworks.com>...
> "Matman86 Di" <pasqui.squall@email.it> wrote in message <h0e94l$h1a$1@fred.mathworks.com>...
> 
> > I know how interp2 works,but I can't explain why if I make a 360? rotation I can't return with the original values...
> 
> Because when you rotate pi 2*pi, the points (after rotation) do not fall exactly where it is due to numerical error (try to see the value of sin(2*pi), it is not zero), and if it's outside the box, interp2 puts the value to NaN.
> 
> And btw, why your point of rotation is not centered in the image? It's off by 1/2 pixel.
> 
> Bruno

I answer first to last question:it's because if I make a grid like -M/2:M/2 I don't get the exact number of pixels.
You're right for the NaNs,so I can't do anything about it I guess...
According to you is ok if I make
X(isnan(X))=0;
in order to allow elaborations on the image?