Closed guoguangchao closed 5 years ago
mobileface_enhancement.py第36行的calcHist函数:hist = cv2.calcHist(img_gray, [0], None, [256], [0, 256])的img_gray没有用中括号,这样计算的是img_gray第一个维度的直方图而不是整个图片的直方图,计算整个图片的直方图应该是hist = cv2.calcHist([img_gray], [0], None, [256], [0, 256]),请问这里是写错了,还是算法就是要计算第一个维度的直方图?谢谢!
@guoguangchao The effect of img_gray is similar or even better than [img_gray]. You can try them freely and choose which method to use according to the actual situation.
img_gray
[img_gray]
我试过了,确实不加中括号的效果更明显,谢谢
mobileface_enhancement.py第36行的calcHist函数:hist = cv2.calcHist(img_gray, [0], None, [256], [0, 256])的img_gray没有用中括号,这样计算的是img_gray第一个维度的直方图而不是整个图片的直方图,计算整个图片的直方图应该是hist = cv2.calcHist([img_gray], [0], None, [256], [0, 256]),请问这里是写错了,还是算法就是要计算第一个维度的直方图?谢谢!