minor fixes

This commit is contained in:
François Boulogne
2013-05-28 07:56:12 +02:00
parent ed9d1aae88
commit 328e54fa13
3 changed files with 27 additions and 10 deletions
+17 -3
View File
@@ -14,8 +14,10 @@ This example shows how to fill several different shapes:
import numpy as np
import matplotlib.pyplot as plt
from skimage.draw import line, polygon, circle, circle_perimeter, ellipse
from skimage.draw import line, polygon, circle, circle_perimeter, \
ellipse, ellipse_perimeter, bezier_curve
import numpy as np
import math
img = np.zeros((500, 500, 3), 'uint8')
@@ -43,8 +45,20 @@ rr, cc = ellipse(300, 300, 100, 200, img.shape)
img[rr,cc,2] = 255
# circle
rr, cc = circle_perimeter(120, 400, 50)
rr, cc = circle_perimeter(120, 400, 15)
img[rr, cc, :] = (255, 0, 0)
# ellipses
rr, cc = ellipse_perimeter(120, 400, 60, 20, orientation=math.pi/4.)
img[rr, cc, :] = (255, 0, 255)
rr, cc = ellipse_perimeter(120, 400, 60, 20, orientation=-math.pi/4.)
img[rr, cc, :] = (0, 0, 255)
rr, cc = ellipse_perimeter(120, 400, 60, 20, orientation=math.pi/2.)
img[rr, cc, :] = (255, 255, 255)
# bezier curve
rr, cc = bezier_curve(120, 400, 150, 480, 160, 400, weight=2)
img[rr, cc, :] = (255, 255, 255)
plt.imshow(img)
plt.show()