makeimg.fivesquares

makeimg.fivesquares(N, ns=0.0)[source]

Create a piece-wise constant gray-scale image: five squares of different intensities on black background

Parameters:

N : int

Image dimension (image is an N-by-N array)

ns : float

Noise level applied to the image, i.e., 0.1 = 10% noise, 0.2 = 20% noise, etc. Thus ns has to satisfy 0 <= ns <= 1. By default ns = 0.0.

Returns:

It : NumPy 2darray

Array representation of the image (2D array)

See also

onesquare
another piece-wise constant test image
myphantom
Python implementation of the Shepp–Logan phantom