|
import numpy as np |
|
|
|
|
|
|
|
|
|
def make_boxes(image_size, densities, shapes): |
|
""" |
|
:param image_size: [int] - the pixel height and width of the generated arrays |
|
:param densities: [list] - of the values of each of the active pixels in each shape |
|
:param shapes: [list] - of the various shapes desired for the dataset |
|
:return: [list[tuple]] - [Array, Density, Thickness, Shape] |
|
""" |
|
|
|
matrix = [] |
|
|
|
for function in shapes: |
|
|
|
|
|
for i in range(len(densities)): |
|
|
|
for j in range(image_size): |
|
thickness = j |
|
Array = (function(thickness, densities[i], image_size)) |
|
|
|
|
|
if (np.where((Array == float(0)))[0] > 0).any(): |
|
the_tuple = (Array, str(function.__name__), densities[i], thickness) |
|
matrix.append(the_tuple) |
|
|
|
|
|
else: |
|
break |
|
return matrix |
|
|
|
|
|
|
|
|
|
|
|
|