1 | initial version |
i guess, you want to pause the videostream, not the processing loop ?
maybe all it needs is a slightly different control-structure:
bool paused = false;
while(1){
if ( ! paused ) {
frame = cvQueryFrame(g_capture);
if(!frame) break;
cvNot(frame, frame);
//cvCopyImage( frame, temp ); // what is this for ? you're drawing into 'frame', right ?
}
//cvShowImage("saida", temp);
cvShowImage("saida", frame);
char e = cvWaitKey(33);
// toggle pause with 'p'
if( e=='p' ) paused = ! paused;
// close video with'esc'
if( e==27 ) break;
}
(also, what steven said, please use the c++ api instead!)