[討論] 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