how can i get grayscale color in my binary image?

조회 수: 2 (최근 30일)
Farah Nadiah
Farah Nadiah 2016년 5월 14일
답변: Image Analyst 2016년 5월 14일
i want the intensity color in my binary image because after i get that i want to use threshold adaptive method. because in threshold i want to differentiate the dark intensity and bright. within by use threshold i can get only the image i want...thank you.
  댓글 수: 2
Image Analyst
Image Analyst 2016년 5월 14일
Well, sorry but that makes no sense for several reasons. Why don't you just post your binary image, and original color or gray scale image if you have one? Then read this link and tell us what you want to measure, and we'll tell you the best approach.
Farah Nadiah
Farah Nadiah 2016년 5월 14일
this is my grayscale image
this is my binary image
i want in binary that have their grayscale intensity because i want to detect the small dot and to do threshold at the result image..thank you

댓글을 달려면 로그인하십시오.

답변 (2개)

Walter Roberson
Walter Roberson 2016년 5월 14일
If you have a binary image, BW, then the intensity image that corresponds is
IntensityImage = double(BW);
  댓글 수: 1
Walter Roberson
Walter Roberson 2016년 5월 14일
A binary image by definition is exactly two intensities. A binary image cannot have grayscale intensity.
What you probably want is to use .* to multiply your binary image by your grayscale image. The result will be a grayscale image that is 0 everywhere the binary image was 0.

댓글을 달려면 로그인하십시오.


Image Analyst
Image Analyst 2016년 5월 14일
You can mask your image to show only the pixels in the binary blob locations but with their original grayscale intensity like this:
outputImage = grayImage; % Initialize
% Now make black in binary image black in the gray scale image.
outputImage(~binaryImage) = 0; % Be sure to use the ~ tilde!
imshow(outputImage, []); % Or don't use [] if you don't want it to scale intensity.

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by