converting binary image to rgb image back after enhancing to show the enhancement
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi, I converted my rgb tif image to binary image to apply morphological filters for enhancing .Now i want to convert the final binary image to rgb iamge to show the enhanced result.How can i do it? please help me
0 Kommentare
Antworten (2)
Image Analyst
am 18 Apr. 2013
You don't need to. There is nothing whatsoever to be gained by converting a binary image (of class "logical" and values of true/false or 1/0) to an RGB image. If you really wanted to for some reason, you could create a 3D RGB image like this:
rgbImage = 255 * cat(3, binaryImage, binaryImage, binaryImage);
though it will look pure black (0) and pure white (255) with no gray scale pixels and no "color" pixels. Again, this is not necessary to view the binary image so that you can see the "enhanced result" - you can see the image just fine passing it to imshow().
0 Kommentare
Sean de Wolski
am 18 Apr. 2013
Bearbeitet: Sean de Wolski
am 18 Apr. 2013
You could use label2rgb() to do this.
doc label2rgb
Then you can pick your two colors. Or you could just show it with a colormap:
imshow(rand(100)>0.6,jet(2))
This is probably a better solution since, like IA said, there is nothing to be gained by converting to RGB other than for visualization sake.
0 Kommentare
Siehe auch
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!