Path: news.mathworks.com!newsfeed-00.mathworks.com!newscon02.news.prodigy.net!prodigy.net!news.glorb.com!postnews.google.com!e60g2000hsh.googlegroups.com!not-for-mail
From: ImageAnalyst <imageanalyst@mailinator.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Drawing a solid circle pixel using x,y coordinate and radius
Date: Mon, 25 Feb 2008 17:06:41 -0800 (PST)
Organization: http://groups.google.com
Lines: 59
Message-ID: <8045dbb9-78a2-45cd-8382-42a1e0368061@e60g2000hsh.googlegroups.com>
References: <fpv27l$p8s$1@fred.mathworks.com> <fpve85$i5i$1@fred.mathworks.com> 
NNTP-Posting-Host: 75.186.67.199
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1203988001 15301 127.0.0.1 (26 Feb 2008 01:06:41 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 26 Feb 2008 01:06:41 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: e60g2000hsh.googlegroups.com; posting-host=75.186.67.199; 
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 
Xref: news.mathworks.com comp.soft-sys.matlab:453612



On Feb 25, 5:45=A0pm, "Phil Au" <philip...@gmail.com> wrote:
> "Ian Clarkson" <ian.clark...@gesturetek.com> wrote in
> message <fpve85$i5...@fred.mathworks.com>...
>
>
>
>
>
> > "Phil Au" <philip...@gmail.com> wrote in message
> > <fpv27l$p8...@fred.mathworks.com>...
> > > Hi all,
>
> > > I was having difficulties in creating a solid circle
> > shape
> > > pixel with x and y coordinates, and radius..
>
> > > I kind of know that the radius must be at least more
> than
> > 3
> > > pixels size to be able to show the shape of the circle,
> > but
> > > I dont know where to start to write the code..
>
> > > Many thanks
>
> > i could have sworn this got answered a few days ago.
> check
> > around the forum a bit more. it involved calculating the
> > radius out from the center and just turning the
> pixel "on",
> > as i recall.
>
> Thx for your advice, But I was wondering how I adapt this
> to a reference frame in an image ? i.e. paint a solid
> cirlce in pixel(x,y)?- Hide quoted text -
>
> - Show quoted text -

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Let me know if you're able to adapt this simple demo code I wrote for
you to your situation:
%=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
% Make a binary image containing two overlapping circular objects.
imageSizeX =3D 128;
imageSizeY =3D 200;
centerX =3D 64;
centerY =3D 90;
radius =3D 10;
[x,y] =3D meshgrid(1:imageSizeY, 1:imageSizeX);
binaryImage =3D sqrt((x-centerX).^2 + (y-centerY).^2) <=3D radius;
figure;
imshow(binaryImage, []);
title('bw Circle');

Regards,
ImageAnalyst