Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. %matplotlib inline
  2. import numpy as np
  3. import matplotlib.pyplot as plt
  4. from skimage.draw import (line, polygon, circle,
  5. circle_perimeter,
  6. ellipse, ellipse_perimeter,
  7. bezier_curve)
  8.  
  9. # Draw a rectangle
  10. img = np.ones((10, 10), dtype=np.double) # a gray image
  11. left = (3, 5)
  12. right = (7, 6)
  13. img[left[0]: right[0], left[1]: right[1]] = 0
  14. plt.imshow(img, cmap=plt.cm.gray)
  15.  
  16.  
  17. # Draw a circle
  18. img = np.ones((500, 500, 3), dtype=np.double)
  19. rr, cc = circle(200, 300, 100) # x, y, radius
  20. img[rr, cc, :] = 0
  21. plt.imshow(img)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement