If you are using OpenCV 2 or OpenCV 3 you should use IMREAD_* flags (as mentioned at here).
C++
using namespace cv;
Mat image = imread("image.png", IMREAD_UNCHANGED);
Python
import cv2
im = cv2.imread("image.png", cv2.IMREAD_UNCHANGED)
Related Contents:
- Size of Matrix OpenCV
- How to find out what type of a Mat object is with Mat::type() in OpenCV?
- Augmented Reality SDK with OpenCV [closed]
- What are keypoints in image processing?
- Could not find module FindOpenCV.cmake ( Error in configuration process)
- Package opencv was not found in the pkg-config search path
- PyLint not recognizing cv2 members
- How to define the markers for Watershed in OpenCV?
- Computing x,y coordinate (3D) from image point
- sift = cv2.xfeatures2d.SIFT_create() not working even though have contrib installed
- Why OpenCV Using BGR Colour Space Instead of RGB
- How to crop a CvMat in OpenCV?
- What does cv::normalize(_src, dst, 0, 255, NORM_MINMAX, CV_8UC1);
- How to verify the correctness of calibration of a webcam?
- Tensorflow vs OpenCV [closed]
- cv::imwrite could not find a writer for the specified extension
- cv2.imshow() function is opening a window that always says not responding – python opencv
- Haar Cascades vs. LBP Cascades in Face Detection [closed]
- OpenCV: IplImage versus Mat, which to use?
- How to use OpenCV SimpleBlobDetector
- How to detect simple geometric shapes using OpenCV
- “Could not find a version that satisfies the requirement opencv-python”
- What’s the difference between Mat::clone and Mat::copyTo?
- convert Matrix of type CV_32FC1 to CV_64FC1
- OpenCV as a static library (cmake options)
- Computing camera pose with homography matrix based on 4 coplanar points
- How to use the OTSU Threshold in opencv?
- Where can I find haar cascades xml files?
- Cannot find module cv2 when using OpenCV
- How to remove convexity defects in a Sudoku square?
- Checking images for similarity with OpenCV
- What does OpenCV’s cvWaitKey( ) function do?
- open cv error: (-215) scn == 3 || scn == 4 in function cvtColor
- Does performance differ between Python or C++ coding of OpenCV?
- OpenCV Python rotate image by X degrees around specific point
- Automatic contrast and brightness adjustment of a color photo of a sheet of paper with OpenCV
- Python: How to pip install opencv2 with specific version 2.4.9?
- How to get image width and height in OpenCV? [duplicate]
- How do I resolve “Please make sure that the file is accessible and that it is a valid assembly or COM component”?
- Can’t use SURF, SIFT in OpenCV
- Difference in output with waitKey(0) and waitKey(1)
- OpenCV/Python: read specific frame using VideoCapture
- How can one display an image using cv2 in Python
- Camera position in world coordinate from cv::solvePnP
- using OpenCV and SVM with images
- How can I determine distance from an object in a video?
- Using OpenCV in Swift iOS
- how to add border around an image in opencv python
- Add padding to images to get them into the same shape
- Failure to use adaptiveThreshold: CV_8UC1 in function adaptiveThreshold