PyImageSearch / imutils

A series of convenience functions to make basic image processing operations such as translation, rotation, resizing, skeletonization, and displaying Matplotlib images easier with OpenCV and Python.
MIT License
4.54k stars 1.03k forks source link

No modules named 'cv2' for imutils #271

Open ss8319 opened 2 years ago

ss8319 commented 2 years ago

I am getting the following error. I have installed imutils using pip install opencv-contrib-python as recommended by PyImageSearch

"C:\Users\USER\Desktop\Year 3\ObjectTracker\venv\Scripts\python.exe" "C:/Users/USER/Desktop/Year 3/ObjectTracker/objecttracker.py"
Traceback (most recent call last):
  File "C:\Users\USER\Desktop\Year 3\ObjectTracker\objecttracker.py", line 2, in <module>
    from imutils.video import VideoStream
  File "C:\Users\USER\Desktop\Year 3\ObjectTracker\venv\lib\site-packages\imutils\__init__.py", line 8, in <module>
    from .convenience import translate
  File "C:\Users\USER\Desktop\Year 3\ObjectTracker\venv\lib\site-packages\imutils\convenience.py", line 6, in <module>
    import cv2
ModuleNotFoundError: No module named 'cv2'
TuanBC commented 2 years ago

I think you can try installing opencv-python too.

opencv-contrib-python is an extra package for extra features from opencv ^^