c - OpenCV : How to Load png images with 4 channels? -


I have a fortune with transparency channel (RGB and alpha). It appears that OpenCV pulls out the 4th channel of the image.

Itemprop = "Text">

If you are using OpenCV2 or OpenCV3, then you should use IMREAD_ * flag (as stated above).

C ++

  using namespace CV; Mat image = imed ("image page", imrad_nchenzed);  

Python

  import cv2 im = cv2.imread ("image.png", cv2.IMREAD_UNCHANGED)