Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Image rotation and NaNs...
Date: Wed, 27 May 2009 09:03:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 9
Message-ID: <gvivk5$q0m$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 1243414981 26646 172.30.248.35 (27 May 2009 09:03:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 27 May 2009 09:03:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1693326
Xref: news.mathworks.com comp.soft-sys.matlab:542812


Hi everybody,I'm trying to rotate an image but,for some reason,when I make a 360? rotation I can't get the original image,but I got some NaNs too in image matrix and I don't know why...here is the code:

[M N]=size(X);
[n m]=meshgrid(-N/2:N/2-1,-M/2:M/2-1);
np=n*cos(2*pi)-m*sin(2*pi);
mp=n*sin(2*pi)+m*cos(2*pi);
y=interp2(n,m,X,np,mp,'linear'); 

Thx in advance...