python - 如何在 OpenCV 3.0 或更高版本中使用estimateRigidTransform,还有其他选择吗?
问题描述
我想使用 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:模块“cv2.cv2”没有属性“estimateRigidTransform”
我的 openCV 版本是 4.0.0。
解决方案
如 的文档中所示estimateRigidTransform
,此功能已被弃用:
已弃用:改用 cv::estimateAffine2D、cv::estimateAffinePartial2D。如果您使用此功能处理图像,请使用 cv::calcOpticalFlowPyrLK 提取点,然后使用估计功能。
cv::estimateAffine2D
应该对噪声更鲁棒,但计算量比cv::estimateAffinePartial2D
. 它们与分别设置为或estimateRigidTransform
的fullAffine
参数类似。true
false
推荐阅读
- javascript - 将扫描条码的类型或数据写入 REACT-NATIVE 上的文本输入
- firebase - 互联网回到 esp 12E/NodeMcu 后,Firebase 没有重新连接
- java - 显示得分最高的学生
- r - 构造一个有条件地取某个值直到满足另一个条件的变量
- ruby-on-rails - 如何使用 watir 加载现有的 chrome 配置文件?
- c# - 无法为“Form1.resx”创建清单资源名称;找不到“...Form1.cs”
- c++ - 整数在程序中使用递归算法设置为 -858990820 - 我有点明白为什么,但不确定
- c# - 如何收听 Google API 推送通知?
- python - python中用于算法和数据结构的排序函数
- apache-spark - 如何同时运行 2 个 EMR Spark 步骤?