hailuo0112的个人博客分享 http://blog.sciencenet.cn/u/hailuo0112

博文

积分图计算程序

已有 4477 次阅读 2013-3-15 22:46 |个人分类:matlab|系统分类:科研笔记| 程序, 积分

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 服务无法启动
收藏 IP: 219.143.205.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-5-12 21:03

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部