momentbyrs.m

来自「fast calculation of image moments base」· M 代码 · 共 12 行

M
12
字号
function m=momentbyRS(B,p,q,R,S)
%fast calculation of image
%moments based on Fluss and Tuk's method described in 
%"On the Calculation of Moments"

%B - binary image matrix
%R,S - previously generated matrices

d=filter2([1,-1],B);
[i,j]=find(d==-1);
[k,l]=find(d==1);
m=S(p+1,l)*R(q+1,k)'-S(p+1,j)*R(q+1,i)';

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?