Extract chips from images

To do…

[1]:
!satproc_extract_chips -h
usage: satproc_extract_chips [-h] [--size SIZE] [--step-size STEP_SIZE]
                             [--sliding-windows-mode {exact,whole,whole_overlap}]
                             [--labels LABELS]
                             [--label-property LABEL_PROPERTY]
                             [--classes CLASSES [CLASSES ...]]
                             [--masks {extent,boundary,distance} [{extent,boundary,distance} ...]]
                             [--mask-type {single,class,instance}] [--aoi AOI]
                             [--within] [--no-within] [-o OUTPUT_DIR]
                             [--rescale] [--no-rescale]
                             [--rescale-mode {percentiles,values,s2_rgb_extra}]
                             [--lower-cut LOWER_CUT] [--upper-cut UPPER_CUT]
                             [--min MIN] [--max MAX] [-b BANDS [BANDS ...]]
                             [-t {jpg,tif}] [--write-footprints]
                             [--no-write-footprints] [--crs CRS]
                             [--skip-existing] [--no-skip-existing]
                             [--skip-low-contrast] [--no-skip-low-contrast]
                             [--extent-no-border] [--version] [-v] [-vv]
                             raster [raster ...]

Extract chips from a raster file, and optionally generate mask chips

positional arguments:
  raster                input raster file(s)

optional arguments:
  -h, --help            show this help message and exit
  --size SIZE           size of image tiles, in pixels (default: 256)
  --step-size STEP_SIZE
                        step size (i.e. stride), in pixels (default: 128)
  --sliding-windows-mode {exact,whole,whole_overlap}
                        mode of sliding windows (default: whole_overlap)
  --labels LABELS       inpul label shapefile (default: None)
  --label-property LABEL_PROPERTY
                        label property to separate in classes (default: class)
  --classes CLASSES [CLASSES ...]
                        specify classes order in result mask. (default: None)
  --masks {extent,boundary,distance} [{extent,boundary,distance} ...], -m {extent,boundary,distance} [{extent,boundary,distance} ...]
  --mask-type {single,class,instance}
  --aoi AOI             Filter by AOI vector file (default: None)
  --within              only create chip is it is within AOI (if provided)
                        (default: False)
  --no-within           create chip if it intersects with AOI (if provided)
                        (default: False)
  -o OUTPUT_DIR, --output-dir OUTPUT_DIR
                        output dir (default: .)
  --rescale             rescale intensity using percentiles (lower/upper cuts)
                        (default: False)
  --no-rescale          do not rescale intensity (default: True)
  --rescale-mode {percentiles,values,s2_rgb_extra}
                        choose mode of intensity rescaling (default:
                        percentiles)
  --lower-cut LOWER_CUT
                        (for 'percentiles' mode) lower cut of percentiles for
                        cumulative count in intensity rescaling (default: 2)
  --upper-cut UPPER_CUT
                        (for 'percentiles' mode) upper cut of percentiles for
                        cumulative count in intensity rescaling (default: 98)
  --min MIN             (for 'values' mode) minimum value in intensity
                        rescaling (default: None)
  --max MAX             (for 'values' mode) maximum value in intensity
                        rescaling (default: None)
  -b BANDS [BANDS ...], --bands BANDS [BANDS ...]
                        specify band indexes. If type is 'jpg', defaults to
                        (1, 2, 3). If type is 'tif', defaults to the total
                        band count. (default: None)
  -t {jpg,tif}, --type {jpg,tif}
                        output chip format (default: tif)
  --write-footprints    write a GeoJSON file of chip footprints (default:
                        False)
  --no-write-footprints
                        do not write a GeoJSON file of chip footprints
                        (default: True)
  --crs CRS             force CRS of input files (default: None)
  --skip-existing       skip already existing chips (and masks) (default:
                        True)
  --no-skip-existing    do not skip already existing chips (and masks)
                        (default: True)
  --skip-low-contrast   skip image chips with low contrast (default: False)
  --no-skip-low-contrast
                        do not skip image chips with low contrast (default:
                        True)
  --extent-no-border    do not include border in extent mask (default: False)
  --version             show program's version number and exit
  -v, --verbose         set loglevel to INFO (default: None)
  -vv, --very-verbose   set loglevel to DEBUG (default: None)
[ ]: