powered by
automatic fuzzy thresholding based on particle swarm optimization
ThresholdFuzzy(im, n = 50, maxiter = 100, omegamax = 0.9, omegamin = 0.1, c1 = 2, c2 = 2, mutrate = 0.2, vmaxcoef = 0.1, intervalnumber = 1000, returnvalue = FALSE)
a grayscale image of class cimg
swarm size
maximum iterative time
maximum inertia weight
minimum inertia weight
acceleration coefficient
rate of gaussian mutation
coefficient of maximum velocity
interval number of histogram
if returnvalue is TRUE, returns a threshold value. if FALSE, returns a pixel set.
a pixsel set or a numeric
Linyi Li, Deren Li (2008). Fuzzy entropy image segmentation based on particle swarm optimization. Progress in Natural Science.
# NOT RUN { g <- grayscale(boats) layout(matrix(1:2, 1, 2)) plot(g, main = "Original") ThresholdFuzzy(g) %>% plot(main = "Fuzzy Thresholding") # }
Run the code above in your browser using DataLab