您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

Python OpenCV-waitKey(0)没有响应?

Python OpenCV-waitKey(0)没有响应?

这段代码适用于IDLE:

# -*- coding: utf-8 -*-

# Objectif : découvrir le fonctionnement d'opencv-python
# http://opencv-python-tutroals.readthedocs.org/en/latest/index.html


import numpy as np
import cv2

# Load an color image in grayscale
img = cv2.imread('Lena.tiff',0)
WINDOW_NAME = 'Image de Lena'
cv2.namedWindow(WINDOW_NAME, cv2.CV_WINDOW_AUTOSIZE)
cv2.startWindowThread()

# Display an image
cv2.imshow(WINDOW_NAME,img)
cv2.waitKey(0)


cv2.destroyAllWindows()

希望这对将来的读者有所帮助。

python 2022/1/1 18:36:41 有229人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶