Learn R Programming

imagerExtra (version 1.3.2)

ThresholdFuzzy: Fuzzy Entropy Image Segmentation

Description

automatic fuzzy thresholding based on particle swarm optimization

Usage

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)

Arguments

im

a grayscale image of class cimg

n

swarm size

maxiter

maximum iterative time

omegamax

maximum inertia weight

omegamin

minimum inertia weight

c1

acceleration coefficient

c2

acceleration coefficient

mutrate

rate of gaussian mutation

vmaxcoef

coefficient of maximum velocity

intervalnumber

interval number of histogram

returnvalue

if returnvalue is TRUE, returns a threshold value. if FALSE, returns a pixel set.

Value

a pixsel set or a numeric

References

Linyi Li, Deren Li (2008). Fuzzy entropy image segmentation based on particle swarm optimization. Progress in Natural Science.

Examples

Run this code
# 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