FUNCTION REFERENCE

imdilate

Dilate an image.

Dilate an image.

Syntax

J = imdilate(I, SE)

Grey dilation by a flat element: J(x) is the maximum of I over the positions x - b for the members b of SE (the element reflected about its origin). A logical image gives a logical result (binary dilation); other classes keep their class. Pixels outside the image count as -Inf, so the border never creates values. As in max, NaN is ignored unless every value read is NaN. Each 2-D plane of an N-D image is dilated separately. SE is a strel object or a logical/numeric neighborhood.

Example

imdilate(logical([0 0 0; 0 1 0; 0 0 0]), strel('square', 3))   % true(3)

Example

imdilate(uint8([1 5 2]), [1 1])   % uint8([1 5 5]): J(x) = max(I(x), I(x-1))

Differences from MATLAB: no 'same'/'full' shape argument and no packed binary images. Large flat elements are not decomposed: a call whose work, pixels times neighbourhood reads per pixel (the members of SE; rows plus columns for a full rectangle; twice that for imopen, imclose, imtophat and imbothat), exceeds 2^35 (about 3.4e10) reads is refused before it starts with an error that names the limit; use a smaller element or image.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.