资源简介

这是一个运动检测,背景建模的程序,实现了多种方法,使用了opencv。 用源代码,以及编译好的可运行的程序。

资源截图

代码片段和文件信息

#include “highgui.h“
#include 
#include 
#include “cvaux.h“
#include “codeb.h“

int CVCONTOUR_APPROX_LEVEL = 2;   
int CVCLOSE_ITR = 1;

#define CV_CVX_WHITE CV_RGB(0xff0xff0xff)
#define CV_CVX_BLACK CV_RGB(0x000x000x00)

codeBook* cA;
codeBook* cC;
codeBook* cD;  
int maxMod[CHANNELS];
int minMod[CHANNELS]; 
unsigned cbBounds[CHANNELS]; 
bool ch[CHANNELS];
int nChannels = CHANNELS;
int imageLen = 0;
uchar *pColor;
int Td; 
int Tadd; 
int Tdel; 
int T=50; 
int Fadd=35;
int Tavgstale=50;
int Fd=2;
int Tavgstale_cD=50;
int fgcount=0;
float beta=0.1f;
float gamma=0.1f;
float forgratio=0.0f;
float Tadap_update=0.4f;

int clear_stale_entries(codeBook &c);
uchar background_Diff(uchar *p codeBook &c int numChannels int *minMod int *maxMod);
int update_codebook_model(uchar* pcodeBook& cunsigned* cbBoundsint numChannels);              
int trainig_codebook(uchar* pcodeBook& cunsigned* cbBoundsint numChannels);
int training_clear_stale_entries(codeBook &c);
int det_update_codebook_cC(uchar* pcodeBook& cunsigned* cbBoundsint numChannels);
int det_update_codebook_cD(uchar* pcodeBook& cunsigned* cbBoundsint numChannels int numframe); 
int realtime_clear_stale_entries_cC(codeBook &c int FrmNum);
int realtime_clear_stale_entries_cD(codeBook &c int FrmNum);
int cD_to_cC(codeBook &d codeBook &c int FrmNum);
uchar background_diff_realtime(uchar* pcodeBook& cint numChannelsint* minModint* maxMod);


void help() {
printf(
“***Keep the focus on the video windows NOT the consol***\n“
“INTERACTIVE PARAMETERS:\n“
“\tESCqQ  - quit the program\n“
“\th - print this help\n“
“\tp - pause toggle\n“
“\ts - single step\n“
“\tr - run mode (single step off)\n“
“=== CODEBOOK PARAMS ===\n“
“\tyuv- only adjust channel 0(y) or 1(u) or 2(v) respectively\n“
“\ta - adjust all 3 channels at once\n“
“\tb - adjust both 2 and 3 at once\n“
“\tio - bump upper threshold updown by 1\n“
“\tkl - bump lower threshold updown by 1\n“
        “\tzx     - bump Fadd threshold updown by 1\n“
“\tnm     - bump Tavgstale threshold updown by 1\n“
“\t        Fadd小更新快Tavgstale大更新快\n“
);
}

int count_Segmentation(codeBook *c IplImage *I int numChannels int *minMod int *maxMod)
{
int count = 0i;
uchar *pColor;
int imageLen = I->width * I->height;

//GET baseLINE NUMBER OF FG PIXELS FOR Iraw
pColor = (uchar *)((I)->imageData);
for(i=0; i {
if(background_Diff(pColor c[i] numChannels minMod maxMod))
count++;
pColor += 3;
}
    fgcount=count;
return(fgcount);
}

void connected_Components(IplImage *mask int poly1_hull0 float perimScale int *num CvRect *bbs CvPoint *centers)
{
static CvMemStorage* mem_storage = NULL;
static CvSeq* contours = NULL;
//CLEAN UP RAW MASK
cvMorphologyEx( mask mask NULL NULL CV_MOP_OPEN CVCLOSE_ITR );
cvMorphologyEx( mask mask N

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件     843824  2006-10-18 21:49  MOG_三针_码书_贝叶斯_OK\Debug\cv100.dll

     文件     598067  2006-10-18 21:50  MOG_三针_码书_贝叶斯_OK\Debug\cvaux100.dll

     文件      49152  2006-10-19 17:16  MOG_三针_码书_贝叶斯_OK\Debug\cvcam100.dll

     文件    1011764  2006-10-18 21:49  MOG_三针_码书_贝叶斯_OK\Debug\cxcore100.dll

     文件     131133  2006-10-18 21:50  MOG_三针_码书_贝叶斯_OK\Debug\cxts001.dll

     文件     626741  2006-10-18 21:50  MOG_三针_码书_贝叶斯_OK\Debug\highgui100.dll

     文件    6252544  2009-04-30 22:51  MOG_三针_码书_贝叶斯_OK\Debug\intelligentroom_raw.avi

     文件     196608  2006-02-28 18:04  MOG_三针_码书_贝叶斯_OK\Debug\libguide40.dll

     文件     249904  2006-10-18 21:50  MOG_三针_码书_贝叶斯_OK\Debug\ml100.dll

     文件     217169  2009-06-26 10:55  MOG_三针_码书_贝叶斯_OK\Debug\MOG+帧间差分+贝叶斯+码书.exe

    ..A..H.     10752  2012-12-21 16:41  MOG_三针_码书_贝叶斯_OK\Realtime_online_cb_det.suo

     文件        515  2009-06-07 10:40  MOG_三针_码书_贝叶斯_OK\Source\codeb.h

     文件      30571  2009-06-26 10:59  MOG_三针_码书_贝叶斯_OK\Source\Realtime_online_cb_det.cpp

     文件       3823  2009-06-08 09:38  MOG_三针_码书_贝叶斯_OK\Source\Realtime_online_cb_det.dsp

     文件        569  2009-05-03 18:26  MOG_三针_码书_贝叶斯_OK\Source\Realtime_online_cb_det.dsw

     文件      74752  2009-06-26 10:59  MOG_三针_码书_贝叶斯_OK\Source\Realtime_online_cb_det.ncb

     文件     475136  2009-06-26 10:59  MOG_三针_码书_贝叶斯_OK\Source\Realtime_online_cb_det.opt

     文件        881  2009-06-26 10:55  MOG_三针_码书_贝叶斯_OK\Source\Realtime_online_cb_det.plg

     文件    1789952  2012-12-21 20:07  MOG_三针_码书_贝叶斯_OK\Source\Realtime_online_cb_det.sdf

     文件        910  2012-12-21 20:07  MOG_三针_码书_贝叶斯_OK\Source\Realtime_online_cb_det.sln

    ..A..H.      9728  2012-12-21 20:07  MOG_三针_码书_贝叶斯_OK\Source\Realtime_online_cb_det.suo

     文件       6437  2012-12-21 20:04  MOG_三针_码书_贝叶斯_OK\Source\Realtime_online_cb_det.vcxproj

     文件        143  2012-12-21 16:16  MOG_三针_码书_贝叶斯_OK\Source\Realtime_online_cb_det.vcxproj.user

     目录          0  2012-12-25 01:44  MOG_三针_码书_贝叶斯_OK\Debug

     目录          0  2012-12-25 01:44  MOG_三针_码书_贝叶斯_OK\Source

     目录          0  2012-12-21 19:01  MOG_三针_码书_贝叶斯_OK

----------- ---------  ---------- -----  ----

             12581075                    26


评论

共有 条评论