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
Python 3.6.8 and OpenCV4.10 on Ubuntu 18.04 - AttributeError: 'NoneType' object has no attribute 'shape' #147
My error output is as follows:
` /virtualcv/file-video-stream$ python read_frames_fast.py --video /home/rc/yolo/20181031_170638.mp4
[INFO] starting video file thread...
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/usr/lib/python3.6/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "/home/rc/.virtualenvs/cv/lib/python3.6/site-packages/imutils/video/filevideostream.py", line 67, in update
frame = self.transform(frame)
File "read_frames_fast.py", line 21, in filterFrame
frame = imutils.resize(frame, width=450)
File "/home/rc/.virtualenvs/cv/lib/python3.6/site-packages/imutils/convenience.py", line 69, in resize
(h, w) = image.shape[:2]
AttributeError: 'NoneType' object has no attribute 'shape'
[INFO] elasped time: 9.87
[INFO] approx. FPS: 30.19
`
The script quits almost immediateely
Wanted to see if anyone has any ideas?
I am running the demo script: read_frames_fast.py without any modifications
My system Ubuntu 18.04 Python 3.6.8 OpenCV 14.10 latest version of imutils
I followed the suggestions for fixing these types of issues on pyimagesearch.
I am using the same video file at the same location that processed successfully using the demo script: "read_frames_slow.py" from https://www.pyimagesearch.com/2017/02/06/faster-video-file-fps-with-cv2-videocapture-and-opencv/
My error output is as follows: ` /virtualcv/file-video-stream$ python read_frames_fast.py --video /home/rc/yolo/20181031_170638.mp4 [INFO] starting video file thread... Exception in thread Thread-1: Traceback (most recent call last): File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner self.run() File "/usr/lib/python3.6/threading.py", line 864, in run self._target(*self._args, **self._kwargs) File "/home/rc/.virtualenvs/cv/lib/python3.6/site-packages/imutils/video/filevideostream.py", line 67, in update frame = self.transform(frame) File "read_frames_fast.py", line 21, in filterFrame frame = imutils.resize(frame, width=450) File "/home/rc/.virtualenvs/cv/lib/python3.6/site-packages/imutils/convenience.py", line 69, in resize (h, w) = image.shape[:2] AttributeError: 'NoneType' object has no attribute 'shape'
[INFO] elasped time: 9.87 [INFO] approx. FPS: 30.19 ` The script quits almost immediateely Wanted to see if anyone has any ideas?