<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/255301</link>
    <title>MATLAB Central Newsreader - create grayscale star sign</title>
    <description>Feed for thread: create grayscale star sign</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, 04 Jul 2009 09:39:01 -0400</pubDate>
      <title>create grayscale star sign</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/255301#662582</link>
      <author>Julia Woody</author>
      <description>Hi all,&lt;br&gt;
&lt;br&gt;
I have a 256x256 sized image as;&lt;br&gt;
&lt;br&gt;
image=zeros(256,256)&lt;br&gt;
&lt;br&gt;
and I want to create a grayscale colored star sign on this image. How to do this? what is the code for this?</description>
    </item>
    <item>
      <pubDate>Sat, 04 Jul 2009 13:34:46 -0400</pubDate>
      <title>Re: create grayscale star sign</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/255301#662595</link>
      <author>ImageAnalyst</author>
      <description>On Jul 4, 5:39&#160;am, &quot;Julia Woody&quot; &amp;lt;jwwoo...@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; Hi all,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I have a 256x256 sized image as;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; image=zeros(256,256)&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; and I want to create a grayscale colored star sign on this image. How to do this? what is the code for this?&lt;br&gt;
&lt;br&gt;
---------------------------------------------------------------------------------------------------------&lt;br&gt;
What does your star look like? I'd probably use poly2mask to create a&lt;br&gt;
binary image and then use logical operations to &quot;burn&quot; it into your&lt;br&gt;
original image.  But you have to know the coordinates of the vertices&lt;br&gt;
of the star of course because there are an infinite number of shapes&lt;br&gt;
that you could call &quot;stars.&quot;</description>
    </item>
    <item>
      <pubDate>Sat, 04 Jul 2009 14:37:01 -0400</pubDate>
      <title>Re: create grayscale star sign</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/255301#662599</link>
      <author>Julia Woody</author>
      <description>thanks for your response&lt;br&gt;
kind regards,&lt;br&gt;
julia&lt;br&gt;
&lt;br&gt;
ImageAnalyst &amp;lt;imageanalyst@mailinator.com&amp;gt; wrote in message &amp;lt;0b84ba91-b15b-4dc1-9615-e9dff36570d8@s31g2000yqs.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; On Jul 4, 5:39?am, &quot;Julia Woody&quot; &amp;lt;jwwoo...@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt; Hi all,&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; I have a 256x256 sized image as;&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; image=zeros(256,256)&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; and I want to create a grayscale colored star sign on this image. How to do this? what is the code for this?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; ---------------------------------------------------------------------------------------------------------&lt;br&gt;
&amp;gt; What does your star look like? I'd probably use poly2mask to create a&lt;br&gt;
&amp;gt; binary image and then use logical operations to &quot;burn&quot; it into your&lt;br&gt;
&amp;gt; original image.  But you have to know the coordinates of the vertices&lt;br&gt;
&amp;gt; of the star of course because there are an infinite number of shapes&lt;br&gt;
&amp;gt; that you could call &quot;stars.&quot;</description>
    </item>
    <item>
      <pubDate>Tue, 11 Aug 2009 11:32:19 -0400</pubDate>
      <title>Re: create grayscale star sign</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/255301#672186</link>
      <author>M. David </author>
      <description>&quot;Julia Woody&quot; &amp;lt;jwwoody0@gmail.com&amp;gt; wrote in message &amp;lt;h2nped$glo$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; thanks for your response&lt;br&gt;
&amp;gt; kind regards,&lt;br&gt;
&amp;gt; julia&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; ImageAnalyst &amp;lt;imageanalyst@mailinator.com&amp;gt; wrote in message &amp;lt;0b84ba91-b15b-4dc1-9615-e9dff36570d8@s31g2000yqs.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; On Jul 4, 5:39?am, &quot;Julia Woody&quot; &amp;lt;jwwoo...@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Hi all,&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; I have a 256x256 sized image as;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; image=zeros(256,256)&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; and I want to create a grayscale colored star sign on this image. How to do this? what is the code for this?&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; ---------------------------------------------------------------------------------------------------------&lt;br&gt;
&amp;gt; &amp;gt; What does your star look like? I'd probably use poly2mask to create a&lt;br&gt;
&amp;gt; &amp;gt; binary image and then use logical operations to &quot;burn&quot; it into your&lt;br&gt;
&amp;gt; &amp;gt; original image.  But you have to know the coordinates of the vertices&lt;br&gt;
&amp;gt; &amp;gt; of the star of course because there are an infinite number of shapes&lt;br&gt;
&amp;gt; &amp;gt; that you could call &quot;stars.&quot;&lt;br&gt;
&lt;br&gt;
Hi,&lt;br&gt;
I need a shape similar to star sign again, I want to draw the shape using cos function.  4 peaks (for north, south, west and east) will be enough for the star shape. Could you please give me example codes for this purpose&lt;br&gt;
&lt;br&gt;
thanks, cheers</description>
    </item>
    <item>
      <pubDate>Tue, 11 Aug 2009 11:47:39 -0400</pubDate>
      <title>Re: create grayscale star sign</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/255301#672190</link>
      <author>ImageAnalyst</author>
      <description>On Aug 11, 7:32&#160;am, &quot;M. David &quot; &amp;lt;M.Da...@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; Hi,&lt;br&gt;
&amp;gt; I need a shape similar to star sign again, I want to draw the shape using cos function. &#160;4 peaks (for north, south, west and east) will be enough for the star shape. Could you please give me example codes for this purpose&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; thanks, cheers- Hide quoted text -&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; - Show quoted text -&lt;br&gt;
&lt;br&gt;
---------------------------------------------------------------------&lt;br&gt;
Why use a cos() function when all your vertices lie on the x and y&lt;br&gt;
axes?&lt;br&gt;
Just pick your 8 points and use the line() or plot() function - its&lt;br&gt;
really trivial.</description>
    </item>
    <item>
      <pubDate>Tue, 11 Aug 2009 12:01:19 -0400</pubDate>
      <title>Re: create grayscale star sign</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/255301#672192</link>
      <author>M. David </author>
      <description>ImageAnalyst &amp;lt;imageanalyst@mailinator.com&amp;gt; wrote in message &amp;lt;267b4f57-eee0-4a13-8b53-d77765ab3e9e@r36g2000vbn.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; On Aug 11, 7:32?am, &quot;M. David &quot; &amp;lt;M.Da...@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt; Hi,&lt;br&gt;
&amp;gt; &amp;gt; I need a shape similar to star sign again, I want to draw the shape using cos function. ?4 peaks (for north, south, west and east) will be enough for the star shape. Could you please give me example codes for this purpose&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; thanks, cheers- Hide quoted text -&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; - Show quoted text -&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; ---------------------------------------------------------------------&lt;br&gt;
&amp;gt; Why use a cos() function when all your vertices lie on the x and y&lt;br&gt;
&amp;gt; axes?&lt;br&gt;
&amp;gt; Just pick your 8 points and use the line() or plot() function - its&lt;br&gt;
&amp;gt; really trivial.&lt;br&gt;
&lt;br&gt;
dear ImageAnalyst, thanks for your response.&lt;br&gt;
the peaks must not be sharp.  And, I will paint the inside of the shape with different color, and outside of the shape with different color. Also, the color of the shape itself must be with different color. How to do this?</description>
    </item>
    <item>
      <pubDate>Tue, 11 Aug 2009 12:09:19 -0400</pubDate>
      <title>Re: create grayscale star sign</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/255301#672194</link>
      <author>M. David </author>
      <description>&quot;M. David &quot; &amp;lt;M.David@gmail.com&amp;gt; wrote in message &amp;lt;h5rmif$sg9$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; ImageAnalyst &amp;lt;imageanalyst@mailinator.com&amp;gt; wrote in message &amp;lt;267b4f57-eee0-4a13-8b53-d77765ab3e9e@r36g2000vbn.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; On Aug 11, 7:32?am, &quot;M. David &quot; &amp;lt;M.Da...@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Hi,&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; I need a shape similar to star sign again, I want to draw the shape using cos function. ?4 peaks (for north, south, west and east) will be enough for the star shape. Could you please give me example codes for this purpose&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; thanks, cheers- Hide quoted text -&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; - Show quoted text -&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; ---------------------------------------------------------------------&lt;br&gt;
&amp;gt; &amp;gt; Why use a cos() function when all your vertices lie on the x and y&lt;br&gt;
&amp;gt; &amp;gt; axes?&lt;br&gt;
&amp;gt; &amp;gt; Just pick your 8 points and use the line() or plot() function - its&lt;br&gt;
&amp;gt; &amp;gt; really trivial.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; dear ImageAnalyst, thanks for your response.&lt;br&gt;
&amp;gt; the peaks must not be sharp.  And, I will paint the inside of the shape with different color, and outside of the shape with different color. Also, the color of the shape itself must be with different color. How to do this?&lt;br&gt;
&lt;br&gt;
I mean, there should not be any sharp corner. Deeps and the peaks should not be sharp</description>
    </item>
    <item>
      <pubDate>Tue, 11 Aug 2009 13:57:38 -0400</pubDate>
      <title>Re: create grayscale star sign</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/255301#672213</link>
      <author>ImageAnalyst</author>
      <description>On Aug 11, 8:09&#160;am, &quot;M. David &quot; &amp;lt;M.Da...@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; &quot;M. David &quot; &amp;lt;M.Da...@gmail.com&amp;gt; wrote in message &amp;lt;h5rmif$sg...@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; dear ImageAnalyst, thanks for your response.&lt;br&gt;
&amp;gt; &amp;gt; the peaks must not be sharp. &#160;And, I will paint the inside of the shape with different color, and outside of the shape with different color. Also, the color of the shape itself must be with different color. How to do this?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I mean, there should not be any sharp corner. Deeps and the peaks should not be sharp- Hide quoted text -&lt;br&gt;
&amp;gt;&lt;br&gt;
----------------------------------------------------------------------------------------------------------&lt;br&gt;
M. David:&lt;br&gt;
Then just create an image with sharp vertexes, blur it, and then find&lt;br&gt;
the new, smoother boundaries with bwboundaries.  Save them to a mat&lt;br&gt;
file, and then you can recall them, translate them if necessary, and&lt;br&gt;
plot them as you need to.&lt;br&gt;
&lt;br&gt;
Check out the patch() function if you want to fill the region.&lt;br&gt;
Good luck,&lt;br&gt;
ImageAnalyst</description>
    </item>
    <item>
      <pubDate>Tue, 11 Aug 2009 16:20:17 -0400</pubDate>
      <title>Re: create grayscale star sign</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/255301#672252</link>
      <author>M. David </author>
      <description>ImageAnalyst &amp;lt;imageanalyst@mailinator.com&amp;gt; wrote in message &amp;lt;9448389f-33c2-4239-808f-785b7f809d93@c2g2000yqi.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; On Aug 11, 8:09?am, &quot;M. David &quot; &amp;lt;M.Da...@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt; &quot;M. David &quot; &amp;lt;M.Da...@gmail.com&amp;gt; wrote in message &amp;lt;h5rmif$sg...@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; dear ImageAnalyst, thanks for your response.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; the peaks must not be sharp. ?And, I will paint the inside of the shape with different color, and outside of the shape with different color. Also, the color of the shape itself must be with different color. How to do this?&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; I mean, there should not be any sharp corner. Deeps and the peaks should not be sharp- Hide quoted text -&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; ----------------------------------------------------------------------------------------------------------&lt;br&gt;
&amp;gt; M. David:&lt;br&gt;
&amp;gt; Then just create an image with sharp vertexes, blur it, and then find&lt;br&gt;
&amp;gt; the new, smoother boundaries with bwboundaries.  Save them to a mat&lt;br&gt;
&amp;gt; file, and then you can recall them, translate them if necessary, and&lt;br&gt;
&amp;gt; plot them as you need to.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Check out the patch() function if you want to fill the region.&lt;br&gt;
&amp;gt; Good luck,&lt;br&gt;
&amp;gt; ImageAnalyst&lt;br&gt;
&lt;br&gt;
Thanks a lot ImageAnalyst,&lt;br&gt;
&lt;br&gt;
I am trying to change theta values of the following codes to obtain more oval corners instead of the sharp corners. Could you please examine the following codes:&lt;br&gt;
&lt;br&gt;
t = (-1/4:1/28:3/4)*2*pi;&lt;br&gt;
r1 = 44; r2 = 19;&lt;br&gt;
r = (r1+r2)/2 + (r1-r2)/2*(-1).^[0:28];&lt;br&gt;
x2 = r.*cos(t);&lt;br&gt;
y2 = r.*sin(t);&lt;br&gt;
plot(x2,y2,'b')&lt;br&gt;
&lt;br&gt;
what should be the t values?&lt;br&gt;
best regards</description>
    </item>
    <item>
      <pubDate>Wed, 12 Aug 2009 01:58:25 -0400</pubDate>
      <title>Re: create grayscale star sign</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/255301#672367</link>
      <author>ImageAnalyst</author>
      <description>On Aug 11, 12:20&#160;pm, &quot;M. David &quot; &amp;lt;M.Da...@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; Thanks a lot ImageAnalyst,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I am trying to change theta values of the following codes to obtain more oval corners instead of the sharp corners. Could you please examine the following codes:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; t = (-1/4:1/28:3/4)*2*pi;&lt;br&gt;
&amp;gt; r1 = 44; r2 = 19;&lt;br&gt;
&amp;gt; r = (r1+r2)/2 + (r1-r2)/2*(-1).^[0:28];&lt;br&gt;
&amp;gt; x2 = r.*cos(t);&lt;br&gt;
&amp;gt; y2 = r.*sin(t);&lt;br&gt;
&amp;gt; plot(x2,y2,'b')&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; what should be the t values?&lt;br&gt;
&amp;gt; best regards- Hide quoted text -&lt;br&gt;
---------------------------------------------------------------------------------------------------------------&lt;br&gt;
M.:&lt;br&gt;
Try this instead (copy and paste but fix any line breaks introduced by&lt;br&gt;
the newsreader):&lt;br&gt;
Regards,&lt;br&gt;
ImageAnalyst&lt;br&gt;
&lt;br&gt;
% Demo macro to draw a rounded star (like a splat).&lt;br&gt;
% by ImageAnalyst&lt;br&gt;
clc;&lt;br&gt;
close all;&lt;br&gt;
clear all;&lt;br&gt;
workspace;&lt;br&gt;
&lt;br&gt;
% Select the inner and outer radius.&lt;br&gt;
outerRadius = 44  % You can change this&lt;br&gt;
innerRadius = 19  % You can change this&lt;br&gt;
% Select the number of lobes around the circle.&lt;br&gt;
numberOfLobes = 8;  % You can change this&lt;br&gt;
&lt;br&gt;
period = 2 * pi / numberOfLobes;&lt;br&gt;
meanRadius = (outerRadius + innerRadius)/2&lt;br&gt;
amplitude = (outerRadius - innerRadius)/2&lt;br&gt;
t = (0:.005:1)*2*pi; % Independent parameter&lt;br&gt;
variableRadius = amplitude * cos(2*pi*t/period) + meanRadius&lt;br&gt;
subplot(2,2,1);&lt;br&gt;
plot(variableRadius);&lt;br&gt;
ylim([0 outerRadius]);&lt;br&gt;
title('VariableRadius');&lt;br&gt;
period = 2*pi;  % Need to change this now.&lt;br&gt;
x2 = variableRadius .* cos(2*pi*t/period);&lt;br&gt;
y2 = variableRadius .* sin(2*pi*t/period);&lt;br&gt;
subplot(2,2,2);&lt;br&gt;
plot(t, x2);&lt;br&gt;
title('x2 vs. t');&lt;br&gt;
subplot(2,2,3);&lt;br&gt;
plot(t, y2);&lt;br&gt;
title('y2 vs. t');&lt;br&gt;
subplot(2,2,4);&lt;br&gt;
plot(x2,y2,'b')&lt;br&gt;
title('x2 vs y2');&lt;br&gt;
&lt;br&gt;
% Maximize window.&lt;br&gt;
set(gcf, 'Position', get(0, 'ScreenSize')); % Maximize figure.</description>
    </item>
  </channel>
</rss>

