Advertisement
Guest User

Untitled

a guest
Aug 20th, 2014
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. from skimage import segmentation
  2. from skimage.measure import regionprops
  3.  
  4. #a segmented image
  5. labels = segmentation.slic(img1, compactness=10, n_segments=200)
  6. propimage = labels
  7. #props loop
  8. for region in regionprops(labels1, properties ='eccentricity') :
  9. eccentricity = region.eccentricity
  10. propimage[propimage==region] = eccentricity
  11.  
  12. for i in range(0,max(labels)):
  13. prop = regions[i].eccentricity #the way to cal a single prop
  14. propimage[i]= prop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement