Colours look wrong: faces are blue
- Python
- OpenCV
Why it happens
- OpenCV uses BGR; matplotlib, PIL and the web use RGB.
How to fix it
- Use
cv2.cvtColor(img, cv2.COLOR_BGR2RGB)beforeplt.imshow. - Remember red in OpenCV is
(0, 0, 255).
It worked if: Red objects look red.
Related errors
Tutorials where it can happen
- Python & OpenCV: Set Up Your Computer-Vision Workshop
- Python & NumPy Crash Course: An Image Is an Array
- Contours & Colour Tracking: Follow the Ball 🔒
- Filters, Thresholds & Edges: Classic Computer Vision 🔒
- Homography: From Camera View to Pitch Map 🔒
- Images, Pixels & Colour Spaces: Finding the Pitch with HSV 🔒
From the official documentation. From OpenCV's documentation. Sources: OpenCV: colour conversions.
Didn't help? Search another error or ask us.

