Hello,
I played with fcvTrackLKOpticalFlowu8. There seems to be a bug or at least a lack of documentation ( not the only one ;-) on this function.
Sometimes, when featureLen = 0, the function crashes.
I tried the same with a test befoire the function call :
if (featureLen != 0) {
fcvTrackLKOpticalFlowu8(..........);
}
And it seems to work better...
I think this behaviour should be documented
In addition, I guessed that src1 and src2 represent respectively the current frame and the previous one.
Is that correct? The documentation is (again) (very) unclear about this.
Yes, documentation is a litlle bit poor, but it's under construction, and developers know it. I suppose, that src1 - it's previous frame and src2 - current, like explain in OpticalFlowBM.
For the completely bug report, please, provide your source code and images, where you have an error.
Indeed, this is a bug and your work-around is good until it is fixed.
In the current implementation, the parameters src1 and src2 are somewhat redundant. In other words, src1 should equal src1Pyr[0] and src2 should equal src2Pyr[0]. This signature might get tightened up in the next major (non-backwards compatible) release.