使用 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'
cv2.calcOpticalFlowPyrLK的(-215:Assertion failed)
最新推荐文章于 2024-03-18 16:27:31 发布