calculateOtsu {CRImage} | R Documentation

## Does Otsu thresholding

### Description

The function applies Otsu thresholding on the image.

### Usage

    calculateOtsu(allGreyValues)

### Arguments

`allGreyValues` | Vector of grey values.

### Details

The function calculates a value which separates the grey value histogram the best in foreground and background.

### Value

the threshold

### Author(s)

Henrik Failmezger, failmezger@cip.ifi.lmu.de

### References

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

### See Also

calculateThreshold localOtsuThreshold

### Examples

    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))

[Package CRImage version 1.32.0 Index]