How to run a function on a specific area in mask image
Mostrar comentarios más antiguos
Hi,
I'm trying to run a 2D gaussian function on a specific mask area but with no luck.
I use bwlabel command to select the first area:
[lab,num]=bwlabel(img2);
I=lab==1;
figure
imshow(I)
I have multiple mask area so if I want to apply the gaussian function for the first three area what I sould write? and how to apply the gaussian function?
Kind Regards,
Respuestas (1)
Image Analyst
el 12 de En. de 2021
0 votos
Apply the blurring function to the whole image, then multiply the mask by the blurred image.
8 comentarios
Z998567
el 12 de En. de 2021
Image Analyst
el 12 de En. de 2021
What code do you need to apply to the left column, and what code do you need to apply to the whole image?
Z998567
el 12 de En. de 2021
Walter Roberson
el 12 de En. de 2021
Apply each blurring function in turn to the whole image, getting out separate results. Multiply each separate result by the mask appropriate to it. Add the results.
Z998567
el 12 de En. de 2021
Walter Roberson
el 12 de En. de 2021
I do not know what the calculations are for density profile.
For histogram, run the histogram on Image(Mask) since histograms do not care about the spatial order of the data.
Image Analyst
el 12 de En. de 2021
"I want to apply a 2d gaussian function on the left one and the right one I want to apply different function." <== Wow, you're not making this easy are you? Not sure why
- you're not telling us the two functions
- there are two different functions
- you're not telling us if the image is gray scale or color, and
- you're not atttaching the image that is to be filtered
- you're delaying an answer by not giving us everything we need up front to help you.
Categorías
Más información sobre Region and Image Properties en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!