Welcome to Raspberry Pi 4B repository
3.OpenCV image write
OpenCV image write
cv2.imwrite('yahboom1.jpg', img)
The first parameter is the name of the saved file, and the second parameter is the saved image.
Next, we will demonstrate the method of image writing. First, we need to read an image yahboom.jpg, then, write it to yahboom1.jpg.
Code:
import cv2 |
Note: The cv2.imshow ('yahboom, img) function in jupyLab cannot be executed. If you need to use this sentence to display the read image, you need to execute the python file through the command on the Raspberry Pi graphical interface.
Command: python3 XX.py
#bgr8 to jpeg format |
import ipywidgets.widgets as widgets |