create irregular regions in a RGB image
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Sara Macchiavello
el 1 de Sept. de 2020
Respondida: Pratheek Punchathody
el 4 de Sept. de 2020
Goodmorning,
I'd like to create some irregular regions in a RGB image with an effect similar to contour plots.
I have to work on these regions for example modifying contrast, saturation or luminance into every region created.
As a consequence I think that the drawfreehand and roipoly commands are not suited for my purpose because I saw that they create a mask on which I can't apply transformations named above.
Do you know if is there the possibility to obtain this effect?
Thank you,
Sara
0 comentarios
Respuestas (1)
Pratheek Punchathody
el 4 de Sept. de 2020
Hi Sara,
To my understanding you want to create an irregular regions in the image and modify the variable properties of that regions such as contrast, saturation or luminance.
Please follow this code in which I have created an irregular region in the image using "images.roi.AssistedFreehand()" and "draw()" function.
%%code starts here
I=imread('_DSC2845.jpg');
imshow(I);
shape = images.roi.AssistedFreehand;
draw(shape);
BW = createMask(shape);
BW(:,:,2) = BW;
BW(:,:,3) = BW(:,:,1);
I(BW) = imadjust(I(BW),[0.3 0.8],[]);
imshow(I);
%%code ends here
Basic idea is to create a binary mask for the required irregular region and then perform the modifications to the region and map it to the original image.
This is the original image on top of which the irregular region is created.
The irregular region which is created is modified by changing the contrast and intensity.
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!