Explore Library
Code QuizIntermediate

Computing a Pixel Histogram

Spot the argument mistake when computing an image histogram with OpenCV.

Codepython
import cv2

img = cv2.imread('photo.jpg', 0)  # grayscale
hist = cv2.calcHist(img, [0], None, [256], [0, 256])
print(hist.shape)

What is the bug in this histogram computation?