mirror of
https://github.com/wassname/scikit-image.git
synced 2026-08-03 13:11:25 +08:00
Removed trailing whitespaces
This commit is contained in:
@@ -54,10 +54,10 @@ def convex_hull_image(image):
|
||||
raise ImportError('Could not import scipy.spatial, only available in '
|
||||
'scipy >= 0.9.')
|
||||
|
||||
# Subtract offset
|
||||
# Subtract offset
|
||||
offset = coords.mean(axis=0)
|
||||
coords -= offset
|
||||
|
||||
|
||||
# Find the convex hull
|
||||
chull = Delaunay(coords).convex_hull
|
||||
v = coords[np.unique(chull)]
|
||||
@@ -67,7 +67,7 @@ def convex_hull_image(image):
|
||||
angles = np.arctan2(v_centred[:, 0], v_centred[:, 1])
|
||||
v = v[np.argsort(angles)]
|
||||
|
||||
# Add back offset
|
||||
# Add back offset
|
||||
v += offset
|
||||
|
||||
# For each pixel coordinate, check whether that pixel
|
||||
|
||||
@@ -45,15 +45,12 @@ def test_qhull_offset_example():
|
||||
147, 148, 149, 150, 151, 152, 153, 154, 146, 147, 148, 149, 150,
|
||||
151, 152, 153, 154, 147, 148, 149, 150, 151, 152, 153, 148, 149,
|
||||
150, 151, 152, 149, 150, 151, 150]))
|
||||
|
||||
image = np.zeros((1392, 1040), dtype=bool)
|
||||
image[ nonzeros ] = True
|
||||
|
||||
expected = image.copy()
|
||||
|
||||
image[ nonzeros ] = True
|
||||
expected = image.copy()
|
||||
assert_array_equal(convex_hull_image(image), expected)
|
||||
|
||||
|
||||
|
||||
@skipif(not scipy_spatial)
|
||||
def test_pathological_qhull_example():
|
||||
image = np.array(
|
||||
|
||||
Reference in New Issue
Block a user