[讨论] for循环 如何改成矩阵运算

楼主: Portentera (SupP)   2015-10-08 12:31:27
这是一个影像滤波的循环
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循环解决问题;
想学习如何改写成矩阵运算,感谢大大们解惑!

Links booklink

Contact Us: admin [ a t ] ucptt.com