zhiqingstudy

Be a young person with knowledge and content

The api used by Opencv to save pictures is imwrite (name, img)
Two parameters of imwrite:
  1. Name: File name to be saved
  2. Img: Specify who to save to the file here, which is Mat type


import cv2
from cv2 import IMREAD_COLOR

cv2.namedWindow('img',cv2.WINDOW_NORMAL)
img=cv2.imread('20220627214919.jpg',IMREAD_COLOR)
cv2.imshow('img',img)
key=cv2.waitKey(0)
if key==ord('q'): # 设置按q键退出
    exit()
elif key==ord('s'): # 设置按s键保存图片
    cv2.imwrite('图片路径和文件名加图片后缀(使用英文和数字)',img) # 保存图片

cv2.destroyAllWindows()
comment
head sculpture
Code:
Related

Why you shouldn't stay at a job for more than 2 years?

3 harsh facts long-distance relationships

how to keep your girlfriend interested in a long-distance relationship




Unless otherwise specified, all content on this website is original. If the reprinted content infringes on your rights, please contact the administrator to delete it
Contact Email:2380712278@qq.com

Filing number:皖ICP备19012824号