How to Convert BGR Image into RGB Image using OpenCV

Machine Learning courses with 100+ 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

courses

TechVidvan Team

TechVidvan Team provides high-quality content & courses on AI, ML, Data Science, Data Engineering, Data Analytics, programming, Python, DSA, Android, Flutter, full stack web dev, MERN, and many latest technology.

Leave a Reply

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