Erosion: Morphological Erosion

Description Usage Arguments Value References Examples

Description

This function is used to perform morphological erosion of an image.

Usage

1
erosion(imagefile, mask = matrix(1, 3, 3))

Arguments

imagefile

a binary matrix of the segmented image.

mask

a matrix constructed by structuring elements.

Value

a binary matrix of the eroded image.

References

Image Analysis and Mathematical Morphology by Jean Serra, ISBN 0-12-637240-3 (1982)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
#read an RGB image
library(png)
image = readPNG(system.file("extdata", "image1.png",
                             package = "implant",
                             mustWork = TRUE))[ , ,c(1:3)]

imageB = imageBinary(image, weight = c(-1, 2, -1),
                     threshold1 = 30 / 255,
                     threshold2 = 0.075)

imageBE = erosion(imageB, mask = matrix(1, 5, 5))

rwang14/implant documentation built on Sept. 6, 2020, 3:21 a.m.