src.supersampling package

Submodules

src.supersampling.uniform_grid module

src.supersampling.uniform_grid.unif_grid(array, factor)

Scales an image by a factor using uniform using the grid algorithm in uniform distribution. Note: the result is significantly worse for non-integer factors. (Nearest-neighbor interpolation)

Parameters

array – a numpy array representing the image

Returns

a numpy array representing the scaled image

Return type

ndarray

src.supersampling.uniform_grid_2 module

src.supersampling.uniform_grid_2.unif_grid_2(array, factor)

Scales an image by a factor using uniform using the grid algorithm in uniform distribution. (Bilinear interpolation)

Parameters

array – a numpy array representing the image

Returns

a numpy array representing the scaled image

Return type

ndarray

src.supersampling.bicubic module

src.supersampling.bicubic.bicub_inter(array, factor)

Scales an image by a factor using bicubic interpolation.

Parameters

array – a numpy array representing the image

Returns

a numpy array representing the scaled image

Return type

ndarray

src.supersampling.bicubic.bicub_val(m)

Compututes derivatives to calculate coefficients.

M

4 by 4 matrix

Returns

4 by 4 matrix

Return type

ndarray

src.supersampling.bicubic.compute_coeff(col)

Computes coefficients for bicubic interpolation.

Col

a numpy array representing a single color

Returns

a dictionary storing every set of coefficients

Return type

dict

Module contents