终端cv2.imread读取
时间: 2023-10-23 19:35:32 浏览: 97
imread实现过程
终端中的cv2.imread函数用于读取图像。该函数接受一个参数,即图像在磁盘上的路径。例如,要读取名为"image.png"的图像,可以使用以下代码:
image = cv2.imread("path/to/image.png")
请注意,图像应该位于与执行代码的目录相同的位置,否则需要提供图像的完整路径。此函数支持各种文件格式,例如JPG,BMP,PNG等。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [Matlab读取BMP文件代码-OpenCV-Reading-Writing-and-Displaying-Images:OpenCV阅读,写](https://download.csdn.net/download/weixin_38675506/19001038)[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: 33.333333333333336%"]
- *2* [1.opencv加载图像(cv2.imread)](https://blog.csdn.net/wanlong_peng/article/details/117338951)[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: 33.333333333333336%"]
- *3* [cv2.imread()+plt.imread()+Image.open()的读取与相应的显示图片](https://blog.csdn.net/weixin_44359479/article/details/123981118)[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: 33.333333333333336%"]
[ .reference_list ]
阅读全文