Path: news.mathworks.com!not-for-mail
From: "jay vaughan" <jvaughan5.nospam@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: imwrite flips axis xy image...
Date: Mon, 12 May 2008 23:24:47 +0000 (UTC)
Organization: harvard
Lines: 17
Message-ID: <g0ajjv$kpg$1@fred.mathworks.com>
Reply-To: "jay vaughan" <jvaughan5.nospam@gmail.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1210634687 21296 172.30.248.38 (12 May 2008 23:24:47 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 12 May 2008 23:24:47 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1215048
Xref: news.mathworks.com comp.soft-sys.matlab:468035


Is there a trick to getting imwrite to not flip images?

I displayed an image in xy mode [with the lower left corner
being the element (1,1)]. Then I used imwrite to save the
data, but it comes out in ij format, flipped vertically.

Is this just one of those MATLAB quirks? Should I just flip
the image ahead of time, or is there a smarter way?
(Plotting with axes 'ij' bothers me even more!)

frame(:,:,1) = flipud(frame(:,:,1));
frame(:,:,2) = flipud(frame(:,:,2));
frame(:,:,3) = flipud(frame(:,:,3));
imwrite(frame,'name.bmp');

Thanks,
J