Python Imaging Library: ImagePath Module(图像路径模块)
来源:互联网 发布:法治知识网络大赛登录 编辑:程序博客网 时间:2024/06/07 18:01
Python Imaging Library: ImagePath Module(图像路径模块)
ImagePath模块用于存储和操作二维向量数据。路径对象可以在 ImageDraw 模块中传递方法。
函数
Path
ImagePath.Path(coordinates) ⇒ Path instance
创建一个路径对象。
坐标列表可以是任何包含二元组[(x, y)]的序列对象,或者数值[x, y, ……]。
您还可以从另一个path对象创建path对象。
在版本1.1.6和更高版本中,您还可以传入任何实现Python缓冲区API的对象。
缓冲区应该提供读访问,并在机器字节顺序中包含C浮点数。
Path对象实现了Python序列接口的大部分,并且表现得像一个(x,y)对的列表。您可以使用常用的len()、条目访问和片分配。
但是,当前版本不支持片分配,也不支持项目和片删除。
Path Methods
compact
p.compact(distance=2) ⇒ count
通过删除彼此相近的点来压缩路径。该方法修改路径,并返回路径中留下的点的数量。
distance距离被测量为“城市块距离,city-block distance”,并且默认为两个像素。
getbbox
p.getbbox() ⇒ 4-tuple
得到路径的边界框。
map
p.map(function)
通过一个函数映射路径。
tolist
p.tolist() ⇒ list
将路径转换为Python列表 [ (x, y)…… ]。
p.tolist(flat=0) ⇒ list
(版本1.1.5)将路径转换为Python列表。
如果flat标记为0或省略,则结果列表包含二元组[(x,y), …]。
如果flat标记是1,那么这个列表就是平坦的x y。
transform
p.transform(matrix)
使用仿射变换将路径转换成位置。
这个矩阵是一个六元组(a、b、c、d、e、f),每个点都被映射成如下:
阅读全文
0 0
- Python Imaging Library: ImagePath Module(图像路径模块)
- Python Imaging Library: ImageColor Module(图像颜色模块)
- Python Imaging Library: ImageChops Module(图像通道操作模块)
- Python Imaging Library:ImageDraw Module(图像绘制模块)
- Python Imaging Library: ImageEnhance Module(图像增强模块)
- Python Imaging Library: ImageFilter Module(图像滤波模块)
- Python Imaging Library: ImageGrab Module(图像采集模块)
- Python Imaging Library: ImageMath Module(图像数学运算模块)
- Python Imaging Library: ImageOps Module(图像运算模块)
- Python Imaging Library: ImagePalette Module(图像调色板模块)
- Python Imaging Library: ImageQt Module(图像QT模块)
- Python Imaging Library: ImageSequence Module(图像序列模块)
- Python Imaging Library: ImageStat Module(图像统计模块)
- Python Imaging Library: ImageTk Module(图像Tkinter模块)
- Python Imaging Library: ImageWin Module(图像Windows模块)
- Python Imaging Library: ImageFile Module(图像文件模块)
- Python Imaging Library: PSDraw Module(Postscript打印机模块)
- Python图像处理库PIL的ImagePath模块介绍
- Mahmoud and a Dictionary CodeForces
- Android ListView的item点击没有反应
- Dubbo+Zookeeper入门实例
- Jzoj4845 寻找
- BUG管理
- Python Imaging Library: ImagePath Module(图像路径模块)
- C#程序设计(第二版)-王贤明-清华大学出版社-笔记
- LeetCode112. Path Sum
- Effective Java -- 用私有构造器或者枚举类型强化Singleton属性
- 命令模式-unity实现
- CodeVS 2245 浅谈二维线段树优化间距限制型LCS动态规划状态转移
- C++——【USACO 5.4.2】——Character Recognition
- 解决androiud studio kotlin插件一直提示命名规范的问题
- lvs为何不能完全替代DNS轮询