How can I find the differences between frames when I'm running video on OpenCV? I need to do a loop that checks the changes from frame to frame and displays the result in another window? Can I do it in the loop that i attach here? Or is there another way to do it?
while( key != 'x' )
{
frame = cvQueryFrame( capture );
cvCvtColor(frame, gray, CV_RGB2GRAY);
//gray_frame = cvQueryFrame( capture );
//cvCvtColor(frame, gray_frame, CV_BGR2GRAY);
if(key==27)
break;
cvShowImage( "video",frame );
cvShowImage( "grayvideo",gray );
key = cvWaitKey( 1000 / fps );
}
cvDestroyWindow( "video" );
cvDestroyWindow( "grayvideo" );
cvReleaseCapture( &capture );
return 0;
i get this error on the command window:Compiler did not align stack variables. Libavcodec has been miscompiled and may be very slow or crash. This is not a bug in libavcodec, but in the compiler. You may try recompiling using gcc >= 4.2. Do not report crashes to FFmpeg developers. OpenCV Error: Assertion failed (src1.size() == dst.size() && src1.type() == dst. type()) in unknown function, file ........\ocv\opencv\src\cxcore\cxarithm.cpp , line 1563
what is wrong maby the maby the size of depth? how can i fix it? or maby something wrong with the code? thanks a lot for your help