convert a binary image to RGB color space
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello, I have RGB image that I converted to binary to do some processing and I want to reconvert it back to its original color RGB, is it possible? I did some researchs on the internet but unfortunately I couldn't find a good answer. thank you in advance.
0 commentaires
Réponses (2)
Walter Roberson
le 24 Août 2015
No it is not possible. However, you can take
FilteredImage = repmat(YourBinaryImage, 1, 1, 3) .* YourColorImage;
if what you are doing is using YourBinaryImage to select which pixels should become black in your color image.
0 commentaires
Image Analyst
le 24 Août 2015
You can't convert the binary image, but fortunately you should still have the original RGB image, don't you? If not, why not?
5 commentaires
Walter Roberson
le 28 Août 2015
32 rows * 32 columns * 3 colors * 8 bits = 24576 bits embedded. Regroup the 8 bits and convert to bytes = 32 * 32 * 3 = 3072 bytes which happens to be 1024 * 3. I do not know where your factor of 2 came from: check to see how many bits your code embeds and how many bits it extracts. Once you get it down to 1024 * 3 then you rehape() that to 32 * 32 * 3.
1024 * 6 would make sense if your image is composed of uint16 instead of uint8, which is possible but not all that common.
Voir également
Catégories
En savoir plus sur Convert Image Type dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!