Ask Your Question

Revision history [back]

how to convert the gray image to color image

image=cv2.imread("C:/Users/ma/Dropbox/FYP/sofopy/frames/frame99.jpg",cv2.IMREAD_GRAYSCALE) cimage=cv2.cvtColor(image,cv2.COLOR_GRAY2BGR) cv2.namedWindow("image",cv2.WINDOW_NORMAL) cv2.imshow("image",cimage) cv2.waitKey(0) cv2.destroyAllWindows()

how to convert the gray image to color image

code:

image=cv2.imread("C:/Users/ma/Dropbox/FYP/sofopy/frames/frame99.jpg",cv2.IMREAD_GRAYSCALE)
cimage=cv2.cvtColor(image,cv2.COLOR_GRAY2BGR)
cv2.namedWindow("image",cv2.WINDOW_NORMAL)
cv2.imshow("image",cimage)
cv2.waitKey(0)
cv2.destroyAllWindows()

cv2.destroyAllWindows()