get_random_subset_from_image: extract random subset of pixels from an image

View source: R/Lib_ImageProcess.R

get_random_subset_from_imageR Documentation

extract random subset of pixels from an image

Description

extract random subset of pixels from an image

Usage

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.

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

Value

list, see Details


jbferet/biodivMapR documentation built on April 25, 2024, 10:44 p.m.