makeimg.onesquare¶
-
makeimg.
onesquare
(N, ns=0.0)[source]¶ Create a simple piece-wise constant gray-scale image: a white square on a 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
fivesquares
- another piece-wise constant test image
myphantom
- Python implementation of the Shepp–Logan phantom