作者Portentera (SupP)
看板MATLAB
标题[讨论] for回圈 如何改成矩阵运算
时间Thu Oct 8 12:31:27 2015
这是一个影像滤波的回圈
Img is input image. (h, v) is image isze.
F is filter matrix. (F_h, F_v) is filter size.
fI is filtering image.
for i=1:h
for j=1:v
R = Img( i:i+F_h, j:j+F_v );
fI(i,j) = sum(sum(R .* F));
end
end
刚开始学习用Matlab,只会使用for回圈解决问题;
想学习如何改写成矩阵运算,感谢大大们解惑!
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 140.123.111.218
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/MATLAB/M.1444278690.A.152.html