thanks, i understand the point now.
anyway, this centroid thing will be usefull only for images
on which there are no problems in finding the circles. but
unfortunatelly half of my pictures are not regular, they
have a lot of cracks etc but that is the subject for
another topic.
thanks for all replies!
ImageAnalyst <imageanalyst@mailinator.com> wrote in message
<ca616f3abe7b4f4aa8d3
6b7255985552@59g2000hsb.googlegroups.com>...
> On Mar 28, 7:49=A0am, "misty m." <donots...@smth.be>
wrote:
> > sorry for such a long break in responding and thanks for
> > all replies.
> >
> > i do not understand what for centroids? what will they
give
> > me? for each picture i get few of them (following Your
> > steps) and when i plot them i do not see any use of
them.
> > none of them is in the middle of an image or in the
middle
> > of ones circles..
> > i think i do not understand the idea :/
> >
> > ImageAnalyst <imageanal...@mailinator.com> wrote in
message
> >
> > <05e3e1abe93c4216ba41
> > 214f5f567...@p73g2000hsd.googlegroups.com>...
> >
> >
> >
> > > On Mar 21, 3:01=3DA0am, "Vihang Patil"
> > <vihang_pa...@yahoo.com> wrote:
> > > > "misty m." <donots...@smth.be> wrote in message
<frts07
> >
> > > > $nf...@fred.mathworks.com>...
> >
> > > > > hi,
> >
> > > > > i've got an image, let's say it is a rectangle
with
> > few
> > > > > circles. but im interested only in one of these
> > circles
> > > > > (the middle one).
> > > > > can You please tell me how can i set a region of
> > > > interest
> > > > > (the middle circle) and make a smaller image of
it?
> >
> > > > Hello
> > > > Following steps might be useful
> > > > 1. Convert the image into binary
> > > > 2. Label the image matrix "doc bwlabel"
> > > > 3. Compute the statistics on the image "doc
regionprops"
> > > > 4. From regionprops you will get vital information
to
> > your
> > > > above said problem
> > > > HTH
> > > > Vihang
> >
> > > 
> > > Follow Vihang's steps. =A0In the results of
regionprops,
> > look at the
> > > centroid. =A0Then get the size of the image:
> > > sizeOfImage =3D3D size(imageArray);
> > > Then use the Pythagorean theorem to the the distance
of
> > all the
> > > circles to the center of the image (sizeOfImage(1),
> > sizeOfImage (2)).
> > > Then use the PixelIDXList to find the bounding box of
the
> > circle
> > > that's closest to the center (the edges x1, x2, y1,
y2),
> > then crop it
> > > out like this:
> > > croppedImage =3D3D imageArray(y1:y2, x1:x2);
> >
> > > Good luck,
> > > ImageAnalyst Hide quoted text 
> >
> >  Show quoted text 
> 
> misty.m:
> The centroids give you the locations of each circle (it's
center).
> You now want to find the one that is closest to the
center of your
> image. How would you do this? Doesn't it make sense to
calculate the
> distance from each circle to the center of the image and
then find the
> one with the smallest distance? The one with the
smallest distance
> is, of course, the one closest to the middle, which is
one of the
> things you asked for. Post back if this is still
confusing for you.
> Regards,
> ImageAnalyst
