This error happened because the image didn’t load properly. So you have a problem with the previous line cv2.imread
. My suggestion is :
-
check if the image exists in the path you give
-
check if the count variable has a valid number
More Related Contents:
- Convert a 3D array to RGB valued array [closed]
- How to read video stream as input in OpenCV python?
- How to clean images before OCR with Python OpenCV?
- Detect image orientation angle based on text direction
- PyQt showing video stream from opencv
- Split text lines in scanned document
- AttributeError: module ‘cv2.cv2’ has no attribute ‘createLBPHFaceRecognizer’
- Python OpenCV load image from byte string
- OpenCV Python: cv2.findContours – ValueError: too many values to unpack
- python OpenCV – add alpha channel to RGB image
- OpenCV error: the function is not implemented
- Using OpenCV with Tkinter
- Pyinstaller “Failed to execute script pyi_rth_pkgres” and missing packages
- How do I find an image contained within an image?
- Storing RTSP stream as video file with OpenCV VideoWriter
- How to crop the internal area of a contour?
- How do I install opencv using pip?
- Installing OpenCV for Python on Ubuntu, getting ImportError: No module named cv2.cv
- Image transformation in OpenCV
- how to remove background of images in python
- Equivalent of copyTo in Python OpenCV bindings?
- count number of black pixels in an image in Python with OpenCV
- cv2.imshow command doesn’t work properly in opencv-python
- How to find the RED color regions using OpenCV? [duplicate]
- how to add border around an image in opencv python
- Image is not displaying in Google Colab while using imshow()
- Square detection in image
- cv2.videocapture.read() does not return a numpy array
- How to warp an image using deformed mesh
- what is the codec for mp4 videos in python OpenCV