简体   繁体   English

Python OpenCV如何在转换后保存图像

[英]Python OpenCV how to save an image after transforming it

I am new to python. 我是python的新手。 I am using opencv to tranform an image. 我正在使用opencv转换图像。
Below are the two last lines in the script: 以下是脚本中的最后两行:

warped = warped.astype("uint8") * 255
cv2.imshow("Scanned", imutils.resize(warped, height = 650))

I would like to save the warped image as a jpeg file. 我想将变形的图像另存为jpeg文件。
How do I go about it? 我该怎么办?

首先将修改后的图像保存在变量中,然后使用以下命令:

cv2.imwrite("IMAGE_NAME.png", warpedimage)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM