简体   繁体   English

模块“cv2”没有属性“createThinPlateSplineShapeTransformer”

[英]module 'cv2' has no attribute 'createThinPlateSplineShapeTransformer'

I'm trying to use the Thin plate shape transformer function.我正在尝试使用薄板形变压器 function。

tps = cv2.createThinPlateSplineShapeTransformer()

However, this error is shown:但是,显示此错误:

module 'cv2' has no attribute 'createThinPlateSplineShapeTransformer'.模块“cv2”没有属性“createThinPlateSplineShapeTransformer”。

I have installed contrib using:我已经使用以下方式安装了contrib

pip install opencv-contrib-python

but the problem is still unsolved.但问题仍然没有解决。 I use opencv 4.5.4 and python 3.8.5我使用opencv 4.5.4python 3.8.5

See this issue: https://github.com/opencv/opencv-python/issues/177看到这个问题: https://github.com/opencv/opencv-python/issues/177

It appears that that method has been moved out of the base package.似乎该方法已从基础 package 中移出。 So, you need to install OpenCV with contrib modules.因此,您需要安装 OpenCV 和contrib模块。 For details, please open the link above.详情请打开以上链接。

I fixed this problem using the following commands.我使用以下命令解决了这个问题。

pip uninstall opencv-contrib-python

pip install opencv-contrib-python

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM