Using OpenCv I tried to do a simple color-palette by getting RGB values from User. I created a black image using numpy and changed the whole image with user entered BGR values and tried to display it.Unfortunately Python and Ipython stops responding
import cv2
import numpy as np
while(1):
#Getting RGB values from user
r=int(input("Enter R value"))
g=int(input("Enter G value"))
b=int(input("Enter B value"))
#Making a Black image
img=np.zeros((520,520,3),np.uint8)
#Changing whole image with user defined RGB values
img[:]=[b,g,r]
#Making the Image to display
cv2.imshow("Pallete",img)
#Breaking the process while pressing ESC key
key=cv2.waitKey(1)&0xFF
if(key==27):
break
#My IPython Window is not Responding and gets strucked