Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def convert_image_to_field(image):
rep = image_to_slic_zero(image, 100)
superpixels = extract_superpixels(image, rep)
graph = create_superpixel_graph(superpixels, node_mapping, edge_mapping)
fields = receptive_fields(graph, order, 1, 100, 10, betweenness_centrality,
node_features, 8)
fields = fields.astype(np.float32)
return fields
node_attributes['green'],
node_attributes['blue'],
node_attributes['y'],
node_attributes['x'],
node_attributes['count'],
node_attributes['height'],
node_attributes['width'],
]
image = image.astype(np.int32)
segmentation = image_to_slic_zero(image, 50)
superpixels = extract_superpixels(image, segmentation)
graph = create_superpixel_graph(superpixels, node_map, edge_map)
conv = receptive_fields(graph, order, 2, 25, 10,
betweenness_centrality, node_features, 8)
return conv.astype(np.float32)