How to do a binarization of this image?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Dear all,
Please, can anybody tell me, how to do a binarization of this image?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/156212/image.jpeg)
Step by step please, I´m new in this section.
Thank you for your answers.
0 Commenti
Risposta accettata
Image Analyst
il 9 Set 2016
You can threshold, like
grayImage = rgb2gray(yourRGBImage);
binaryImage = grayImage > someThresholdValue;
imshow(binaryImage);
Or see my interactive thresholding app: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862
3 Commenti
Image Analyst
il 9 Set 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
Più risposte (1)
Vedere anche
Categorie
Scopri di più su Image Processing Toolbox in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!