Optical stream using opencv

I am using the Pyramid Lukas Kanade function for OpenCV to evaluate optical flux. I call cvGoodFeaturesToTrack, and then cvCalcOpticalFlowPyrLK. This is my code:

while(1)
{
...

cvGoodFeaturesToTrack(frameAth,eig_image,tmp_image,cornersA,&corner_count,0.01,5,NULL,3,0.4);

std::cout<<"CORNER COUNT AFTER GOOD FEATURES2TRACK CALL = "<<corner_count<<std::endl;

cvCalcOpticalFlowPyrLK(frameAth,frameBth,pyrA,pyrB,cornersA,cornersB,corner_count,cvSize(win_size,win_size),5,features_found,features_errors,cvTermCriteria( CV_TERMCRIT_ITER| CV_TERMCRIT_EPS,20,0.3 ),CV_LKFLOW_PYR_A_READY|CV_LKFLOW_PYR_B_READY);

cvCopy(frameBth,frameAth,0);
...
}

frameAth is the previous gray frame, and frameBth- current gray frame from webcam. But when I output the number of good tracking functions in each frame, the number decreases after the total time and continues to decrease. but if I exit the program and execute the code again (without violating the webcam’s field of view), a much larger number of points are displayed as good functions for tracking ... as it can for the same field of view and for the same scene, the function gives such The difference in the number of points ... and the difference is high ... the number of points, as good functions for tracking after 4 minutes of execution - 20 or 50 ... but when the same program is completed and the number from 500 to 700 initial but slowly decreasing again. I have been using opencv for the last 4 months, so I am new to openCV. Please help me or tell me where I can find a solution ...much more than before.

+5
2

cvGoodFeatureToTrack corner_count . , . reset corner_count cvGoodFeaturesToTrack while.

+1

cvGoodFeaturesToTrack ( , ), cvCalcOpticalFlowPyrLK. opencv : OpenCV/samples/cpp/lkdemo.cpp.

+6

All Articles