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
2 | No.2 Revision |
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