function integralImage = computeIntegralImage(table)
integralImage = cumsum(table,1); integralImage = cumsum(integralImage,2);
[height width] = size(table);
%set the first row and the first column 0 in the integral image
integralImage =[zeros(height,1) integralImage];
integralImage=[zeros(1,width+1); integralImage];
======================================================
Example: If X = [0 1 2
% 3 4 5]
%
% then cumsum(X,1) is [0 1 2 and cumsum(X,2) is [0 1 3
% 3 5 7] 3 7 12]
https://blog.sciencenet.cn/blog-261330-670680.html
上一篇:
写点文字舒舒心吧。下一篇:
mysql56 服务无法启动