genrs.m

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

M
13
字号
function [R,S]=genRS(N,r)
%generates matrices R and S for the calculation of image
%moments based on Fluss and Tuk's method described in 
%"On the Calculation of Moments"

%N-expected image size
%r-maximum index of moments needed

pm=r+1;
R1=ones(pm,1)*linspace(1,N,N);
R2=linspace(0,r,pm)'*ones(1,N);
R=R1.^R2;
S=R*triu(ones(N));

⌨️ 快捷键说明

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