Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

you can't.

converting a color image to grayscale only keeps the luminance information, all color gets discarded (forever !).

in your case, you probably should read in a color image, keep it around, and work on a converted grayscale copy:

bgr = cv2.imread("C:/Users/ma/Dropbox/FYP/sofopy/frames/frame99.jpg", cv2.IMREAD_COLOR)   
gray = cv2.cvtColor(bgr, cv2.COLOR_BGR2GRAY)

p.s. there are cnn's nowadays, that try to "guess" the original color from a grayscale image, but that's another story ...