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()
相关推荐
这个人懒得名字都没写4 小时前
Python包管理新纪元:uv
python·conda·pip·uv
有泽改之_4 小时前
leetcode146、OrderedDict与lru_cache
python·leetcode·链表
是毛毛吧5 小时前
边打游戏边学Python的5个开源项目
python·开源·github·开源软件·pygame
暮乘白帝过重山5 小时前
ArkTS ForEach 参数解析:组件与键值生成器
开发语言·数据库
LiamTuc5 小时前
Java构造函数
java·开发语言
三途河畔人5 小时前
Pytho基础语法_运算符
开发语言·python·入门
Benmao⁢5 小时前
C语言期末复习笔记
c语言·开发语言·笔记·leetcode·面试·蓝桥杯
adsadswee5 小时前
Qt 样式与 QLinearGradient 渐变详解
开发语言·qt·qt样式表·qlineargradient·qss渐变效果
花月C6 小时前
个性化推荐:基于用户的协同过滤算法
开发语言·后端·算法·近邻算法
脾气有点小暴6 小时前
前端页面跳转的核心区别与实战指南
开发语言·前端·javascript