Tile¶
Qualified name: crop_row_detector.orthomosaic_tiler.Tile
- class Tile(orthomosaic, Upper_left_corner, position, width, height, overlap=0.0, number=0)[source]¶
Bases:
object
Handle all information of a tile with read and write.
- Parameters:
orthomosaic (pathlib.Path) – The orthomosaic from where the tile is taken.
Upper_left_corner (tuple[int, int]) – The pixel coordinate from the orthomosaic of the upper left corner of the tile in (columns, rows).
position (tuple[int, int]) – Tile position in orthomosaic in number of tile in (columns, rows).
width (float) – Tile width.
height (float) – Tile height.
overlap (float) – Overlap as a fraction of width and height.
number (int) – Used to identify tiles.
Methods
Get pixels from tile without overlap.
Get the tiles boundary without the overlap.
Read the tiles image data from the orthomosaic.
Save the image of the tile to a tiff file.
Read data about the tile from the orthomosaic.
Attributes
The tile number.
Window specifying the region of the orthomosaic for this tile.
Window specifying the region of the orthomosaic for this tile with overlap of neighboring tiles.
- read_tile(with_overlap=True)[source]¶
Read the tiles image data from the orthomosaic. If with_overlap is true a window with a border around the tile is used.
- save_tile(image, mask, output_tile_location)[source]¶
Save the image of the tile to a tiff file. Filename is the tile number.
- tile_number¶
The tile number. Useful for identification.