[BangPypers] About code

narayan naik narayannaik.05 at gmail.com
Tue Nov 25 09:20:43 CET 2014


Hi,

import numpy as np
import cv2
img=cv2.imread('4.jpg',0)
cv2.imshow('image',img)
k=cv2.waitKey(0)
if k == 27:
    cv2.destroyAllWindows()
    #cv2.destroyWindow('image')
elif k == ord('S'):
    cv2.imwrite('image.png',img)
    cv2.destroyAllWindows()

when I run this code,it is not possible to close the image window by
pressing esc key,and if going to close by using mouse the window will hang.


More information about the BangPypers mailing list