Nonparametric Background subtraction classes:
NPBGmodel class
NPBGSubtractor class
KernelLUTable class
you have to rewrite a function to build the background similar to the function BuildNPBGModel. only change the input reading calls..
(BuildNPBGModel is included only as an example and is not part of the code)
The code to call BG building can be something like:
==
NPBGSubtractor * p = new NPBGSubtractor;
BuildNPBGModel(pControls,p,50,100,1,1);
==
where the parameters to this function are:
NPBGSubtractor * BGModel : pointer to the BG model.
unsigned int SequenceLength : number of samples for each pixel.
unsigned int TimeWindowSize : Time window for sampling. for example in the call above, the bg will sample 50 points out of 100 frames. this rate will affect how fast the model adapt.
unsigned char SDEstimationFlag : True means to estimate suitable kernel bandwidth to each pixel, False uses a default value.
unsigned char UseColorRatiosFlag: True means use normalized RGB for color (recommended.)
After initializing the bg, you can use the call
NPBGSubtractor::NBBGSubtraction to actually subtract the background from each new frame:
Ex:
((NPBGSubtractor *)pBGModel)->NBBGSubtraction(Frame,FGImage,FilteredFGImage,DisplayBuffers);
parameters are:
unsigned char * Frame : new frame
unsigned char * FGImage : to pass out the resulted FG (must be allocated before call) size imagerows x imagecols unsigned char
unsigned char * FilteredFGImage : to pass out a filtered version of the FG. size imagerows x imagecols unsigned char
unsigned char ** DisplayBuffers : a list of buffers for processing (Array of pointers to unsigned char buffers, each of size imagerows x imagecols)
At each frame also you can call the update function to adapt the bg
NPBGSubtractor::Update(unsigned char * FGMask)
here you pass a mask where pixels with true value will be masked out of the update.
you can change the threshold values using:
void SetThresholds(double th, double alpha)
th: 0-1 is the probability threshold for a pixel to be a foregroud. typically make it small as 10e-8. the smaller the value the less false positive and more false negative.
alpha: 0-1, for color. typically set to 0.3. this affect shadow
suppression.
Please let me know if you have any questions. elgammal@cs.rutgers.edu
没有合适的资源?快使用搜索试试~ 我知道了~
非参数背景建模程序(完整的工程,注释)
共33个文件
sbr:5个
cpp:5个
obj:4个
5星 · 超过95%的资源 需积分: 9 68 下载量 43 浏览量
2011-03-30
09:08:31
上传
评论 1
收藏 3.57MB RAR 举报
温馨提示
本文件是一个完整的工程文件,基于VC6.0开发的,里面的程序都是本人已经调试好,并有非常完整详细的注释,还包括非参数背景建模的经典论文《Background and Foreground Modeling Using Nonparametric Kernel Density Estimation for Visual Surveillance》。本程序是在AhmedElgammal写的类基础之上修改的!
资源推荐
资源详情
资源评论
收起资源包目录
非参数程序AhmedElgammal.rar (33个子文件)
程序AhmedElgammal
NPBGBuild.cpp 4KB
10[1].1.1.20.215.pdf 397KB
NPBGSubtractor.h 4KB
AhmedElgammal.dsw 534B
Controls.h 1KB
KernelTable.h 2KB
AhmedElgammal.plg 1KB
AhmedElgammal.dsp 5KB
AhmedElgammal.opt 56KB
AhmedElgammal.ncb 89KB
main.cpp 5KB
NPBGmodel.h 3KB
NPBGmodel.cpp 4KB
KernelTable.cpp 3KB
Debug
AhmedElgammal.exe 220KB
NPBGSubtractor.sbr 0B
NPBGSubtractor.obj 37KB
AhmedElgammal.pch 7.03MB
NPBGmodel.sbr 0B
vc60.idb 233KB
AhmedElgammal.ilk 400KB
KernelTable.obj 5KB
main.obj 30KB
AhmedElgammal.bsc 5.09MB
NPBGBuild.sbr 0B
AhmedElgammal.pdb 537KB
vc60.pdb 140KB
NPBGmodel.obj 6KB
KernelTable.sbr 0B
main.sbr 0B
NPBGSubtractor.obj.enc 37KB
NPBGSubtractor.cpp 32KB
readme.txt 2KB
共 33 条
- 1
wly603
- 粉丝: 8
- 资源: 9
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
前往页