Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

the frames you retrieve from VideoCapture point to device driver memory. if you want to store them in a vector , you need to clone() them, else they will get overwritten/corrupted.

it does not matter if you use cvQueryFrame() , capture.read(), or capture >> mat, they are all calling the same code internally.

vector<M<t> vec;
while(cap.isOpened())
{
    cap >> frame;
    vec.push_back( frame.clone());
}

also see the note here

the frames you retrieve from VideoCapture point to device driver memory. if you want to store them in a vector , you need to clone() them, else they will get overwritten/corrupted.

it does not matter if you use cvQueryFrame() , capture.read(), or capture >> mat, they are all calling the same code internally.

vector<M<t> vector<Mat> vec;
while(cap.isOpened())
{
    cap >> frame;
    vec.push_back( frame.clone());
frame.clone() );
}

also see the note here