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

  1. Use cv2.cvtColor(img, cv2.COLOR_BGR2RGB) before plt.imshow.
  2. Remember red in OpenCV is (0, 0, 255).

It worked if: Red objects look red.

From the official documentation. From OpenCV's documentation. Sources: OpenCV: colour conversions.

Didn't help? Search another error or ask us.