Learn R Programming

FISHalyseR (version 1.6.2)

calculateThreshold: Compute threshold using Otsu's method

Description

Computes the binary image of a grayscale image by using Otsu thresholding

Usage

calculateThreshold(Image)

Arguments

Image
grayscale image

Value

calculateThreshold returns the threshold value

Details

The function computes a binary image using Otsu's method.

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

calculateMaxEntropy

Examples

Run this code
f = system.file( "extdata", "SampleFISHgray.jpg", package="FISHalyseR")
img = readImage(f)

t = calculateThreshold(img)

##Threshold image using the value computed via Otsu's method
img[img<t] <- 0
img[img>=t] <- 1

Run the code above in your browser using DataLab