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()
相关推荐
用户298698530149 分钟前
Python 实现 Word 与 TIFF 双向转换的方案
后端·python·api
weixin_3077791318 分钟前
C++代码实现MATLAB中的spectralcluster函数功能
开发语言·c++·算法·matlab
鸽鸽程序猿18 分钟前
【项目】【在线判题系统】c端:竞赛报名
c语言·开发语言
benchmark_cc21 分钟前
实时行情和分钟 K 线应该如何配合使用?从信号计算到交易决策的完整分析
大数据·python·数据分析·pandas·量化交易·股票数据·quantdash
Wang's Blog22 分钟前
Java 项目实战: 交友项目 - 个人资料管理的需求分析与接口设计
java·开发语言·交友
LMT流氓兔24 分钟前
第四单元——第17课:让回答边生成、边显示
服务器·数据库·人工智能·python·oracle·langchain
1024奇点26 分钟前
【仓颉语言入门 · 第二篇 第 8 课】
开发语言·数据库·ide·mysql·开源
MetWeave28 分钟前
从零跑一个气象数据管道:抓取、清洗、对账、节奏
后端·python
用户38514085394739 分钟前
Python 的 O_NOFOLLOW 为什么挡不住中间目录的符号链接?
python
gopher951141 分钟前
RUST:序列化与反序列化 serde + derive 详解
开发语言·后端·rust