nanopyx.core.generate.noise_add_squares

def add_squares(image, vmax=100.0, vmin=0.0, nSquares=100):

Add random squares to an image

Parameters
  • image: The image to add the squares to
  • vmax: The maximum intensity value of the squares
  • vmin: The minimum intensity value of the squares
  • nSquares: The number of squares to add
def get_squares(w, h, vmax=100.0, vmin=0.0, nSquares=100):

Return an image with random squares

Parameters
  • w: The width of the image
  • h: The height of the image
  • vmax: The maximum intensity value of the squares
  • vmin: The minimum intensity value of the squares
  • nSquares: The number of squares to add
Returns

The image with random squares

>>> im_squares = get_squares(100, 100)
>>> im_squares.shape
(100, 100)