Conversion of Medical image to Blue Ration
Afficher commentaires plus anciens
Respected Members! My task is to convert RGB image to Blue ratio image.
This is the formula of conversion:

and code is
% RGB to Blue Ratio Conversion %--------------------------------------
R= img(:,:,1);
G=img(:,:,2);
B=img(:,:,3);
BR=((100 * B)./(1+R+G)) .* (256./(1+B+R+G)); % formula for conversion
imshow(BR);
The expected output can be seen in this image after running the code.
But when I apply the code...the output is a black image -- there is no sign of anything in image. Here is the input image:

Kindly help. How I can fix this issue so that I can see the contents of image?
Réponse acceptée
Plus de réponses (1)
Image Analyst
le 6 Avr 2014
2 votes
You need to cast to double because (B+R+G) will get clipped at 255 if you dont and just leave them as uint8!!! Then display with [] option in imshow like Dishant showed you.
Catégories
En savoir plus sur Convert Image Type 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!