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:
Image segmentation

Subject: Image segmentation

From: Joshua

Date: 8 Nov, 2010 15:43:03

Message: 1 of 4

Hi, i'm new to matlab. would like to do segmentation on an images of vehicles for vehicle classifcation task.

I have a set of images (with vehicles on them)
and a set of masks for each images (which is a black and white image with the black portion cover the background of the vehicle image perfectly).

Now, what i wana do is to segment the image based on the mask given.
How do i do it?

Subject: Image segmentation

From: Sean

Date: 8 Nov, 2010 16:05:05

Message: 2 of 4

"Joshua " <junyeeng@yahoo.com> wrote in message <ib95q7$13e$1@fred.mathworks.com>...
> Hi, i'm new to matlab. would like to do segmentation on an images of vehicles for vehicle classifcation task.
>
> I have a set of images (with vehicles on them)
> and a set of masks for each images (which is a black and white image with the black portion cover the background of the vehicle image perfectly).
>
> Now, what i wana do is to segment the image based on the mask given.
> How do i do it?

M = logical mask;
I = image;

I_of_mask = I.*cast(M,class(I));

For RGB images;
I_of_mask = bsxfun(@times,I,cast(M,class(I)));

Subject: Image segmentation

From: ImageAnalyst

Date: 8 Nov, 2010 16:25:12

Message: 3 of 4

Once you have your masked image like Sean showed you, then you can do
image segmentation on it like in this demo:
http://www.mathworks.com/matlabcentral/fileexchange/25157

Subject: Image segmentation

From: Joshua

Date: 8 Nov, 2010 18:43:04

Message: 4 of 4

"Sean " <sean.dewolski@nospamplease.umit.maine.edu> wrote in message <ib973h$qd4$1@fred.mathworks.com>...
> > How do i do it?
>
> M = logical mask;
> I = image;
>
> I_of_mask = I.*cast(M,class(I));
>
> For RGB images;
> I_of_mask = bsxfun(@times,I,cast(M,class(I)));


Many thanks indeed

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