简体   繁体   中英

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. 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.

Is there any method by which I can access opencv 2 libraries from opencv3? If not, atleast is there any function in opencv 3, which does something similar to this?

According to their 3.2 documentation , it was renamed to cv2.PCACompute() .

More details on the parameters can be found here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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