spymicmac.resample

spymicmac.resample is a collection of tools for resampling images

spymicmac.resample.downsample(img, fact=4)[source]

Rescale an image using Lanczos resampling

Parameters:
  • img (array-like) – the image to rescale

  • fact (numeric) – the number by which to divide the image width and height (default: 4)

Returns:

rescaled (array-like) – the rescaled image

spymicmac.resample.resample_hex(fn_img, scale, ori='InterneScan')[source]

Resample a KH-9 Mapping Camera image based on the reseau grid, using gdal.Warp

Parameters:
  • fn_img (str) – the filename of the image to resample

  • scale (int) – the number of pixels per mm of the scanned image

  • ori (str) – the Ori directory that contains both MeasuresCamera.xml and MeasuresIm (default: InterneScan)

spymicmac.resample.resample_kh4(img)[source]

INCOMPLETE

Parameters:

img (array-like) – the image to resample

Returns:

spymicmac.resample.rotate_kh4(img)[source]

Use the rail marks in a KH-4 image to rotate the image.

Parameters:

img (array-like) – the image to rotate.

Returns:

rotated (array-like) – the rotated image