You are here : matlabImage Processingimdilate

imdilate() - Image Processing

IM2 = imdilate(IM,SE) dilates the grayscale,
binary, or packed binary image IM, returning the
dilated image, IM2. The argument SE is
a structuring element object, or array of structuring element objects,
returned by the strel or offsetstrel function. If IM is logical, the structuring element
must be flat and imdilate performs binary dilation.
Otherwise, imdilate performs grayscale dilation.
If SE is an array of structuring element objects, imdilate performs
multiple dilations of the input image, using each structuring element
in succession. IM2 = imdilate(IM,NHOOD) dilates the image IM,
where NHOOD is a matrix of 0's and 1's that specifies
the structuring element neighborhood. This is equivalent to the syntax imdilate(IM,strel(NHOOD)).
The imdilate function determines the center element
of the neighborhood by floor((size(NHOOD)+1)/2).IM2 = imdilate(___,PACKOPT) specifies
whether IM is a packed binary image. PACKOPT can
have either of the following values. Default value is enclosed in
braces ({}).ValueDescription
'ispacked'IM is treated as a packed binary image
as produced by bwpack. IM must
be a 2-D uint32 array and SE must
be a flat 2-D structuring element. If the value of PACKOPT is 'ispacked', PADOPT must
be 'same'.
{'notpacked'}IM is treated as a normal array.
IM2 = imdilate(___,SHAPE) specifies
the size of the output image. SHAPE can have either
of the following values. Default value is enclosed in braces ({}).ValueDescription
{'same'}Make the output image the same size as the input image.
If the value of PACKOPT is 'ispacked', SHAPE must
be 'same'.
'full'Compute the full dilation.
gpuarrayIM2 = imdilate(gpuarrayIM,___) performs
the operation on a graphics processing unit (GPU), where gpuarrayIM is
a gpuArray that contains a grayscale or binary
image. gpuarrayIM2 is a gpuArray of
the same class as the input image. Note that the PACKOPT syntax
is not supported on a GPU. This syntax requires the Parallel Computing Toolbox™.Code Generation support:
Yes.MATLAB Function Block support:
Yes.


Syntax

IM2 = imdilate(IM,SE)IM2 = imdilate(IM,NHOOD)IM2 = imdilate(___,PACKOPT)IM2 = imdilate(___,SHAPE)gpuarrayIM2 = imdilate(gpuarrayIM,___)


Example

originalBW = imread('text.png');


Output / Return Value


Limitations


Alternatives / See Also


Reference