subtract_iso_background

laserbeamsize.background.subtract_iso_background(image, corner_fraction=0.035, nT=3, iso_noise=True)[source]

Return image with ISO 11146 background subtracted.

The mean and standard deviation are estimated using the pixels from the rectangles in the four corners. The default size of these rectangles is 0.035 or 3.5% of the full image size.

The new image will have a constant with the corner mean subtracted.

ISO 11146-3 recommends values from 2-5% for corner_fraction.

ISO 11146-3 recommends from 2-4 for nT.

If iso_noise is False, then after subtracting the mean of the corners, pixels values < nT * stdev will be set to zero.

If iso_noise is True, then no zeroing background is done.

Parameters:
  • image – the image to work with

  • corner_fraction – the fractional size of corner rectangles

  • nT – how many standard deviations to subtract

Returns:

image – 2D array with background subtracted