cv2.calcOpticalFlowPyrLK的(-215:Assertion failed)

使用 cv2.calcOpticalFlowPyrLK函数时,输入的两张图片大小应该相同,如果像素不同,会出现问题:p1, st, err = cv2.calcOpticalFlowPyrLK(old_frame, new_frame, p0, None, **lk_params)
cv2.error: OpenCV(3.4.3) C:\projects\opencv-python\opencv\modules\video\src\lkpyramid.cpp:1378: error: (-215:Assertion failed) prevPyr[level * lvlStep1].size() == nextPyr[level * lvlStep2].size() in function 'cv::`anonymous-namespace'::SparsePyrLKOpticalFlowImpl::calc'

你可能感兴趣的:(opencv,python,计算机视觉)