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

libGdx unable to find files in android application data directory -

php - Webix Data Loading from Laravel Link -

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