I need to do a histogram equalization for a colored image.
First I convert the colored image to gray and give it to the equalizeHist function:
image = cv2.imread("photo.jpg")
image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
cv2.equalizeHist(image)
cv2.imshow("equalizeHist", image)
cv2.waitKey(0)
But after this I need to convert the image back to RGB; how can i do that?



Source : https://www.packtpub.com/packtlib/book/Application-Development/9781785283932/2/ch02lvl1sec26/Enhancing%20the%20contrast%20in%20an%20image
~edit: original link is no longer available, similar idea is implemented here: Histogram Equalization of a Color image with OpenCV