This commit is contained in:
François Boulogne
2013-10-02 17:25:16 +02:00
parent 718989edc5
commit 0467b92034
+6 -8
View File
@@ -15,16 +15,15 @@ import numpy as np
import matplotlib.pyplot as plt
from skimage.draw import line, polygon, circle, \
circle_perimeter, circle_perimeter_aa, \
circle_perimeter, \
ellipse, ellipse_perimeter
import numpy as np
import math
img = np.zeros((500, 500, 3), dtype=np.uint8)
# draw line
rr, cc = line(120, 123, 20, 400)
img[rr,cc,0] = 255
img[rr, cc, 0] = 255
# fill polygon
poly = np.array((
@@ -34,16 +33,16 @@ poly = np.array((
(220, 590),
(300, 300),
))
rr, cc = polygon(poly[:,0], poly[:,1], img.shape)
img[rr,cc,1] = 255
rr, cc = polygon(poly[:, 0], poly[:, 1], img.shape)
img[rr, cc, 1] = 255
# fill circle
rr, cc = circle(200, 200, 100, img.shape)
img[rr,cc,:] = (255, 255, 0)
img[rr, cc, :] = (255, 255, 0)
# fill ellipse
rr, cc = ellipse(300, 300, 100, 200, img.shape)
img[rr,cc,2] = 255
img[rr, cc, 2] = 255
# circle
rr, cc = circle_perimeter(120, 400, 15)
@@ -73,7 +72,6 @@ import matplotlib.pyplot as plt
from skimage.draw import line_aa, \
circle_perimeter_aa
import numpy as np
img = np.zeros((100, 100), dtype=np.uint8)