Ask Your Question

Mai Kar's profile - activity

2016-12-30 04:11:50 -0600 commented question Unexpected result with RGB Histogram Backprojection in Python

I updated my post, I am using OpenCv 2.4.13 in Python 2.7.12

2016-12-30 04:11:09 -0600 received badge  Editor (source)
2016-12-29 10:53:14 -0600 asked a question Unexpected result with RGB Histogram Backprojection in Python

I am using OpenCv 2.4.13 in Python 2.7.12 and I noticed that when I apply cv2.calcBackProject on the pixel [b,v,r], it returns the backprojection on the pixel [b,v,0], the third channel's value is ignored while my histogram looks fine.

Here is my code :

channels=[0,1,2]
histSize = [8,8,8]
ranges=[0,256, 0,256, 0,256]

#image is in BGR color
bgr_split = cv2.split(roi_img)

#Compute image bgr histogram
hist = cv2.calcHist(bgr_split, channels, mask, histSize, ranges)
cv2.normalize(hist, hist, 0, 255, cv2.NORM_MINMAX)

#Compute histogram backprojection
dst = cv2.calcBackProject([img],channels,hist,ranges,1)

Can someone confirm if it is a bug?