How to do a binarization of this image?

조회 수: 2 (최근 30일)
Veronika
Veronika 2016년 9월 8일
댓글: Veronika 2016년 9월 10일
Dear all,
Please, can anybody tell me, how to do a binarization of this image?
Step by step please, I´m new in this section.
Thank you for your answers.

채택된 답변

Image Analyst
Image Analyst 2016년 9월 9일
You can threshold, like
grayImage = rgb2gray(yourRGBImage);
binaryImage = grayImage > someThresholdValue;
imshow(binaryImage);
  댓글 수: 3
Image Analyst
Image Analyst 2016년 9월 9일
You need to pass it a numerical array, not a character array (the filename string). imshow() can work like that but not rgb2gray. Try
grayImage = imread('thorax-mdl.jpg');
% Get the dimensions of the image.
% numberOfColorBands should be = 1.
[rows, columns, numberOfColorChannels] = size(grayImage);
if numberOfColorChannels > 1
% It's not really gray scale like we expected - it's color.
% Convert it to gray scale by taking only the green channel.
grayImage = grayImage(:, :, 2); % Take green channel.
end
Veronika
Veronika 2016년 9월 10일
Finally, it´s working.
Thank you.

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

추가 답변 (1개)

George
George 2016년 9월 8일
Take a look at this example and im2bw.
  댓글 수: 3
George
George 2016년 9월 8일
It's saying that your image isn't grayscale. Take a look at this example.
Image Analyst
Image Analyst 2016년 9월 9일
Then why did you accept the answer if it's not working?

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

카테고리

Help CenterFile Exchange에서 Modify Image Colors에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by