Ask Your Question

porl's profile - activity

2015-03-01 14:12:36 -0600 commented question cv2.mean not returning result

Okay that makes sense however that is what i went with originally and not specifying a mask crashes my program every time. I guess I should just create an appropriate mask.

2015-02-27 10:58:51 -0600 asked a question cv2.mean not returning result

Hi! I've been trying to get the mean color of an image using cv2.mean but no matter what I try it only ever returns (0,0,0,0). The code I am using is below, please tell me where I am going wrong.

img = cv2.imread("kungan.jpg")
l = img.shape[1]
h = img.shape[0]
mask = np.zeros((h,l,1), np.uint8)
mean = cv2.mean(img,mask = mask)
print mean