getStructuringElement: Structuring Elements

View source: R/filters.R

getStructuringElementR Documentation

Structuring Elements

Description

getStructuringElement is a convenience function to create structuring elements with defined shapes that can be used to filter images with filter2D.

Usage

getStructuringElement(
  k_shape = "rectangle",
  k_height = 5,
  k_width = 5,
  anchor = c(-1, -1)
)

Arguments

k_shape

A string corresponding to the shape of the structuring element. Valid kernel shapes are:

  • "rectangle" (the default):

  • "cross"

  • "ellipse"

k_height

The half-height in pixels of the structuring element.

k_width

The half-width in pixels of the structuring element.

anchor

A 2-element numeric vector defining the anchor position within the cross-shaped structuring element. The default value (−1,−1) means that the anchor is at the center. Note that only the shape of a cross-shaped kernel depends on the anchor position.

Value

A matrix of 0s and 1s.

Author(s)

Simon Garnier, garnier@njit.edu

See Also

filter2D

Examples

getStructuringElement()


swarm-lab/Rvision documentation built on Feb. 7, 2024, 4:59 a.m.