getstructuringelementcv
Gets a structuring element that can be used for morphological commands on an image.
Syntax
R = getstructuringelementcv(shape, kernelsize)
R = getstructuringelementcv(shape, kernelsize, anchor)
Inputs
- shape
- Shape of R. Valid values are:
- kernelsize
- Vector of two positive integers representing [width, height] of R.
- anchor
- Optional vector of 2 integers specifying anchor position of the element. Default value is [-1 -1], indicating the center of the kernel. Only option 2 of shape depends on anchor.
Outputs
- R
- Handle of the resulting structural element.
Example
handle = imreadcv('image1.jpg');
kernel = getstructuringelementcv(1, [10 10]);
result = dilatecv(handle, kernel, [-1 -1], 1, 0, [255 0 0]);