Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在做一个项目,在这个项目中我得到了一个 filter K。我需要:
K
找到一个矩阵 A,使得矩阵 A 的每一行都是与滤波器 K 对应的像素的串联。
K = [ k11 k12 k13 k21 k22 k23 k31 k32 k33]
我找不到A。我正在使用 MATLAB。
A
当您谈论像素时,我假设您想要进行两个维度内核平滑。
作为K一个 3x3 矩阵,我怀疑要确定给定的输入矩阵Image,您可以通过以下方式找到 A 的某个点:
Image
for i = 2:size(Image,1)-1 for j = 2:size(Image,2) -1 A(i,j) = sum(sum( Image(i-1:i+1,j-1:j+1) .* K )) end end
当然,你仍然需要选择如何处理边缘/角落的情况,但我会把它留给你。