Conversion of Medical image to Blue Ration
1 回表示 (過去 30 日間)
古いコメントを表示
Respected Members! My task is to convert RGB image to Blue ratio image.
This is the formula of conversion:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/160316/image.png)
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:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/160319/image.png)
Kindly help. How I can fix this issue so that I can see the contents of image?
0 件のコメント
採用された回答
Dishant Arora
2014 年 4 月 6 日
use:
imshow(BR , [])
Or
imagesc(BR)
3 件のコメント
Dishant Arora
2014 年 4 月 7 日
Use your image as it is for further processing or cast it to double using im2double as Image Analyst said.
その他の回答 (1 件)
Image Analyst
2014 年 4 月 6 日
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.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Convert Image Type についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!