opencv-python(二)

马赛克

python 复制代码
    img = cv2.imread('./bao.jpeg')
    print(img.shape)
    img2 = cv2.resize(img,(35,23))
    img3 = cv2.resize(img2,(900,666))
    cv2.imshow('bao',img3)
    cv2.waitKey(0)
    cv2.destroyAllWindows()
python 复制代码
    img2 = cv2.resize(img, (90,66))
    img3 = np.repeat(img2, 10, axis= 0) # 重复行
    img4 = np.repeat(img3, 10, axis=1)  # 重复列
    cv2.imshow('bao',img4)
    cv2.waitKey(0)
    cv2.destroyAllWindows()
python 复制代码
    img2 = img[::10, ::10]  # 每10个中取出一个像素
    cv2.namedWindow('bao', flags=cv2.WINDOW_NORMAL)
    cv2.resizeWindow('bao', 900, 666)
    cv2.imshow('bao', img2)
    cv2.waitKey(0)
    cv2.destroyAllWindows()
相关推荐
坐吃山猪2 分钟前
Python27_协程游戏理解
开发语言·python·游戏
gCode Teacher 格码致知2 分钟前
Javascript提高:小数精度和随机数-由Deepseek产生
开发语言·javascript·ecmascript
Polar__Star3 分钟前
Redis如何利用位图快速判断数据存在性
jvm·数据库·python
2301_8176722617 分钟前
CSS如何实现优雅的间距_使用CSS Grid控制盒模型间隙
jvm·数据库·python
你说咋整就咋整17 分钟前
openGauss6.0.3 一主二从集群安装手册
数据库·python·gaussdb
Shorasul17 分钟前
JavaScript中显式创建包装对象的后果与性能损耗
jvm·数据库·python
椰猫子37 分钟前
Javaweb(Filter、Listener、AJAX、JSON)
java·开发语言
吕源林41 分钟前
C#怎么实现EF Core迁移 C#如何用Entity Framework Core进行数据库迁移和更新表结构【数据库】
jvm·数据库·python
qq_206901391 小时前
JavaScript中箭头函数在对象字面量方法中的潜在错误
jvm·数据库·python
盛世宏博北京1 小时前
以太网温湿度传感器运维技巧,提升设备稳定性与使用寿命
开发语言·php·以太网温湿度传感器