Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %matplotlib inline
- import numpy as np
- import matplotlib.pyplot as plt
- from skimage.draw import (line, polygon, circle,
- circle_perimeter,
- ellipse, ellipse_perimeter,
- bezier_curve)
- # Draw a rectangle
- img = np.ones((10, 10), dtype=np.double) # a gray image
- left = (3, 5)
- right = (7, 6)
- img[left[0]: right[0], left[1]: right[1]] = 0
- plt.imshow(img, cmap=plt.cm.gray)
- # Draw a circle
- img = np.ones((500, 500, 3), dtype=np.double)
- rr, cc = circle(200, 300, 100) # x, y, radius
- img[rr, cc, :] = 0
- plt.imshow(img)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement