iso_background_mask

laserbeamsize.masks.iso_background_mask(image, corner_fraction=0.035, nT=3)[source]

Return a mask indicating the background pixels in an image.

We estimate the mean and standard deviation using the values in the corners. All pixel values that fall below the mean+nT*stdev are considered unilluminated (background) pixels.

Parameters:
  • image – the image to work with

  • nT – how many standard deviations to subtract

  • corner_fraction – the fractional size of corner rectangles

Returns:

background_mask – 2D array of True/False values