View source: R/utils_segmentation.R
otsu | R Documentation |
Given a numeric vector with the pixel's intensities, returns the threshold value based on Otsu's method, which minimizes the combined intra-class variance
otsu(values)
values |
A numeric vector with the pixel values. |
A double (threshold value).
Otsu, N. 1979. Threshold selection method from gray-level histograms. IEEE Trans Syst Man Cybern SMC-9(1): 62–66. doi: \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1109/tsmc.1979.4310076")}
img <- image_pliman("soybean_touch.jpg")
thresh <- otsu(img@.Data[,,3])
plot(img[,,3] < thresh)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.