how to convert the binarized image to the original gray image
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Khaing Zin Htwe
il 20 Mag 2016
Commentato: Emerson Nithiyaraj
il 20 Mag 2019
Dear all, Hello good morning,
Could you please share your experience how to convert the binarized image to the original image with gray vlaues? THank all.
0 Commenti
Risposta accettata
Walter Roberson
il 21 Mag 2016
You probably want
maskedImage = binaryImage .* originalImage;
3 Commenti
Image Analyst
il 22 Mag 2016
For the future, this operation is called "masking", not "converting" of a binary image to a gray scale image. If original image is an integer, you need to cast binary image to the same class of integer, like
maskedImage = uint8(binaryImage) .* originalImage;
Or initialize and then use the binary image as indexes:
maskedImage = originalImage; % Initialize
maskedImage(~binaryImage) = 0; % Mask
Più risposte (1)
Image Analyst
il 21 Mag 2016
Try this:
binaryImage = grayImage;
Your (formerly) binary image will now be converted into the same array as your gray scale image, so it's now a gray scale image, not a binary image anymore.
Vedere anche
Categorie
Scopri di più su Modify Image Colors in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!