How to compute threshold by dividing the histogram of the image into 2 classes?
2 views (last 30 days)
Show older comments
How to compute threshold by dividing the histogram of the image into two classes and calculates the optimum threshold T that separates these two classes so that their combined spread (intraclass variance) to be minimal.
Please can someone help me...
i found histogram of image
histgray = imhist(denoisedImage);
then how to get the value that separates two classes... please do reply...
0 Comments
Accepted Answer
Gemma Rotger
on 10 Jun 2014
I think what you need is Otsu image global threshold,
I = imread('myimage.png');
level = graythresh(I);
This function performs the gray-level histogram and select the optimal threshold by the discriminant criterion so as to maximize the separability of the resultant classes in gray levels.
Type edit graythresh on your Matlab console to watch the code.
0 Comments
More Answers (1)
HARI OM
on 1 May 2017
hello , i also suffer this problem from last month . Please suggest me that how to divide the histogram of an image in sub-histogram on the basis of median of an image. thank you.
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!