f = system.file( "extdata", "SampleFISHgray.jpg", package="FISHalyseR")
img = readImage(f)
t = calculateMaxEntropy(img)
## Threshold grayscale image using the value computed by the Max Entropy method
img[img<t] <- 0
img[img>=t] <- 1
Run the code above in your browser using DataLab