From aaea8cbe150f9f38027c45a2a0a96c8081ee41ea Mon Sep 17 00:00:00 2001 From: Andrews Sobral Date: Thu, 30 Apr 2015 01:05:19 +0200 Subject: [PATCH] Fix --- .gitignore | 5 ++++- Demo.cpp | 16 ++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index e9418d1..35adf2b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ vs2013/Release/ +tmp/ *.exe -*.pdb \ No newline at end of file +*.pdb +*.sdf +*.opensdf \ No newline at end of file diff --git a/Demo.cpp b/Demo.cpp index 90e8697..84aa92d 100644 --- a/Demo.cpp +++ b/Demo.cpp @@ -10,6 +10,7 @@ int main(int argc, char **argv) { std::cout << "Using OpenCV " << CV_MAJOR_VERSION << "." << CV_MINOR_VERSION << "." << CV_SUBMINOR_VERSION << std::endl; + /* Open video file */ CvCapture *capture = 0; capture = cvCaptureFromAVI("dataset/video.avi"); if(!capture){ @@ -17,15 +18,11 @@ int main(int argc, char **argv) return 1; } - int resize_factor = 100; // 50% of original image - IplImage *frame_aux = cvQueryFrame(capture); - IplImage *frame = cvCreateImage(cvSize((int)((frame_aux->width*resize_factor)/100) , (int)((frame_aux->height*resize_factor)/100)), frame_aux->depth, frame_aux->nChannels); - - /* Background Subtraction */ + /* Background Subtraction Algorithm */ IBGS *bgs; bgs = new PixelBasedAdaptiveSegmenter; - /* Blob Tracking */ + /* Blob Tracking Algorithm */ cv::Mat img_blob; BlobTracking* blobTracking; blobTracking = new BlobTracking; @@ -36,12 +33,11 @@ int main(int argc, char **argv) std::cout << "Press 'q' to quit..." << std::endl; int key = 0; + IplImage *frame; while(key != 'q') { - frame_aux = cvQueryFrame(capture); - if(!frame_aux) break; - - cvResize(frame_aux, frame); + frame = cvQueryFrame(capture); + if(!frame) break; cv::Mat img_input(frame); cv::imshow("Input", img_input);