<built-in function calcHist> returned NULL without setting an error

Viewed 114

I'm using Python obtain a historgam for each RGB channel for each picture (I have 10 classes with 5000 pics in each), but there is an error occurs: built-in function calcHist returned NULL without setting an error

Here is my code:

pic_arr = np.array([])

for _class in classes:
    for sample in range(1,5001): 
        for i in enumerate(['b','g','r']):
            histr = cv2.calcHist([sample],[i],None,[8],[0,256]) # (images, channels, mask (full img), histSize (split hist in 
                                                                # 8 parts), ranges)
            pic_arr.extend([histr])

I can't understand what is wrong in my code and I can't even find solvation in the Internet, could you help me please?

0 Answers
Related