Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
region of interest

Subject: region of interest

From: misty m.

Date: 20 Mar, 2008 14:23:03

Message: 1 of 6

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?

Subject: region of interest

From: Vihang Patil

Date: 21 Mar, 2008 07:01:01

Message: 2 of 6

"misty m." <donotspam@smth.be> wrote in message <frts07
$nfi$1@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

Subject: region of interest

From: ImageAnalyst

Date: 21 Mar, 2008 17:51:12

Message: 3 of 6

On Mar 21, 3:01=A0am, "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. In the results of regionprops, look at the
centroid. Then get the size of the image:
sizeOfImage =3D 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 =3D imageArray(y1:y2, x1:x2);

Good luck,
ImageAnalyst

Subject: region of interest

From: misty m.

Date: 28 Mar, 2008 11:49:01

Message: 4 of 6

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 <imageanalyst@mailinator.com> wrote in message
<05e3e1ab-e93c-4216-ba41-
214f5f567dd2@p73g2000hsd.googlegroups.com>...
> On Mar 21, 3:01=A0am, "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. In the results of regionprops,
look at the
> centroid. Then get the size of the image:
> sizeOfImage =3D 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 =3D imageArray(y1:y2, x1:x2);
>
> Good luck,
> ImageAnalyst

Subject: region of interest

From: ImageAnalyst

Date: 28 Mar, 2008 18:22:56

Message: 5 of 6

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
>
> <05e3e1ab-e93c-4216-ba41-
> 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

Subject: region of interest

From: misty m.

Date: 30 Mar, 2008 09:54:02

Message: 6 of 6

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
<ca616f3a-be7b-4f4a-a8d3-
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
> >
> > <05e3e1ab-e93c-4216-ba41-
> > 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

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us