How to compute optical flow using tvl1 opencv function

后端 未结 1 1161
长发绾君心
长发绾君心 2021-02-09 19:43

I\'m trying to find python example for computing optical flow with tvl1 opencv function createOptFlow_DualTVL1 but it seems that there isn\'t enough documentation f

1条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-09 20:36

    Change this line(Dense Optical example in http://docs.opencv.org/master/d7/d8b/tutorial_py_lucas_kanade.html):

    flow = cv2.calcOpticalFlowFarneback(prvs, next, None, 0.5, 3, 15, 3, 5, 1.2, 0)
    

    By these:

    optical_flow = cv2.DualTVL1OpticalFlow_create()
    flow = optical_flow.calc(prvs, next, None)
    

    The parameter descriptions can be found here: http://docs.opencv.org/3.3.0/dc/d47/classcv_1_1DualTVL1OpticalFlow.html

    0 讨论(0)
提交回复
热议问题