downsample

seas.video.downsample(array: numpy.ndarray, new_shape: Tuple[int, int, int], keepdims: bool = False)numpy.ndarray[source]

Reshape m by n matrix by factor f by reshaping matrix into m f n f matricies, then applying sum across mxf, nxf matrices if keepdims, video is downsampled, but number of pixels remains the same.

The scale_video function is an application of this function, is more user friendly, and should be used in most cases.

Parameters
  • array – The array to downsample.

  • new_shape – The new array shape to convert array to.

  • keepdims – Whether to keep the orignal dimensions. Only useful to differentiating whether downsample differences are just due to number of samples.

Returns

The downsampled array.

Return type

array