Guest User

Untitled

a guest
Dec 15th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. ds = load_small_mose2_clean()
  2. img = ds.image
  3. pts = ds.pts
  4.  
  5. kp = KeyPoints(pts, img.shape)
  6. kp.set_data(img)
  7. ps = kp.extract_patches(35)
  8.  
  9. size = ps.shape[1]
  10. mode = 'grid'
  11. zps = np.array([zernike(j, size, mode) for j in np.arange(0, 66)])
  12.  
  13. #m = extract_moments_rot(ps, zps)
  14. # Do not open rotational-invariant mode
  15. m = extract_moments(ps, zps)
  16.  
  17. X = m[:, 1:]
  18. umap = UMAP(X,
  19. n_neighbors=30,
  20. min_dist=0.2,
  21. metric='correlation',
  22. n_epochs=300,
  23. init='pca',
  24. keep_log=False,
  25. num_negative_samples=6,
  26. local_connectivity=1.0)
  27. X_umap = umap.fit_transform(X)
  28.  
  29. ll = interactive_clusters(X_umap, kp.pts, img)
  30.  
  31. fp = KeyPoints(pts[ll[1].ind], img.shape)
  32. fp.set_data(img)
  33. ppp = fp.extract_patches(60)
Add Comment
Please, Sign In to add comment