how to get binary image from histogram?

I'm new to matlab. Some on please help me to obtain binary segmentation form histogram.
thank you

Antworten (1)

Image Analyst
Image Analyst am 13 Mär. 2014

0 Stimmen

You pick a threshold and then do
binaryImage = grayImage < thresholdValue;
if you want any more advice, post an image and say what you want to find or measure. The threshold can be chosen form the histogram, for example from my interactive thresholding application: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862

4 Kommentare

Ibrahim Thorig
Ibrahim Thorig am 13 Mär. 2014
Dear;
thank you for the support. I actually want get history gram of the attached and convert the history gram to binary segment.
thanks
Image Analyst
Image Analyst am 13 Mär. 2014
I don't know what a history gram is. Can you explain it? And what part of the image do you want to be true and what part to be false?
Ibrahim Thorig
Ibrahim Thorig am 14 Mär. 2014
sorry its histogram, initially generate histogram of the image, then remove background, so the only white area (image) should show.
[pixelCounts, grayLevels] = imhist(grayImage, 256);
binaryImage = grayImage < 128;
Do the above thresholding for each color channel and then AND the 3 binary images to get the overall binary image for the color image.

Melden Sie sich an, um zu kommentieren.

Gefragt:

am 13 Mär. 2014

Kommentiert:

am 14 Mär. 2014

Community Treasure Hunt

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

Start Hunting!

Translated by