我要对图像进行阈值处理,然后我想使用plt.imshow显示图像。
ret, threshold = cv2.threshold(gray, 100, 255, cv2.THRESH_BINARY)
plt.imshow(threshold)
plt.show()
但是我得到了错误
> It does not make sense to draw an image when [NSGraphicsContext
> `currentContext] is nil. This is a programming error. Break on void
> _NSWarnForDrawingImageWithNoCurrentContext(void) to debug. This will be logged only once. This may break in the future.`