Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Reading (quick time movie:- .mov) clip as input in Open CV

Hi Open CV group,

Firstly, thanks for your support till date. As I am new to Open CV, I've gone through some sample tutorials and made a code fragment for background separation.

include "stdafx.h"

include "opencv2/opencv.hpp"

include "iostream"

include "vector"

int main(int argc, char *argv[])

{

cv::Mat frame;
cv::Mat back;
cv::Mat fore;
cv::VideoCapture cap(0);
cv::BackgroundSubtractorMOG2 bg(10000, 25, false);
std::vector<std::vector<cv::Point> > contours;
cv::namedWindow("Frame");
cv::namedWindow("Background");
for(;;)
{
    cap >> frame;
    bg.operator ()(frame,fore);
    bg.getBackgroundImage(back);
    cv::erode(fore,fore,cv::Mat());
    cv::imshow("Frame",fore);
    cv::imshow("Background",back);
    if(cv::waitKey(30) >= 0) break;
}
return 0;

}

I am able to separate the background using camera as input.

How to use the (quick time movie, i.e; .mov video clip) as input to the above program??