How to get the threshold value from Otsu's method?
11 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
According to their documentation, they both calculate the threshold value by using Otsu's method.
I tried this with the coins.png image:
using otsuthresh function:
img = imread('coins.png');
[counts,x] = imhist(img,16);
stem(x,counts);
T = otsuthresh(counts);
BW = imbinarize(imgNorm,T);
subplot(1,2,1)
imshow(img); title('original image');
subplot(1,2,2)
imshow(BW); title('binary image');
T = 0.467
using graythresh function:
img = imread('coins.png');
T = graythresh(img);
BW = imbinarize(img,T);
subplot(1,2,1)
imshow(img); title('original image');
subplot(1,2,2)
imshow(BW); title('binary image');
T = 0.494
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/395398/image.png)
I have two questions:
- What is the difference between these two thresholds? and which one refers to global thresholding method?
- How can I get the gray-level value at the threshold? (where is the threshold at the horizontal axis in the histogram?)
0 comentarios
Respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!