No module named cv

前端 未结 4 1434
忘了有多久
忘了有多久 2020-12-11 04:45

I\'m trying to run this script:

https://github.com/openalpr/train-detector/blob/master/crop_plates.py

I\'ve never dealt with python before. First of all I ha

相关标签:
4条回答
  • 2020-12-11 04:47

    For ImportError: No module named cv, try installing opencv-python module using below command:

    pip install opencv-python
    
    0 讨论(0)
  • 2020-12-11 04:51

    OK , I searched for a while and find the following :

    • First: you may write: import cv2.cv as cv to solve your proplem

    • cv and cv2 are both interface for python , and now , the newest "cv2" is the most used one , but clearly some libraries still use cv and others (like yours) use mix of the two,What is different between all these OpenCV Python interfaces?

    0 讨论(0)
  • 2020-12-11 04:59

    cv2.cv doesn't exists in OpenCV 3.0. Use simply cv2

    Also, the attribute is no more CV_HOUGH_GRADIENT but HOUGH_GRADIENT

    So what you looking for is probably:

    cv2.HOUGH_GRADIENT
    
    0 讨论(0)
  • 2020-12-11 05:03

    It seems this code is using a old version of OpenCV. Unfortunately there is no mention of the exact version they used in their repo.

    As the code is at least 2 years old, I would install opencv version 2.4.

    pip install opencv-python==2.4

    0 讨论(0)
提交回复
热议问题