Flask-plt.imshow当[NSGraphicsContext currentContext]为nil时绘制图像没有意义

时间:2018-10-24 08:58:04

标签: python matplotlib flask cv2

我要对图像进行阈值处理,然后我想使用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.`

0 个答案:

没有答案