Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewssobral committed Apr 29, 2015
1 parent ff99f1a commit aaea8cb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
vs2013/Release/
tmp/
*.exe
*.pdb
*.pdb
*.sdf
*.opensdf
16 changes: 6 additions & 10 deletions Demo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,19 @@ 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){
std::cerr << "Cannot open video!" << std::endl;
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;
Expand All @@ -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);
Expand Down

0 comments on commit aaea8cb

Please sign in to comment.