Why calcOpticalFlowPyrLK returns real values instead of integer pixel coordinates?

asked 2016-03-24 06:25:59 -0500

helio gravatar image

I'm using calcOpticalFlowPyrLK to infer the vector movement between 2 satellite images.

I wonder why nxtPts is an array of real numbers instead of an array of integers, in float precision if required, but integers aiming at precise pixels. I guess that, despite the method, in the end, a maximum cross correlation is used to find where is the best match for the prevPts pixel and its blockSize neighborhood. So I expected the resulted nxtPts to be pixel coordinates in the second raster image.

I have tried to set the pyramid maxLevel to 0 and to limit the corners to 1, in case that internal averages of the method among resulting vectors might lead to non-integer coordinates results, but the method still returns real coordinates.

edit retag flag offensive close merge delete