I have implemented contour detection code using opencv 2.3 in real time. I have use my web camera for it.
Now I want to implement it in captured video which are recorded previously and are in my database.
cv::Mat frame;
cv::Mat back;
cv::Mat fore;
cv::VideoCapture cap(0);
cv::BackgroundSubtractorMOG2 bg;
bg.nmixtures = 3;
bg.bShadowDetection = true;
std::vector<std::vector<cv::Point> > contours;
I have not mention my whole code because to load an AVI file I have to do formation here only.
Please anyone can guide me?
Thanx.
You can open a video and read a frame with the following code snippet:
You can read about the documentation for VideoCapture for more details. If you encounter problems, you should check, if your video’s codec is supported.