Ask Your Question

returning captured frame

asked 2013-10-02 21:17:56 -0500

updated 2013-10-03 01:28:46 -0500

Moster gravatar image

I am trying to create this function

void videoHandler::getNextFrame(Mat& frame){

vf* tempFrame=new vf();
VideoCapture capture;;

but as the compilers exits and the Mat pointer is accessed I get an access violation error as if the frame info was destroyed. I tried using


which sets the image and It only works when I use copyto() or clone() functions but slows down the compilation alot. I tried return frame; static declarations; so unless a copy is made the frame is lost when the compiler goes out of scope. any suggestions for an alternative or better way to do it.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2013-10-03 01:19:25 -0500

Michael Burdinov gravatar image

Documentation of VideoCapture has very simple and very informative example of reading frames from camera. Just do the same and everything will work properly.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools


Asked: 2013-10-02 21:17:56 -0500

Seen: 72 times

Last updated: Oct 03 '13