iso_background

laserbeamsize.background.iso_background(image, corner_fraction=0.035, nT=3)[source]

Return the background for unilluminated pixels in an image.

This follows one method described in ISO 11146-3 to determine the background in an image.

We first estimate the mean and standard deviation using the values in the corners. All pixel values that fall below the mean+nT*stdev are considered un-illuminated (background) pixels. These are averaged to find the background value for the image.

Parameters:
  • image – the image to work with

  • nT – how many standard deviations to subtract

  • corner_fraction – the fractional size of corner rectangles

Returns:

mean, stdev – mean and stdev of background in the image