Learn R Programming

imagerExtra (version 1.3.2)

ThresholdTriclass: Iterative Triclass Thresholding

Description

compute threshold value by Iterative Triclass Threshold Technique

Usage

ThresholdTriclass(im, stopval = 0.01, repeatnum, intervalnumber = 1000,
  returnvalue = FALSE)

Arguments

im

a grayscale image of class cimg

stopval

value to determine whether stop iteration of triclass thresholding or not. Note that if repeat is set, stop is ignored.

repeatnum

number of repetition of triclass thresholding

intervalnumber

interval number of histogram

returnvalue

if returnvalue is TRUE, ThresholdTriclass returns threshold value. if FALSE, ThresholdTriclass returns pixset.

Value

a pixel set or a numeric

References

Cai HM, Yang Z, Cao XH, Xia WM, Xu XY (2014). A New Iterative Triclass Thresholding Technique in Image Segmentation. IEEE TRANSACTIONS ON IMAGE PROCESSING.

Examples

Run this code
# NOT RUN {
g <- grayscale(boats)
layout(matrix(1:4, 2, 2))
plot(boats, main = "Original")
plot(g, main = "Grayscale")
threshold(g) %>% plot(main = "A Variant of Otsu")
ThresholdTriclass(g) %>% plot(main = "Triclass")
# }

Run the code above in your browser using DataLab