Path: news.mathworks.com!newsfeed-00.mathworks.com!NNTP.WPI.EDU!elk.ncren.net!newsflash.concordia.ca!canopus.cc.umanitoba.ca!not-for-mail
From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Newsgroups: comp.soft-sys.matlab
Subject: Re: How to show figure without black portion?
Date: Mon, 21 Jul 2008 21:10:56 +0000 (UTC)
Organization: National Research Council Canada - Conseil national de rechereches Canada
Lines: 33
Message-ID: <g62u10$7k2$1@canopus.cc.umanitoba.ca>
References: <g5rkue$4bg$1@fred.mathworks.com>
NNTP-Posting-Host: origin.ibd.nrc.ca
X-Trace: canopus.cc.umanitoba.ca 1216674656 7810 192.70.172.160 (21 Jul 2008 21:10:56 GMT)
X-Complaints-To: abuse@cc.umanitoba.ca
NNTP-Posting-Date: Mon, 21 Jul 2008 21:10:56 +0000 (UTC)
Originator: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Xref: news.mathworks.com comp.soft-sys.matlab:480777



In article <g5rkue$4bg$1@fred.mathworks.com>,
Nan W. <iiuu_chan@yahoo.co.jp> wrote:

>I would like to know whether there is any techniques to show
>to image in MATLAB without black portion border?

texture-map the image onto a patch object whose coordinates
are the rotated rectangular pixel coordinates.

>My case is
>I tried to superimpose two images with one is the rotate
>version of another. So it would be great if the final image
>has no black area causing by 'imrotate'.

You could convert your image to truecolor and use tformarray()
but that might be overkill.

You might be able to get somewhere by converting your image to
truecolor, padding it with NaN all around, rotating it, and then
setting any 0 that is before the first NaN or after the last NaN to
be whatever value you wanted (and the NaN too of course.)

The work becomes a -lot- easier if you know that the original
image has no 0's: then you just set all of the 0's of the
rotated image to be the value you want.

But if you are superimposing two images, then that suggests to me
that you might be interested in transparency; you can either do
the alpha calculations yourself or you can use patches anyhow.
-- 
  "Pray do not take the pains / To set me right. /
   In vain my faults ye quote; / I wrote as others wrote /
   On Sunium's hight."                      -- Walter Savage Landor