
上QQ阅读APP看书,第一时间看更新
How to do it...
- Import the Computer Vision package - cv2:
import cv2
- Read the image using the built-in imread function:
image = cv2.imread('image_1.jpg')
- Display the original image using the built-in imshow function:
cv2.imshow("Original", image)
- Wait until any key is pressed:
cv2.waitKey(0)
- Save the image using the built-in imwrite function:
cv2.imwrite("Saved Image.jpg", image)
- The command used to execute the Python program Load_Display_Save.py is shown here:

- The result obtained after executing Load_Display_Save.py is shown here:
