Refactoring of ThresholdFuzzy


I refactored the code of ThresholdFuzzy.

Now, ThresholdFuzzy searches best parameters in a discrete manner.

The search in a discrete manner brings a convergence of the results as shown below.

library(devtools)
install_github("ShotaOchi/imagerExtra")
library(imagerExtra)
a <- load.image("http://gahag.net/img/201604/21s/gahag-0078436493-1.jpg") %>% grayscale()
test <- sapply(1:1000, function(x) ThresholdFuzzy(a, returnvalue = TRUE))
var(test)
[1] 0
max(test)
[1] 0.2383767
min(test)
[1] 0.2383767