Skip to content

Instantly share code, notes, and snippets.

@dbuscombe-usgs
Last active December 20, 2015 06:19
Show Gist options
  • Save dbuscombe-usgs/6085320 to your computer and use it in GitHub Desktop.
Save dbuscombe-usgs/6085320 to your computer and use it in GitHub Desktop.
Classify images based on moments
features = np.zeros([len(imlist),5])
for i,f in enumerate(imlist):
im = np.array(Image.open(f).convert('L'))
Z=np.array([],np.float)
for k in range(5):
Z=np.append(Z,mahotas.moments(im, k, k))
features[i]=Z
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment