Downsample
Description
Performance is always important, but some algorithms are very expensive to apply to large picture sizes. To accommodate for this in Computer Vision we often need reduce an original image to a smaller size before we apply a given algorithm.
Params
tSrc | Tensor | The source image to be downsampled. |
coefficient | number | Downsampling coefficient. |
type? | string | Downsampling support two possible variants of processing pixels to be downsampled 'bicubic', 'nearest'. |
Example
// this line reduces an input image in 3x
gm.downsample(inputImage, 3, 'nearest');