Replace the white region in an binary image with Green ? and black colour unaffected
Afficher commentaires plus anciens
I Will read my input image as binary.(may be logical or uint8). The output must be Image with green colours in white region and black remains the same.
Réponse acceptée
Plus de réponses (1)
Image Analyst
le 28 Août 2014
Anand, if you want an RGB image instead of a pseudocolored logical image (with values of 0 and 1) then you need to do this:
grayImage = uint8(255 * BIN); % BIN is from Joseph's code.
blackImage = zeros(size(grayImage), 'uint8');
rgbImage = cat(3, blackImage , grayImage, blackImage); % Only green channel is non-zero.
imshow(rgbImage);
imwrite(rgbImage, fullFileName);
1 commentaire
Anand
le 29 Août 2014
Catégories
En savoir plus sur Blue dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!