This function performs the Guo-Hall thinning algorithm (Guo and Hall, 1989) on a binary image or a list of binary images.
image_thinning_guo_hall(
img,
parallel = FALSE,
workers = NULL,
verbose = TRUE,
plot = FALSE,
...
)
If img
is a single binary image, the function returns the
thinned binary image. If img
is a list of binary images, the
function returns a list containing the thinned binary images.
The binary image or a list of binary images to be thinned. It can be either a single binary image of class 'Image' or a list of binary images.
Logical, whether to perform thinning using multiple cores (parallel processing). If TRUE, the function will use multiple cores for processing if available. Default is FALSE.
Integer, the number of workers (cores) to use for parallel processing. If NULL (default), it will use 40% of available cores.
Logical, whether to display progress messages during parallel processing. Default is TRUE.
Logical, whether to plot the thinned images. Default is FALSE.
Additional arguments to be passed to image_binary()
if
img
is not a binary image.
Guo, Z., and R.W. Hall. 1989. Parallel thinning with two-subiteration algorithms. Commun. ACM 32(3): 359–373. tools:::Rd_expr_doi("10.1145/62065.62074")
library(pliman)
img <- image_pliman("potato_leaves.jpg", plot = TRUE)
image_thinning_guo_hall(img, index = "R", plot = TRUE)
Run the code above in your browser using DataLab