Welcome to Raspbot 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 path:
/home/pi/Yahboom_Project/Raspbot/1.OpenCV_course/01Getting_started/OpenCV/01_OpenCV_image_read_display.ipynb
|
|