How to Convert BGR Image into RGB Image using OpenCV

Free OpenCV course with real-time projects Start Now!!

Program 1

import cv2
import matplotlib.pyplot as plt
img=cv2.imread("D://opencvapp//wildlifeImages//walking-dog.jpg")
cv2.imshow('Image Window',img)
# Conver BGR to RGB
rgb=cv2.cvtColor(img,cv2.COLOR_BGR2RGB)
plt.imshow(rgb)
plt.show()
cv2.waitKey(0)
cv2.destroyAllWindows()

 

You give me 15 seconds I promise you best tutorials
Please share your happy experience on Google

follow dataflair on YouTube

Leave a Reply

Your email address will not be published. Required fields are marked *