View source: R/otsu_threshold_smoothed.R
otsu_threshold_smoothed | R Documentation |
This is an internal function that applies Otsu's thresholding to a smoothed histogram to determine the optimal threshold for image segmentation. It is not intended for direct use by package users.
otsu_threshold_smoothed(hist_vals, mids)
hist_vals |
A numeric vector of histogram counts. |
mids |
A numeric vector of histogram bin midpoints. |
The optimal threshold value.
hist_vals <- hist(rnorm(1000), plot = FALSE)$counts
mids <- hist(rnorm(1000), plot = FALSE)$mids
threshold <- otsu_threshold_smoothed(hist_vals, mids)
print(threshold)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.