|
"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)));
|