MATLAB 帮助中心
2-D convolution for HVX
Since R2026a
conv2DOut = QHVXIPCV.conv2d(Input,Mask)
conv2DOut = QHVXIPCV.conv2d(Input,Mask) performs a 2-D convolution of the input matrix Input with the structuring element Mask for Hexagon® Vector eXtension.
conv2DOut
Input
Mask
example
collapse all
This example uses:
Create a unit8 matrix. Specify the width of the input matrix as a multiple of 128.
unit8
H = 128; W = 128; A = uint8(rand(H, W));
Create the mask with kernel sizes 3, 5, and 7.
mask3x3 = int8([ 1 2 1;0 0 0;-1 -2 -1 ]); mask5x5 = int8([1 2 3 2 1;... 2 4 5 4 2;... 3 5 6 5 3;... 2 4 5 4 2;... 1 2 3 2 1]); mask7x7 = int8([0 0 1 2 1 0 0;... 0 1 2 3 2 1 0;... 1 2 3 4 3 2 1;... 2 3 4 5 4 3 2;... 1 2 3 4 3 2 1;... 0 1 2 3 2 1 0;... 0 0 0 1 2 1 0]);
Perform convolution of the input matrix and the masks.
out3 = QHVXIPCV.conv2d(A, mask3x3); out5 = QHVXIPCV.conv2d(A, mask5x5); out7 = QHVXIPCV.conv2d(A, mask7x7);
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 the mask size.
Data Types: uint8
uint8
Structuring element, specified as a 2-D square matrix of size 3, 5, or 7.
Data Types: int8
int8
Convolution output of the input matrix and the mask, returned as a matrix.
Introduced in R2026a
HVX Conv2D
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
欧洲
亚太
联系您当地的办事处