Contenu principal

QHVXIPCV.dilate7x7

2-D grayscale dilation with a 7-by-7 square structuring element for HVX

Since R2026a

Description

dilateOut = QHVXIPCV.dilate7x7(Input) performs 2-D grayscale dilation of the input matrix Input with a 7-by-7 square structuring element for Hexagon® Vector eXtension (HVX).

example

Examples

collapse all

Create a grayscale image with two bright squares.

%% 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 QHVXIPCV.dilate3x3, QHVXIPCV.dilate5x5, and QHVXIPCV.dilate3x3 functions.

%% Apply dilation with different kernel sizes
out3 = QHVXIPCV.dilate3x3(img);   % 3x3 kernel
out5 = QHVXIPCV.dilate5x5(img);   % 5x5 kernel
out7 = QHVXIPCV.dilate7x7(img);   % 7x7 kernel

Visualize the original and dilated images.

tiledlayout(2,2,'TileSpacing','compact','Padding','compact');
nexttile
imshow(img, []);  
title('Original Image');
nexttile
imshow(out3, []); 
title('Dilated Image Using 3×3 Kernel');
nexttile
imshow(out5, []); 
title('Dilated Image Using 5×5 Kernel');
nexttile
imshow(out7, []); 
title('Dilated Image Using 7x7 Kernel')

Figure contains 4 axes objects. Hidden axes object 1 with title Original Image contains an object of type image. Hidden axes object 2 with title Dilated Image Using 3×3 Kernel contains an object of type image. Hidden axes object 3 with title Dilated Image Using 5×5 Kernel contains an object of type image. Hidden axes object 4 with title Dilated Image Using 7x7 Kernel contains an object of type image.

Input Arguments

collapse all

2-D input, specified as a matrix whose width is a multiple of 128. The height of the matrix must be greater than or equal to 7.

Data Types: uint8

Output Arguments

collapse all

Dilation result of 2-D grayscale dilation on the input matrix.

Version History

Introduced in R2026a