Ask Your Question

Revision history [back]

returning captured frame

I am trying to create this function void videoHandler::getNextFrame(Mat& frame) { vf* tempFrame=new vf(); VideoCapture capture; capture.open(0); capture.set(CV_CAP_PROP_FRAME_WIDTH,640); capture.set(CV_CAP_PROP_FRAME_HEIGHT,480); capture.read(frame); } 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 tempFrame->setImage(frame);
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.

returning captured frame

I am trying to create this function

void videoHandler::getNextFrame(Mat& frame) frame)

{ vf* tempFrame=new vf(); VideoCapture capture; capture.open(0); capture.set(CV_CAP_PROP_FRAME_WIDTH,640); capture.set(CV_CAP_PROP_FRAME_HEIGHT,480); capture.read(frame); } 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 tempFrame->setImage(frame);
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.

returning captured frame

I am trying to create this function void videoHandler::getNextFrame(Mat& frame) {

void videoHandler::getNextFrame(Mat& frame)

vf* tempFrame=new vf();
VideoCapture capture;
capture.open(0);
capture.set(CV_CAP_PROP_FRAME_WIDTH,640);
capture.set(CV_CAP_PROP_FRAME_HEIGHT,480);
capture.read(frame);}

{ vf* tempFrame=new vf(); VideoCapture capture; capture.open(0); capture.set(CV_CAP_PROP_FRAME_WIDTH,640); capture.set(CV_CAP_PROP_FRAME_HEIGHT,480); capture.read(frame); } 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 using

tempFrame->setImage(frame);

which sets the image and It only works when I use copyto() copyto() or clone() clone() functions but slows down the compilation alot. I tried return frame; static 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.

returning captured frame

I am trying to create this function

void videoHandler::getNextFrame(Mat& frame) {frame){

vf* tempFrame=new vf();
VideoCapture capture;
capture.open(0);
capture.set(CV_CAP_PROP_FRAME_WIDTH,640);
capture.set(CV_CAP_PROP_FRAME_HEIGHT,480);
capture.read(frame);}

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

tempFrame->setImage(frame);

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.

click to hide/show revision 5
retagged

returning captured frame

I am trying to create this function

void videoHandler::getNextFrame(Mat& frame){

vf* tempFrame=new vf();
VideoCapture capture;
capture.open(0);
capture.set(CV_CAP_PROP_FRAME_WIDTH,640);
capture.set(CV_CAP_PROP_FRAME_HEIGHT,480);
capture.read(frame);}

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

tempFrame->setImage(frame);

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.