PythonOpenCV

2. Image write

2020-01-13  本文已影响0人  JaedenKil
import cv2 as cv2


gray_img = cv2.imread('C:\\Users\\zzheng\\Pictures\\tiger.png', cv2.IMREAD_GRAYSCALE)
status = cv2.imwrite('C:\\Users\\zzheng\\Pictures\\tiger02.png', gray_img)
print("Image write status: '%s'." % status)

cv2.imwrite('/path/to/destination/image.png',image)
First Argument is Path to the destination on file system, where image is ought to be saved.
Second Argument is ndarray containing image
Returns True is returned if the image is written to file system, else False.

上一篇下一篇

猜你喜欢

热点阅读