W_BITS and FLT_SCALE in LKTrackerInvoker

asked 2014-01-27 22:28:03 -0600

jenddy gravatar image

updated 2018-10-26 15:53:53 -0600

I am studying cv::detail::LKTrackerInvoker::operator() code called by calcOpticalFlowPyrLK in lkpyramid.cpp. I noticed the following constants.

const int W_BITS = 14, W_BITS1 = 14; const float FLT_SCALE = 1.f/(1 << 20);

I wonder why W_BITS and W_BITS1 are defined to be 14 instead of 16. I think we can use the full resolution of 32 bit integer by using 16.

And FLT_SCALE seems to be a normalization factor. Is there a particular reason why the constant is defined to be 1.f/(1 << 20)?

Thanks.

edit retag flag offensive close merge delete