简体   繁体   English

AttributeError:模块“ cv2”没有属性“ PCAComputeVar”

[英]AttributeError: module 'cv2' has no attribute 'PCAComputeVar'

I was working on a project on facial recognition using asift, which does PCA whitening before it processes the image. 我当时正在使用asift进行面部识别项目,该项目在处理图像之前先进行PCA白化。 One of my friends downloaded a code and gave it to me for execution, so we have something to start with. 我的一个朋友下载了一个代码并将其提供给我执行,因此我们有一些起点。 But however, on execution, I got an error, which said - 但是,在执行时,我遇到了一个错误,它说-

AttributeError: module 'cv2' has no attribute 'PCAComputeVar'

On Googling, I found that PCAComputeVar is supported mainly in opencv 2. However, I couldn't find anything in opencv 3. I don't want to downgrade to opencv 2, because there are some features supported only in opencv 3. 在Googling上,我发现opencv 2主要支持PCAComputeVar。但是,我在opencv 3中找不到任何东西。我不想降级到opencv 2,因为只有opencv 3支持某些功能。

Is there any method by which I can access opencv 2 libraries from opencv3? 有什么方法可以从opencv3访问opencv 2库? If not, atleast is there any function in opencv 3, which does something similar to this? 如果没有,则opencv 3中至少有什么功能,这与此类似吗?

According to their 3.2 documentation , it was renamed to cv2.PCACompute() . 根据他们的3.2文档 ,它被重命名为cv2.PCACompute()

More details on the parameters can be found here . 有关参数的更多详细信息,请参见此处

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

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