How to do a binarization of this image?

1 Ansicht (letzte 30 Tage)
Veronika
Veronika am 8 Sep. 2016
Kommentiert: Veronika am 10 Sep. 2016
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.

Akzeptierte Antwort

Image Analyst
Image Analyst am 9 Sep. 2016
You can threshold, like
grayImage = rgb2gray(yourRGBImage);
binaryImage = grayImage > someThresholdValue;
imshow(binaryImage);
  3 Kommentare
Image Analyst
Image Analyst am 9 Sep. 2016
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 am 10 Sep. 2016
Finally, it´s working.
Thank you.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

George
George am 8 Sep. 2016
Take a look at this example and im2bw.
  3 Kommentare
George
George am 8 Sep. 2016
It's saying that your image isn't grayscale. Take a look at this example.
Image Analyst
Image Analyst am 9 Sep. 2016
Then why did you accept the answer if it's not working?

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Image Processing Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by