출처 : http://opencv.jp/sample/accumulation_of_background.html#background_sub
[code cpp]
#include <cv.h> #include <highgui.h> #include <ctype.h> #include <stdio.h>
int main (int argc, char **argv) { int i, c, counter; int INIT_TIME = 100; int w = 0, h = 0; double B_PARAM = 1.0 / 50.0; double T_PARAM = 1.0 / 200.0; double Zeta = 10.0; CvCapture *capture = 0; IplImage *frame = 0; IplImage *av_img, *sgm_img; IplImage *lower_img, *upper_img, *tmp_img; IplImage *dst_img, *msk_img;
CvFont font; char str[64];
// (1)コマンド引?によって指定された番?のカメラに?するキャプチャ構造?を作成する if (argc == 1 || (argc == 2 && strlen (argv[1]) == 1 && isdigit (argv[1][0]))) capture = cvCreateCameraCapture (argc == 2 ? argv[1][0] - '0' : 0);
// (2)1フレ?ムキャプチャし,キャプチャサイズを取得する. frame = cvQueryFrame (capture); w = frame->width; h = frame-...
Machine Vision & Image Processing