create_test_image

laserbeamsize.image_tools.create_test_image(h, v, xc, yc, dx, dy, phi, noise=0, ntype='poisson', max_value=255)[source]

Create a 2D test image with an elliptical beam and possible noise.

Create a v x h image with an elliptical beam with specified center and beam dimensions. By default the values in the image will range from 0 to 255. The default image will have no background and no noise.

Parameters:
  • h – number of columns in 2D test image

  • v – number of rows in 2D test image

  • xc – horizontal center of beam

  • yc – vertical center of beam

  • dx – ellipse diameter for axis closest to horizontal

  • dy – ellipse diameter for axis closest to vertical

  • phi – angle that elliptical beam is rotated ccw [radians]

  • noise – normally distributed pixel noise to add to image

  • max_value – all values in image fall between 0 and max_value

Returns:

image – an unsigned 2D integer array of a Gaussian elliptical spot