<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/172875</link>
    <title>MATLAB Central Newsreader - How to show figure without black portion?</title>
    <description>Feed for thread: How to show figure without black portion?</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Sat, 19 Jul 2008 02:53:02 -0400</pubDate>
      <title>How to show figure without black portion?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/172875#444052</link>
      <author>Nan W.</author>
      <description>Dear all,&lt;br&gt;
&lt;br&gt;
I would like to know whether there is any techniques to show&lt;br&gt;
to image in MATLAB without black portion border? My case is&lt;br&gt;
I tried to superimpose two images with one is the rotate&lt;br&gt;
version of another. So it would be great if the final image&lt;br&gt;
has no black area causing by 'imrotate'.&lt;br&gt;
&lt;br&gt;
Thanks in advance.</description>
    </item>
    <item>
      <pubDate>Sat, 19 Jul 2008 06:09:01 -0400</pubDate>
      <title>Re: How to show figure without black portion?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/172875#444063</link>
      <author>Bruno Luong</author>
      <description>&quot;Nan W.&quot; &amp;lt;iiuu_chan@yahoo.co.jp&amp;gt; wrote in message&lt;br&gt;
&amp;lt;g5rkue$4bg$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Dear all,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I would like to know whether there is any techniques to show&lt;br&gt;
&amp;gt; to image in MATLAB without black portion border? My case is&lt;br&gt;
&amp;gt; I tried to superimpose two images with one is the rotate&lt;br&gt;
&amp;gt; version of another. So it would be great if the final image&lt;br&gt;
&amp;gt; has no black area causing by 'imrotate'.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks in advance.&lt;br&gt;
&lt;br&gt;
Have you tried 'crop' option in the 4th argument of imrotate?&lt;br&gt;
&lt;br&gt;
If it's not enough you might calculate the thickness of the&lt;br&gt;
border from image size and rotation angle and throw manually&lt;br&gt;
the borders.&lt;br&gt;
&lt;br&gt;
I believe cropping will keep the same image size/image&lt;br&gt;
magnification, but with a small border. Remove completely&lt;br&gt;
the borders would change the original magnification, aspect&lt;br&gt;
ratio, and image size.&lt;br&gt;
&lt;br&gt;
Bruno</description>
    </item>
    <item>
      <pubDate>Mon, 21 Jul 2008 21:10:56 -0400</pubDate>
      <title>Re: How to show figure without black portion?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/172875#444423</link>
      <author>roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)</author>
      <description>In article &amp;lt;g5rkue$4bg$1@fred.mathworks.com&amp;gt;,&lt;br&gt;
Nan W. &amp;lt;iiuu_chan@yahoo.co.jp&amp;gt; wrote:&lt;br&gt;
&lt;br&gt;
&amp;gt;I would like to know whether there is any techniques to show&lt;br&gt;
&amp;gt;to image in MATLAB without black portion border?&lt;br&gt;
&lt;br&gt;
texture-map the image onto a patch object whose coordinates&lt;br&gt;
are the rotated rectangular pixel coordinates.&lt;br&gt;
&lt;br&gt;
&amp;gt;My case is&lt;br&gt;
&amp;gt;I tried to superimpose two images with one is the rotate&lt;br&gt;
&amp;gt;version of another. So it would be great if the final image&lt;br&gt;
&amp;gt;has no black area causing by 'imrotate'.&lt;br&gt;
&lt;br&gt;
You could convert your image to truecolor and use tformarray()&lt;br&gt;
but that might be overkill.&lt;br&gt;
&lt;br&gt;
You might be able to get somewhere by converting your image to&lt;br&gt;
truecolor, padding it with NaN all around, rotating it, and then&lt;br&gt;
setting any 0 that is before the first NaN or after the last NaN to&lt;br&gt;
be whatever value you wanted (and the NaN too of course.)&lt;br&gt;
&lt;br&gt;
The work becomes a -lot- easier if you know that the original&lt;br&gt;
image has no 0's: then you just set all of the 0's of the&lt;br&gt;
rotated image to be the value you want.&lt;br&gt;
&lt;br&gt;
But if you are superimposing two images, then that suggests to me&lt;br&gt;
that you might be interested in transparency; you can either do&lt;br&gt;
the alpha calculations yourself or you can use patches anyhow.&lt;br&gt;
-- &lt;br&gt;
&amp;nbsp;&amp;nbsp;&quot;Pray do not take the pains / To set me right. /&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;In vain my faults ye quote; / I wrote as others wrote /&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;On Sunium's hight.&quot;                      -- Walter Savage Landor</description>
    </item>
  </channel>
</rss>

