I am developing a real-time optical flow application with Opencv (C ++). I donโt understand how to capture two consecutive frames to apply the Lucas-Kanade tracking method.
This does not work:
CvCapture* capture = cvCaptureFromCAM(1); IplImage *imgA=cvQueryFrame( capture ); IplImage *imgB=cvQueryFrame( capture );
I also tried this, but the program does not exit the loop:
CvCapture* capture = cvCaptureFromCAM(1); IplImage *imgA=cvQueryFrame( capture ); IplImage *imgB=cvCreateImage(cvSize(imgA),IPL_DEPTH_32F,3); while(cvNorm(imgA,imgB)==0) imgB=cvQueryFrame( capture );
Any ideas? I hope this is not a stupid question, but I suspect this is: / Sorry in advance. Thanks!!
source share