calculateThreshold: Compute threshold using Otsu's method

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/calculateThreshold.R

Description

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

Usage

1

Arguments

Image

grayscale image

Details

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

Value

calculateThreshold returns the threshold value

Author(s)

Karesh Arunakirinathan

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

1
2
3
4
5
6
7
8
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

FISHalyseR documentation built on Nov. 8, 2020, 5:30 p.m.