图像阅读器不可知论工具的极简集,可轻松在大图像上迭代
tiling的Python项目详细描述
[![构建状态](https://travis-ci.org/vfdev-5/imagetilingutils.svg?branch=master)(https://travis ci.org/vfdev-5/imagetilingutils)
[![覆盖状态](https://coveralls.io/repos/github/vfdev-5/imagetilingutils/badge.svg?branch=master)](https://coveralls.io/github/vfdev-5/imagetilingutils?分支=主)
[![文档状态](https://readthedocs.org/projects/imagetilingutils/badge/?版本=最新](http://imagetilingutils.readthedocs.io/en/latest/?badge=latest)
图像平铺实用程序
一组与图像读取器无关的极简工具,可以轻松地在大图像上迭代
**示例1**
让我们在大图像上迭代,重叠并始终提取相同大小的平铺(以像素为单位)。假设数据访问提供了一个示例函数
`` python
def read_data(x,y,width,height,out_width=none,out_height=none):
out_width=width if out_width为none out_width
out_height=height if out_height为none out_height
img.read(x,y,width,height,out_width,因此,重叠的平铺可以从平铺导入constristictiles中提取为
``python
tiles=constristictiles(图像大小=(500,500),平铺大小=(256,256),
stride=(100,100))
print(“平铺数量:%i%len(平铺))
对于范围,平铺中的out大小:
x,y,width,height=extent
data=read_data(x,y,width,height,
out_width=out_size[0],
out_height=out_size[1])
打印(“data.shape:{}”。格式(data.shape))
访问磁贴:
i=len(磁贴)//2
extent,out_size=tiles[i]
```
![example_tiles](examples/example_tiles.png)
## Installation:
#### from pip
```bash
pip install tiling
```
#### from sources
Package installation is very simple
```bash
pip install git+https://github.com/vfdev-5/ImageTilingUtils.git
```
## Examples
For more practical 示例,请参见[笔记本](examples/example_const_stride_tiling.ipynb)
[![覆盖状态](https://coveralls.io/repos/github/vfdev-5/imagetilingutils/badge.svg?branch=master)](https://coveralls.io/github/vfdev-5/imagetilingutils?分支=主)
[![文档状态](https://readthedocs.org/projects/imagetilingutils/badge/?版本=最新](http://imagetilingutils.readthedocs.io/en/latest/?badge=latest)
图像平铺实用程序
一组与图像读取器无关的极简工具,可以轻松地在大图像上迭代
**示例1**
让我们在大图像上迭代,重叠并始终提取相同大小的平铺(以像素为单位)。假设数据访问提供了一个示例函数
`` python
def read_data(x,y,width,height,out_width=none,out_height=none):
out_width=width if out_width为none out_width
out_height=height if out_height为none out_height
img.read(x,y,width,height,out_width,因此,重叠的平铺可以从平铺导入constristictiles中提取为
``python
tiles=constristictiles(图像大小=(500,500),平铺大小=(256,256),
stride=(100,100))
print(“平铺数量:%i%len(平铺))
对于范围,平铺中的out大小:
x,y,width,height=extent
data=read_data(x,y,width,height,
out_width=out_size[0],
out_height=out_size[1])
打印(“data.shape:{}”。格式(data.shape))
访问磁贴:
i=len(磁贴)//2
extent,out_size=tiles[i]
```
![example_tiles](examples/example_tiles.png)
## Installation:
#### from pip
```bash
pip install tiling
```
#### from sources
Package installation is very simple
```bash
pip install git+https://github.com/vfdev-5/ImageTilingUtils.git
```
## Examples
For more practical 示例,请参见[笔记本](examples/example_const_stride_tiling.ipynb)