mirror of
https://github.com/wassname/scikit-image.git
synced 2026-06-29 20:35:40 +08:00
Add test case for corner_peaks function
This commit is contained in:
@@ -5,7 +5,7 @@ from skimage import data
|
||||
from skimage import img_as_float
|
||||
|
||||
from skimage.feature import (corner_moravec, corner_harris, corner_shi_tomasi,
|
||||
corner_subpix, peak_local_max)
|
||||
corner_subpix, peak_local_max, corner_peaks)
|
||||
|
||||
|
||||
def test_square_image():
|
||||
@@ -99,6 +99,17 @@ def test_subpix():
|
||||
assert_array_equal(subpix[0], (24.5, 24.5))
|
||||
|
||||
|
||||
def test_corner_peaks():
|
||||
response = np.zeros((5, 5))
|
||||
response[2:4, 2:4] = 1
|
||||
|
||||
corners = corner_peaks(response, exclude_border=False)
|
||||
assert len(corners) == 1
|
||||
|
||||
corners = corner_peaks(response, exclude_border=False, min_distance=0)
|
||||
assert len(corners) == 4
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
from numpy import testing
|
||||
testing.run_module_suite()
|
||||
|
||||
Reference in New Issue
Block a user