Explanation needed for error vector in calcOpticalFlowPyrLK (Feature #1307)


Added by Nghia Ho over 13 years ago. Updated almost 13 years ago.


Status:Done Start date:
Priority:Low Due date:
Assignee:Ilya Lysenkov % Done:

0%

Category:documentation
Target version:2.4.0
Difficulty: Pull request:

Description

The current documentation describes the error outputted by calcOpticalFlowPyrLK as

"err – Output vector that contains the difference between patches around the original and moved points."

but doesn't describe exactly what metric is used. On inspection of the code it is

double minEig = (A22 + A11 - std::sqrt((A11-A22)*(A11-A22) + 4.*A12*A12))/(2*winSize.width*winSize.height);

if( err )
err[ptidx] = (float)minEig;

, which appears to be using the minimum eigenvalue (not sure what the division by 2*winSize .. is meant to be). This should be mentioned somewhere in the documentation. It is an interesting choice for an error metric, as I was expecting the sum of square error or similar. Any explanations to why this was chosen? Convenience?


History

Updated by Nghia Ho over 13 years ago

I had a closer look. It appears to be calculating the minimum eigenvalue of the normal equation for src patch. I can't see how this is a valid error measure. It doesn't compare the src and dst patch at all. Or have I overlooked something?

Updated by Alexander Shishkov almost 13 years ago

  • Target version deleted ()

Updated by Alexander Shishkov almost 13 years ago

  • Priority changed from Normal to Low

Updated by Alexander Shishkov almost 13 years ago

  • Target version deleted ()

Updated by Ilya Lysenkov almost 13 years ago

  • Target version set to 2.4.0
  • Assignee set to Ilya Lysenkov

Updated by Ilya Lysenkov almost 13 years ago

Thank you for the report, the documentation about the error measure was vague. In fact, OpenCV can use either a minimum eigen value or L1 distance between patches as the error measure. It is documented in r7986 and r7988.

  • Status changed from Open to Done

Also available in: Atom PDF