cv2.imwrite保存灰度图
时间: 2023-10-27 07:25:37 浏览: 313
在使用OpenCV的cv2.imwrite函数保存灰度图时,可以像下面这样使用:
cv2.imwrite("路径/文件名.jpg", 灰度图像)。
其中,"路径/文件名.jpg"是保存图像的路径和文件名,灰度图像是通过cv2.cvtColor函数将彩色图像转换为灰度图像后得到的。这样就可以将灰度图像保存在指定的路径下了。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [python open-cv 图像处理基础学习(读取,缩放,转换成灰度图,保存)](https://blog.csdn.net/qq_44728587/article/details/122883104)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *3* [对python cv2批量灰度图片并保存的实例讲解](https://download.csdn.net/download/weixin_38668776/13768474)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文