using python2.7 and opencv 2.4.13 .
image_path ="~/237720229_2.jpg"
image1 = cv2.imread(image_path,cv2.IMREAD_GRAYSCALE)
labelMask = np.zeros(image1.shape[:2], dtype="uint8")
labelMask[0:20,0:20] = 255
l = lbp.LBP(10, lbp.LBP_MAPPING_HF)
l.calcLBP(image1)
hist = l.calcHist(labelMask).getHist()
print hist.shape
I got an error
`OpenCV Error: Assertion failed (mask.size() == imsize && mask.channels() == 1) in histPrepareImages, file /Users/deter3/downloads/opencv-2.4.13/modules/imgproc/src/histogram.cpp, line 161
libc++abi.dylib: terminating with uncaught exception of type cv::Exception: /Users/deter3/downloads/opencv-2.4.13/modules/imgproc/src/histogram.cpp:161: error: (-215) mask.size() == imsize && mask.channels() == 1 in function histPrepareImages
Abort trap: 6`
I checked both image and mask shape are the same , both dtype are unit8 .
If i use hist = l.calcHist().getHist() , no problem . But it is histogram for the whole image .