Ask Your Question

Revision history [back]

You may need to copy or clone your aFrameMatrix to another Mat then push to your vector,

like

 Mat tmp=aFrameMatrix.clone();
 matCollection.push_back( tmp );

In the above code your passing the same pointer allocated for aFrameMatrix to your vector every time, so you will get array of Mat pointing single(same) memory location in your vector.