![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
opencv
Retrospector
这个作者很懒,什么都没留下…
展开
-
Python cv2图像压缩
对于具有数字规律命名的图像,可以按照下述的代码进行统一缩放# coding: utf-8import cv2import numpy as npfor i in range(1, 10): # 读取图像 filePath = 'E:/' + str(i) + '.jpg' img=cv2.imdecode(np.fromfile(filePath,dtype=np.uint8),-1) # img = cv2.imread(filePath) # 如果用这个,则路径不原创 2020-06-07 20:49:19 · 2824 阅读 · 0 评论 -
Python cv2.imread()基本参数介绍
cv2.imread()除了最常用的路径参数之外,第二个参数也至关重要:imread(const string& filename, int flag=1)filename:需要打开图片的路径,可以是绝对路径或者相对路径,路径中不能出现中文。flag:图像的通道和色彩信息(默认值为1)。flag = -1, 8位深度,原通道flag = 0, 8位深度,1通道f...原创 2020-03-02 12:30:00 · 47536 阅读 · 2 评论 -
Python cv2.imshow()窗口不显示图像的问题
问题描述:在python中使用了cv2.imshow()函数,运行时图片一闪而过,即使添加了time.sleep()函数来阻止窗口关闭,imshow显示的窗口也是灰白的,没有图片信息。原因分析:根据stack overflow上的一个解答,cv2.imshow()后面需要跟随者cv2.waitKey(period)函数,这个函数可以使图像持续显示给定的一段时间period(ms),否则,图片...原创 2020-03-02 12:11:46 · 18320 阅读 · 0 评论