Preliminary script wrapper implemented and applied to moser/main.py, more moser/main.py functions as well

This commit is contained in:
Grant Sanderson
2015-05-06 17:58:34 -07:00
parent e230b48adb
commit ed7061e7cf
8 changed files with 493 additions and 80 deletions

View File

@ -22,9 +22,9 @@ def get_pixels(image_array):
def paint_region(region, image_array = None, color = None):
pixels = get_pixels(image_array)
# assert region.shape == pixels.shape[:2]
assert region.shape == pixels.shape[:2]
if color is None:
rgb = np.random.random(3)
rgb = 0.5 * np.random.random(3) #Random darker colors
else:
rgb = np.array(Color(color).get_rgb())
pixels[region.bool_grid] = (255*rgb).astype('uint8')