Image writing

Function method: cv2.imwrite('yahboom1.jpg', img).

The first parameter is the saved file name, and the second parameter is the saved image.

Below we demonstrate the method of image writing. First read an image yahboom.jpg, and then write yahboom1.jpg.

Code path:

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: python3 XX.py

When the code block is run, you can see that the yahboom.jpg image is written to yahboom1.jpg.