首页 > 编程知识 正文

python图像处理opencv,python进程结束时代码为0

时间:2023-05-04 01:41:19 阅读:24786 作者:855

I ' musing opencv2.4.7on Ubuntu 12.04.I ' mprogrammingwithpythonandihaveaproblemwhenirunthisscript 3360

导入cv2

img=cv2.im read (347620923614738322 _ 233985812.jpg ) )。

CV2.namedwindow('window ' ) )。

cv2.im show (窗口),img ) )。

cv2 .等待密钥(0) () ) ) ) ) ) ) ) ) ) ) )。

theproblemisthatthescriptdoesn ' tstopwheniclosetheimage.isearchedinformationaboutwaitkeyandifoundthatusingcv2. wait key (0

I don't understand,where is the problem?

thiscodeworksformefromidle :

#-* -编码: utf-8-* -

# objectif : dcouvrirlefonctionnementd ' opencv-python

# http://opencv-python-tutroals.readthedocs.org/en/latest/index.html

import numpy as np

导入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 (

#显示an image

CV2.imshow(window_name,img ) ) ) )。

cv2 .等待密钥(0) () ) ) ) ) ) ) ) ) ) )。

cv2.destroyAllWindows (

Hope this helps for future readers。

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。