mirror of
https://github.com/wassname/scikit-image.git
synced 2026-08-01 12:50:48 +08:00
minor fixes
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user