Welcome to Raspberry Pi 4B repository
2.OpenCV image read and display
OpenCV image read and display
1) Reading of images:
img = cv2.imread('yahboom.jpg', 0) The first parameter is the path of the image, and the second parameter is how to read the image.
cv2.IMREAD_UNCHANGED: Keep the original format, can be represented by parameter -1;
cv2.IMREAD_COLOR: Reading pictures in grayscale, can be represented by parameter 0;
cv2.IMREAD_GRAYSCALE: Reading pictures in color mode, can be represented by 1, default value;
cv2.IMREAD_UNCHANGED: Read pictures and include its alpha channel,can be represented by 2.
2) Displaying of image:
Code:
#bgr8 to jpeg format |
# The image component in jupyterLab shows the read image
|