Skip to content

Commit aaea8cb

Browse files
committed
Fix
1 parent ff99f1a commit aaea8cb

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
vs2013/Release/
2+
tmp/
23
*.exe
3-
*.pdb
4+
*.pdb
5+
*.sdf
6+
*.opensdf

Demo.cpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,19 @@ int main(int argc, char **argv)
1010
{
1111
std::cout << "Using OpenCV " << CV_MAJOR_VERSION << "." << CV_MINOR_VERSION << "." << CV_SUBMINOR_VERSION << std::endl;
1212

13+
/* Open video file */
1314
CvCapture *capture = 0;
1415
capture = cvCaptureFromAVI("dataset/video.avi");
1516
if(!capture){
1617
std::cerr << "Cannot open video!" << std::endl;
1718
return 1;
1819
}
1920

20-
int resize_factor = 100; // 50% of original image
21-
IplImage *frame_aux = cvQueryFrame(capture);
22-
IplImage *frame = cvCreateImage(cvSize((int)((frame_aux->width*resize_factor)/100) , (int)((frame_aux->height*resize_factor)/100)), frame_aux->depth, frame_aux->nChannels);
23-
24-
/* Background Subtraction */
21+
/* Background Subtraction Algorithm */
2522
IBGS *bgs;
2623
bgs = new PixelBasedAdaptiveSegmenter;
2724

28-
/* Blob Tracking */
25+
/* Blob Tracking Algorithm */
2926
cv::Mat img_blob;
3027
BlobTracking* blobTracking;
3128
blobTracking = new BlobTracking;
@@ -36,12 +33,11 @@ int main(int argc, char **argv)
3633

3734
std::cout << "Press 'q' to quit..." << std::endl;
3835
int key = 0;
36+
IplImage *frame;
3937
while(key != 'q')
4038
{
41-
frame_aux = cvQueryFrame(capture);
42-
if(!frame_aux) break;
43-
44-
cvResize(frame_aux, frame);
39+
frame = cvQueryFrame(capture);
40+
if(!frame) break;
4541

4642
cv::Mat img_input(frame);
4743
cv::imshow("Input", img_input);

0 commit comments

Comments
 (0)