Conversion of Medical image to Blue Ration

조회 수: 4 (최근 30일)
Tahir
Tahir 2014년 4월 6일
댓글: Dishant Arora 2014년 4월 7일
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?

채택된 답변

Dishant Arora
Dishant Arora 2014년 4월 6일
use:
imshow(BR , [])
Or
imagesc(BR)
  댓글 수: 3
Tahir
Tahir 2014년 4월 6일
편집: Image Analyst 2014년 4월 6일
I have to use this image for further processing ...what can i do next..the output is 100% correct...but for further processing what i do.
imshow(BR , []);
i have to apply filter on this image.reply plz
[EDIT]
The issue is solved after obeying the instruction from him..Good job sir.
Dishant Arora
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
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.

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by