extract random subset of pixels from an image

get_random_subset_from_image(
  ImPath,
  MaskPath,
  nb_partitions,
  Pix_Per_Partition,
  kernel = NULL,
  MaxRAM = 0.5
)

Arguments

ImPath

character. path for the image to sample

MaskPath

character. path for the corresponding mask

nb_partitions

numeric. number of repetitions of kmeans

Pix_Per_Partition

numeric.

kernel

numeric.

MaxRAM

numeric.

Value

list, see Details

Details

The returned list contains: - DataSubset: matrix of NxP of N samples and P bands - nbPix2Sample: integer giving the number of pixels sampled (only central pixel of kernel) - coordPix: a data.table with columns 'row', 'col' of pixel in the image corresponding to each row of DataSubset, and if kernel is not NULL Kind (Kernel index) and 'id' the sample ID to be used with the kernel