Calcopticalflowpyrlk function in opencv 3.0
I'm trying to track something in some frames. I know calcopticalflowpyrlk(http://docs.opencv.org/3.0-beta/modules/video/doc/motion_analysis_and_object_tracking.html) is supposed to be used for sparse tracking problems. However, I thought it wouldn't really hurt if I just try to track all pixels in the frames.
So my video frames are actually very stable(motions are barely visible by eyes), and calcopticalflowpyrlk works well for most pixels. But for some pixels it returns really big flow vectors(like [200,300]), which doesn't make sense.
And I also found a Matlab implementation that's using the same Pyramidal Lucas-Kanade algorithm, but this Matlab version doesn't return any crazy values.
So I'm wondering what is causing opencv function to return huge non-reasonable values. Is it because the matrix inversion is done differently?
Can you give code example and two iimages in post ?
There should be a status vector that tells if a point is correctly track or not. The algorithm should fail with points that are on textureless locations.
Can you add the link to the Matlab implementation?