Google Colab, CV2_IMSHOW löst Fehler aus: 'Nonetype' Objekt hat kein Attribut 'Clip'Python

Python-Programme
Anonymous
 Google Colab, CV2_IMSHOW löst Fehler aus: 'Nonetype' Objekt hat kein Attribut 'Clip'

Post by Anonymous »

Ich lerne die Grundlagen von OpenCV und beim Ausführen des folgenden Code -Codes in Google Colab einen Fehler. < /p>

Code: Select all

from google.colab.patches import cv2_imshow
import cv2
img=cv2.imread("geeks14.png")
cv2_imshow(img)
< /code>
Der Fehler ist < /p>
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
 in ()
2 import cv2
3 img=cv2.imread("geeks14.png")
----> 4 cv2_imshow(img)

/usr/local/lib/python3.7/dist-packages/google/colab/patches/__init__.py in cv2_imshow(a)
20       image.
21   """
---> 22   a = a.clip(0, 255).astype('uint8')
23   # cv2 stores colors as BGR; convert to RGB
24   if a.ndim == 3:

AttributeError: 'NoneType' object has no attribute 'clip

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post