DisabledFunctionError: cv2.imshow() is disabled in Colab, because it causes Jupyter sessions
to crash; see https://github.com/jupyter/notebook/issues/3935.
As a substitution, consider using
from google.colab.patches import cv2_imshow
因此,您可以简单地使用:
from google.colab.patches import cv2_imshow
import matplotlib.pyplot as plt
img = "yourImage.png"
img = cv2.imread(img) # reads image
plt.imshow(img)
在Google Colab中使用cv2.imshow(img)返回以下输出:
因此,您可以简单地使用:
试试这个:
相关问题 更多 >
编程相关推荐