N
N
nzt4032019-06-24 18:06:55
Python
nzt403, 2019-06-24 18:06:55

Why does opencv return None when reading a picture?

Good afternoon.
Installed the opencv library for python
When trying to read the image, imread returns None
The image is in the same folder as the
OS script itself - Ubuntu
Opencv version - 4.1.0 (installed from the Ubuntu repository)
Python 3.6
Code

import cv2
img = cv2.imread('test.jpg')
print(img.shape)

Error
print(img.shape)
AttributeError: 'NoneType' object has no attribute 'shape'
Where to dig to solve the problem?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question