color all pixels in an image black except white pixels
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi! From the attached .png figure [rxcx3] I would like to keep only the white pixels and turn all other pixels to black. How can I do?
0 commentaires
Réponse acceptée
DGM
le 1 Fév 2023
Modifié(e) : DGM
le 1 Fév 2023
Presuming that "white" is [255 255 255] within the context of a uint8 RGB image:
inpict = imread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1280620/example_1.png');
inpict = im2gray(inpict);
mk = inpict == 255;
imshow(mk)
0 commentaires
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!