Ejemplo n.º 1
0
    def _findGalaxyBulgeBlobs(galaxy):
        img = galaxy.imageWithoutBackground
        graynp = img.getGrayNumpy()

        stretched = np.array(graynp, dtype=np.float32)*(255.0/graynp.max())
        stretched = Image(stretched)
        return stretched.threshold(220).binarize().invert().findBlobs(minsize=4)
Ejemplo n.º 2
0
droplets = Image('data_s7.jpg')

## Once you have an image you can do a ton of stuff!
## URL (official documentation) about available methods: 
## http://simplecv.org/docs/SimpleCV.html#i/SimpleCV.ImageClass.Image


## Display the image & the image size
# droplets.show()
# time.sleep(5)
img_size = droplets.size()
# print 'Image size:', img_size


## Convert to black and white (applying a simple threshold value)
droplets = droplets.threshold(75)
# droplets.show()
# time.sleep(5)


## Cropping the image into the four pieces
## The x coords are always the whole size
x = 55
segment_height = img_size[1]/4
y_coords = [i * segment_height for i in range(4)]
# print segment_height, y_coords

avg_sizes = []

for y in y_coords: