Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/calculateOtsu.R
The function applies Otsu thresholding on the image.
1 | calculateOtsu(allGreyValues)
|
allGreyValues |
Vector of grey values. |
The function calculates a value which separates the grey value histogram the best in foreground and background.
the threshold
Henrik Failmezger, failmezger@cip.ifi.lmu.de
Nobuyuki Otsu: A threshold selection method from grey level histograms. In: IEEE Transactions on Systems, Man, and Cybernetics. New York 9.1979, S.62-66. ISSN 1083-4419
calculateThreshold localOtsuThreshold
1 2 3 4 5 6 7 8 | f1= system.file("extdata", "exImg2.jpg", package="CRImage")
print(f1)
img=readImage(f1)
print(img)
#convert to grayscale
imgG=EBImage::channel(img,'grey')
#threshold value
t=calculateOtsu(as.vector(imgG))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.