Got Questions? Get Answers.
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:
RegionProps image buildup

Subject: RegionProps image buildup

From: Aron Sceidt

Date: 10 Mar, 2011 15:21:05

Message: 1 of 4

I've been thinking for some time about a specific problem. Basically what I'm doing is using regionprops to identify the regions in the image. I now want to build up a copy of the image however omitting specific areas from regionprops based on some criteria. For example I would like to ignor those having a filledarea less than 20.

I've been thinking about subtracting the original image with the regions i want to ignore.. However these are not of the same size and padding would probably be a little messy. I'm sure somewhere there should be an easier solution...

What do you think?

Subject: RegionProps image buildup

From: ImageAnalyst

Date: 10 Mar, 2011 18:00:57

Message: 2 of 4

On Mar 10, 10:21 am, "Aron Sceidt" <sigarr...@gmail.com> wrote:
> I've been thinking for some time about a specific problem. Basically what I'm doing is using regionprops to identify the regions in the image. I now want to build up a copy of the image however omitting specific areas from regionprops based on some criteria. For example I would like to ignor those having a filledarea less than 20.
>
> I've been thinking about subtracting the original image with the regions i want to ignore.. However these are not of the same size and padding would probably be a little messy. I'm sure somewhere there should be an easier solution...
>
> What do you think?

-------------------------------------------------------------------------------
Aron:
The way to do it is to use the ismember() function, as demonstrated in
my BlobsDemo program:
http://www.mathworks.com/matlabcentral/fileexchange/25157
There, I filter based on size and intensity using ismember. Check it
out.
-ImageAnalyst

Subject: RegionProps image buildup

From: Sean de

Date: 10 Mar, 2011 18:27:07

Message: 3 of 4

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <5a444e11-b545-495e-b8f4-49fcef2def66@k15g2000prk.googlegroups.com>...
> On Mar 10, 10:21 am, "Aron Sceidt" <sigarr...@gmail.com> wrote:
> > I've been thinking for some time about a specific problem. Basically what I'm doing is using regionprops to identify the regions in the image. I now want to build up a copy of the image however omitting specific areas from regionprops based on some criteria. For example I would like to ignor those having a filledarea less than 20.
> >
> > I've been thinking about subtracting the original image with the regions i want to ignore.. However these are not of the same size and padding would probably be a little messy. I'm sure somewhere there should be an easier solution...
> >
> > What do you think?
>
> -------------------------------------------------------------------------------
> Aron:
> The way to do it is to use the ismember() function, as demonstrated in
> my BlobsDemo program:
> http://www.mathworks.com/matlabcentral/fileexchange/25157
> There, I filter based on size and intensity using ismember. Check it
> out.
> -ImageAnalyst

You could also use the CC.PixelIdxList directly:

CC = bwconncomp(I);
RP = regionprops(CC,'filledarea')
idx = [RP(:).FilledArea]<20;
I(cell2mat(CC.PixelIdxList(idx)')) = false;

Subject: RegionProps image buildup

From: Aron Sceidt

Date: 11 Mar, 2011 07:10:05

Message: 4 of 4

Managed to work with both options.. thanks to both of you :-)

ImageAnalyst, might actually be using parts of your solution for what I'm doing, thanks!

Tags for 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