Ошибка атрибута при запуске OpenCV и imutils - PullRequest
0 голосов
/ 10 марта 2020

Я попытался запустить следующий код для создания приложения распознавания лиц с использованием OpenCV на ноутбуке jupyter

# load the input image and show its dimensions, keeping in mind that
# images are represented as a multi-dimensional NumPy array with
# shape no. rows (height) x no. columns (width) x no. channels (depth)
image = cv2.imread("jp.png")
(h, w, d) = image.shape
print("width={}, height={}, depth={}".format(w, h, d))
# display the image to our screen -- we will need to click the window
# open by OpenCV and press a key on our keyboard to continue execution
cv2.imshow("Image", image)
cv2.waitKey(0)

, но получил следующую ошибку атрибута:

AttributeError                            Traceback (most recent call last)
<ipython-input-14-eaae43cadc51> in <module>
      3 # shape no. rows (height) x no. columns (width) x no. channels (depth)
      4 image = cv2.imread("jp.png")
----> 5 (h, w, d) = image.shape
      6 print("width={}, height={}, depth={}".format(w, h, d))
      7 # display the image to our screen -- we will need to click the window

AttributeError: 'NoneType' object has no attribute 'shape'

Что могло быть проблема здесь?

...