slice_image: Slice an image into tiles for scoring with a Keras model

Description Usage Arguments Value

Description

Slice an image into tiles for scoring with a Keras model

Usage

1
2
3
4
slice_image(img_object, img_path, slice_n_rows, slice_n_cols,
  slice_overlap_px = 0, complete_image = FALSE,
  img_xml_wkt_path = NULL, wkt_string = NULL, proj4_string = NULL,
  reproject_raster = FALSE, return_sf = FALSE, verbose = FALSE)

Arguments

img_object

Image object that can be read by brick.

img_path

Path to image file that can be read by brick. Overridden by 'img_object'.

slice_n_rows

Number of rows in each tile. See calc_slice_corners. Required.

slice_n_cols

Number of columns in each tile. See calc_slice_corners. Required.

slice_overlap_px

Number of pixel overlap in adjacent tiles (in both X and Y directions). See calc_slice_corners.

complete_image

If TRUE and the tile size and overlap dimensions do not conform to covering the entire source raster/image, an additional row and column of tiles will be created that include the excluded pixels but do NOT respect the overlap value. If FALSE and the dimensions do not conform, the set of tiles will omit some pixels on the right and bottom side of the source raster/image. See calc_slice_corners.

img_xml_wkt_path

Optional path to .xml file containing metadata about image in WKT format.

wkt_string

Optional WKT string containing image projection information. Overridden by 'img_xml_wkt_path' if present.

proj4_string

Optional proj4 string containing image projection information. Overridden by 'img_xml_wkt_path' of 'wkt_string' if present.

reproject_raster

Should raster be re-projected to projection specified in 'img_xml_wkt_path', 'wkt_string', or 'proj4_string'?

return_sf

Should output data frame be an sf object (default regular data frame)?

verbose

Should messages about current step being processes be printed to screen?

Value

Data frame with one row for each tile, containing: - img_path - img_xml_wkt_path (if present) - Numeric tile ID number - Tile corner cells in source pixel values - List-column containing each tile's extent based on the source jp2's projected raster - sf geometry column containing each tile's sf polygon - List-column containing tile's RGB layers in a 4d array of dimension [1, slice_n_cols, slice_n_rows, 3]


treysp/coolit documentation built on June 5, 2019, 5:16 p.m.