Tuesday, November 8, 2011

Opencv extract background from video

opencv 2.3.1

#include <iostream>
#include <opencv/cv.h>
#include <opencv/highgui.h>
#include <opencv2/imgproc/imgproc_c.h>
#include <opencv2/video/background_segm.hpp>

using namespace std;
using namespace cv;

int main(int argc, char** argv) {
     VideoCapture capture(argv[1]);
     if(!capture.isOpened())
          return -1;
     Mat frame, foreground;
     BackgroundSubtractorMOG mog;
     while(1){
          if(!capture.read(frame))
               break;
          mog(frame, foreground, 0.05);
          threshold(foreground,           foreground,120,255,THRESH_BINARY_INV);
          imshow("img", frame);
          imshow(argv[1], foreground);
          if(waitKey(10)> 0) break;
     }
}

Proxmox installation display out of range

Reference:  https://forum.proxmox.com/threads/proxmox-ve-screen-out-of-range.131297/