auromat.solving.masking module

The module contains algorithms to automatically mask those image areas which are most likely containing the starfield.

It does so by using a combination of constant thresholding, adaptive thresholding, line detection and contour detection. It assumes that the starfield has a more or less constant background brightness. It was developed and tested with ISS aurora images, so it may be biased towards those.

auromat.solving.masking.maskStarfield(imagePath, channel=None, blackenLowerPart=True, ignoreVeryDark=True, debugPathPrefix=None, debugJpegQuality=80)[source]

Automatic masking of the starfield in the given image using a combination of image processing and object detection steps.

Parameters:
  • channel (str) – the channel to use for analysis ‘R’,’G’,’B’, or None for combining all channels into a grayscale image
  • blackenLowerPart (bool) – If the earth is in the lower part of the image then this should be set to True as it will broadly mask parts of the earth not detected otherwise.
  • ignoreVeryDark (bool) – If True, then areas (block) which are almost totally black are not considered as starfield. This is sometimes useful to ignore very dark spacecraft structures which would later on be detected as stars.
  • debugPathPrefix (str) – if given, the folder in which to store debug images illustrating the different processing stages
  • debugJpegQuality (int) – JPEG quality from 0 to 100 used for storing debug images; only contour images are currently saved as JPEG
Return type:

tuple (mask, sigma)

auromat.solving.masking.maskStarfieldRect(imagePath, topLeft, bottomRight, debugPathPrefix=None)[source]

Mask an image using the given coordinates representating a rectangle.

Parameters:
  • imagePath
  • topLeft – (x,y) pair of top left rectangle pixel
  • bottomRight – (x,y) pair of bottom right rectangle pixel
Return type:

tuple (mask, sigma)