我想使用 OpenCV 的estimateRigidTransform 函数,但它抛出了一个错误。
AttributeError Traceback (most recent call last) in 30 31 #Find transformation matrix ---> 32 m = cv2.estimateRigidTransform(prev_pts, curr_pts, fullAffine=False) #will only work with OpenCV-3 or less 33 34 # Extract traslation
AttributeError: module 'cv2.cv2' has no attribute 'estimateRigidTransform'
我的 openCV 版本是 4.0.0。
最佳答案
如 estimateRigidTransform
的 documentation 所示,此功能已被弃用:
Deprecatd: Use cv::estimateAffine2D, cv::estimateAffinePartial2D instead. If you are using this fuction with images, extract points using cv::calcOpticalFlowPyrLK and then use the estimation fuctions.
cv::estimateAffine2D
应该对噪声更稳健,但比 cv::estimateAffinePartial2D
的计算成本更高。它们与 estimateRigidTransform
类似,其中 fullAffine
参数分别设置为 true
或 false
。
关于python - 如何在 OpenCV 3.0 或更高版本中使用estimateRigidTransform,还有其他选择吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55757977/