open cv convert Bgr image to gray code example
Example 1: opencv grayscale to rgb
backtorgb = cv2.cvtColor(gray,cv2.COLOR_GRAY2RGB)
Example 2: cvtcolor rgb to gray
cv::Mat img
cv::cvtColor(img, img, CV_BGR2GRAY);
backtorgb = cv2.cvtColor(gray,cv2.COLOR_GRAY2RGB)
cv::Mat img
cv::cvtColor(img, img, CV_BGR2GRAY);