I had an rgb image which I converted into Ycbcr array.
rgb = cv2.imread(image) r,g,b = cv2.split(rgb) def ycbcr(r, g, b): y = .299*r + .587*g + .114*b