Ask Your Question

Revision history [back]

Fixed point operation : W_BIT, FLT_SCALE

Exactly same question : http://answers.opencv.org/question/27310/w_bits-and-flt_scale-in-lktrackerinvoker

I ask the same question because the answer is none. The details of the question is as follows.

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.