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()
相关推荐
我一定会有钱1 分钟前
打造完美工作流:Git 配置”一次推送,三端同步”(Gitee/GitCode/GitHub)
开发语言·windows·vscode·搜索引擎·gitlab·github·visual studio code
matlab代码16 分钟前
基于matlab肤色人脸标记检测系统 GUI界面【源码53期】
开发语言·matlab·人脸标记
李可以量化24 分钟前
Redis 从了解到精通(一・上):量化开发必学的三大基础数据类型
python
KhalilRuan27 分钟前
UnityCsReference——笔记
java·开发语言·笔记
电子云与长程纠缠29 分钟前
UE5 Lyra PocketWorld进行3D内容UI预览 - 上
开发语言·学习·3d·ue5·游戏引擎
you鬰32 分钟前
datawhale--llm-algo-leetcode0️⃣
python
码农大叔的博客39 分钟前
golang示例:for九九乘法表
开发语言·算法·golang
IT学长编程1 小时前
计算机毕业设计 基于用户评论主题挖掘的旅游景点推荐系统 Python 大数据毕业设计 Hadoop毕业设计选题【附源码+文档报告+安装调试】
大数据·python·django·毕业设计·数据可视化分析·旅游景点推荐系统·基于用户评论主题挖掘
内蒙深海大鲨鱼1 小时前
5.Introduction to PyTorch YouTube Series--visualable train
人工智能·pytorch·python
长谷深风1111 小时前
Agent 何时该 Replan:五个关键判断
java·大数据·开发语言·ai agent·ai智能体·agent设计·clarify机制