OpenCV cv.CalcOpticalFlowHS Horn-Schunck smoothness lambda parameter

The default lambda=1.0 smoothness parameter for OpenCV 2.4 cv.CalcOpticalFlowHS does not work well for some cases. Also, OpenCV’s lambda is different from Matlab Computer Vision Toolbox Horn Schunck opticalFlowHS('Smoothness',1.0) parameter, which also defaults to 1.0.

This Horn Schunck Optical Flow comparison between Matlab and Python shows that OpenCV cv.CalcOpticalFlowHS setting lambda=0.001 gives results that are much more like Matlab–I can see the fine details.

Alternatives

Note: OpenCV 3 no longer has the original Horn Schunck optical flow.

Reference

Linearized Horn Schunck has problems with large displacements in the image, which can be resolved by a pyramidal algorithm, or by using the more modern optical flow algorithms in OpenCV 3.x.

Tags:

Categories:

Updated:

Leave a Comment