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()
相关推荐
吴佳浩32 分钟前
LangChain 深入
人工智能·python·langchain
网安-轩逸3 小时前
回归测试原则:确保软件质量的基石
自动化测试·软件测试·python
Mr_Xuhhh3 小时前
YAML相关
开发语言·python
咖啡の猫3 小时前
Python中的变量与数据类型
开发语言·python
前端达人3 小时前
你的App消息推送为什么石沉大海?看Service Worker源码我终于懂了
java·开发语言
汤姆yu4 小时前
基于springboot的电子政务服务管理系统
开发语言·python
全栈师4 小时前
C#中控制权限的逻辑写法
开发语言·c#
S***q1924 小时前
Rust在系统工具中的内存安全给代码上了三道保险锁。但正是这种“编译期的严苛”,换来了运行时的安心。比如这段代码:
开发语言·后端·rust
执笔论英雄4 小时前
【RL】python协程
java·网络·人工智能·python·设计模式
打点计时器4 小时前
matlab 解决wfdb工具使用本地数据集报错
开发语言·matlab