mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-14 11:18:06 +08:00
Adding remaining tests
This commit is contained in:
@@ -192,11 +192,7 @@ def keypoints_censure(image, min_scale=1, max_scale=7, mode='DoB',
|
||||
if image.ndim != 2:
|
||||
raise ValueError("Only 2-D gray-scale images supported.")
|
||||
|
||||
image = img_as_float(image)
|
||||
image = np.ascontiguousarray(image)
|
||||
|
||||
mode = mode.lower()
|
||||
|
||||
if mode not in ('dob', 'octagon', 'star'):
|
||||
raise ValueError('Mode must be one of "DoB", "Octagon", "STAR".')
|
||||
|
||||
@@ -204,6 +200,9 @@ def keypoints_censure(image, min_scale=1, max_scale=7, mode='DoB',
|
||||
raise ValueError('The number of scales should be greater than or'
|
||||
'equal to 3.')
|
||||
|
||||
image = img_as_float(image)
|
||||
image = np.ascontiguousarray(image)
|
||||
|
||||
# Generating all the scales
|
||||
filter_response = _get_filtered_image(image, min_scale, max_scale, mode)
|
||||
|
||||
|
||||
@@ -10,6 +10,20 @@ def test_keypoints_censure_color_image_unsupported_error():
|
||||
assert_raises(ValueError, keypoints_censure, img)
|
||||
|
||||
|
||||
def test_keypoints_censure_mode_validity_error():
|
||||
"""Mode argument in keypoints_censure can be either DoB, Octagon or
|
||||
STAR."""
|
||||
img = np.zeros((20, 20))
|
||||
assert_raises(ValueError, keypoints_censure, img, mode='dummy')
|
||||
|
||||
|
||||
def test_keypoints_censure_scale_range_error():
|
||||
"""Difference between the the max_scale and min_scale parameters in
|
||||
keypoints_censure should be greater than or equal to two."""
|
||||
img = np.zeros((20, 20))
|
||||
assert_raises(ValueError, keypoints_censure, img, min_scale=1, max_scale=2)
|
||||
|
||||
|
||||
def test_keypoints_censure_moon_image_dob():
|
||||
"""Verify the actual Censure keypoints and their corresponding scale with
|
||||
the expected values for DoB filter."""
|
||||
|
||||
Reference in New Issue
Block a user