machinevisiontoolbox.Image.Circles
- classmethod Image.Circles(number, size=256, fg=1, bg=0, dtype='uint8')
Create image containing grid of circles
- Parameters:
number (int) – number of circles horizontally and vertically
size (int, optional) – image width and height, defaults to 256
fg (int, float, optional) – pixel value of the circles, defaults to 1
bg (int, optional) – pixel value of the background, defaults to 0
dtype (str, optional) – NumPy datatype, defaults to ‘uint8’
- Returns:
grid of circles
- Return type:
Image
Example:
>>> from machinevisiontoolbox import Image >>> img = Image.Circles(2, 14, bg=1, fg=9) >>> img.A array([[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 9, 1, 1, 1, 1, 1, 9, 1, 1, 1], [1, 1, 1, 9, 9, 9, 1, 1, 1, 9, 9, 9, 1, 1], [1, 1, 9, 9, 9, 9, 9, 1, 9, 9, 9, 9, 9, 1], [1, 1, 1, 9, 9, 9, 1, 1, 1, 9, 9, 9, 1, 1], [1, 1, 1, 1, 9, 1, 1, 1, 1, 1, 9, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 9, 1, 1, 1, 1, 1, 9, 1, 1, 1], [1, 1, 1, 9, 9, 9, 1, 1, 1, 9, 9, 9, 1, 1], [1, 1, 9, 9, 9, 9, 9, 1, 9, 9, 9, 9, 9, 1], [1, 1, 1, 9, 9, 9, 1, 1, 1, 9, 9, 9, 1, 1], [1, 1, 1, 1, 9, 1, 1, 1, 1, 1, 9, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]], dtype=uint8)
- Note:
Image is square.