[Scilab-users] image area mask for applying for filter

Philipp Mühlmann p.muehlmann at gmail.com
Sat Dec 10 23:31:22 CET 2016


Hi Erhy,

please find a code snipplet for extrascting an area of interest from an
image.

Way 1:
mask is extracted from original image and stored as a new variable.

original_img = rand(100,100).*256;
extract_img = original_img (25:74,25:74);


Way 2:
make a copy of the original image   // to keep the original values...just
in case
directly process the copy


original_img = rand(100,100).*256;
filtered_img = original_img;filtered_img(25:75,25:74) = 0;
Matplot(filtered_img)


Of course this example is more grayscale related, but you can do this as
well for RGB images.

original_img_R = rand(100,100).*256;original_img_G =
rand(100,100).*256;original_img_B = rand(100,100).*256;
original_RGB(:,:,1) = original_img_R;original_RGB(:,:,2) =
original_img_G;original_RGB(:,:,3) = original_img_B;
filtered_RGB = original_RGB;filtered_RGB(25:75,25:75,:)=0;
ShowColorImage(filtered_RGB,'');   // Note: ShowColorImage is part of
the IPD toolbox.

HTH

Philipp















2016-12-10 21:34 GMT+01:00 Erhy <erhard.glueck.austria at gmail.com>:

> Hello!
> My interest ist to image processing.
> Are there tools to mask an area of an image,
> that a filter is only applied for the masked area?
>
> Thank you for tips
> Erhy
>
>
>
> --
> View this message in context: http://mailinglists.scilab.
> org/image-area-mask-for-applying-for-filter-tp4035216.html
> Sent from the Scilab users - Mailing Lists Archives mailing list archive
> at Nabble.com.
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>



-- 
In Kanada is' ka' na' da. Sonst wär' Kanada Jemanda.

There we have the salad.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20161210/6c2176c3/attachment.htm>


More information about the users mailing list