Created
May 4, 2016 19:53
-
-
Save hackerdem/cf5ff212ef1a0bced869b661244a11c5 to your computer and use it in GitHub Desktop.
Count stars on a photo using python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import pylab | |
import mahotas as mh | |
from skimage import measure | |
sky=mh.imread('sky.jpeg') | |
pylab.imshow(sky) | |
t=mh.thresholding.otsu(sky.astype('uint8')) | |
labeled,stars=mh.label(sky>t) | |
print stars | |
pylab.imshow(labeled) | |
pylab.jet() | |
pylab.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks, mate! stay blessed.