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。