Why doesn't opencv give this rectangle a colour using python's cv2 -


the following code draws white rectangle. not supposed that. considering opencv uses bgr colorspace, should http://www.colorpicker.com/?colorcode=9f635f

import cv2 import numpy np  drawing = np.zeros([500, 500, 3]) cv2.rectangle(drawing, (0, 0), (250, 250), (95, 99, 159), -1) cv2.imshow("drawing", drawing) cv2.waitkey() 

it draw fine if change

drawing = np.zeros([500, 500, 3]) 

to

drawing = np.zeros([500, 500, 3], np.uint8) 

otherwise, image of 32f type.

enter image description here


Comments

Popular posts from this blog

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -