dilateOut = hexagon.hvx.dilate3x3(Input)
performs 2-D grayscale dilation of the input matrix Input with a 3-by-3
square structuring element for Hexagon® Vector eXtension (HVX).
%% Create a simple binary-style image (uint8)
H = 100; W = 128;
img = zeros(H, W, 'uint8');
% Draw two white squares
img(30:35, 30:35) = 255; % Square 1
img(60:65, 80:85) = 255; % Square 2
To apply dilation to the grayscale image with different kernel sizes, use the hexagon.hvx.dilate3x3, hexagon.hvx.dilate5x5, and hexagon.hvx.dilate3x3 functions.