mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-07 21:34:21 +08:00
Rename CenSurE to CENSURE
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
"""
|
||||
========================
|
||||
CenSurE feature detector
|
||||
CENSURE feature detector
|
||||
========================
|
||||
|
||||
The CenSurE feature detector is a scale-invariant center-surround detector
|
||||
(CenSurE) that claims to outperform other detectors and is capable of real-time
|
||||
The CENSURE feature detector is a scale-invariant center-surround detector
|
||||
(CENSURE) that claims to outperform other detectors and is capable of real-time
|
||||
implementation.
|
||||
|
||||
"""
|
||||
from skimage import data
|
||||
from skimage import transform as tf
|
||||
from skimage.feature import CenSurE
|
||||
from skimage.feature import CENSURE
|
||||
from skimage.color import rgb2gray
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
@@ -20,7 +20,7 @@ tform = tf.AffineTransform(scale=(1.5, 1.5), rotation=0.5,
|
||||
translation=(150, -200))
|
||||
img2 = tf.warp(img1, tform)
|
||||
|
||||
detector = CenSurE()
|
||||
detector = CENSURE()
|
||||
|
||||
fig, ax = plt.subplots(nrows=1, ncols=2)
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ from .corner import (corner_kitchen_rosenfeld, corner_harris,
|
||||
from .corner_cy import corner_moravec, corner_orientations
|
||||
from .template import match_template
|
||||
from .brief import BRIEF
|
||||
from .censure import CenSurE
|
||||
from .censure import CENSURE
|
||||
from .orb import ORB
|
||||
from .match import match_descriptors
|
||||
from .util import plot_matches
|
||||
@@ -37,7 +37,7 @@ __all__ = ['daisy',
|
||||
'corner_orientations',
|
||||
'match_template',
|
||||
'BRIEF',
|
||||
'CenSurE',
|
||||
'CENSURE',
|
||||
'ORB',
|
||||
'match_descriptors',
|
||||
'plot_matches']
|
||||
|
||||
@@ -111,9 +111,9 @@ def _suppress_lines(feature_mask, image, sigma, line_threshold):
|
||||
|
||||
|
||||
|
||||
class CenSurE(FeatureDetector):
|
||||
class CENSURE(FeatureDetector):
|
||||
|
||||
"""CenSurE keypoint detector.
|
||||
"""CENSURE keypoint detector.
|
||||
|
||||
min_scale : int, optional
|
||||
Minimum scale to extract keypoints from.
|
||||
@@ -149,7 +149,7 @@ class CenSurE(FeatureDetector):
|
||||
References
|
||||
----------
|
||||
.. [1] Motilal Agrawal, Kurt Konolige and Morten Rufus Blas
|
||||
"CenSurE: Center Surround Extremas for Realtime Feature
|
||||
"CENSURE: Center Surround Extremas for Realtime Feature
|
||||
Detection and Matching",
|
||||
http://link.springer.com/content/pdf/10.1007%2F978-3-540-88693-8_8.pdf
|
||||
|
||||
@@ -162,9 +162,9 @@ class CenSurE(FeatureDetector):
|
||||
--------
|
||||
>>> from skimage.data import lena
|
||||
>>> from skimage.color import rgb2gray
|
||||
>>> from skimage.feature import CenSurE
|
||||
>>> from skimage.feature import CENSURE
|
||||
>>> img = rgb2gray(lena()[100:300, 100:300])
|
||||
>>> censure = CenSurE()
|
||||
>>> censure = CENSURE()
|
||||
>>> censure.detect(img)
|
||||
>>> censure.keypoints
|
||||
array([[ 71, 148],
|
||||
@@ -208,7 +208,7 @@ class CenSurE(FeatureDetector):
|
||||
self.scales = None
|
||||
|
||||
def detect(self, image):
|
||||
"""Detect CenSurE keypoints along with the corresponding scale.
|
||||
"""Detect CENSURE keypoints along with the corresponding scale.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import numpy as np
|
||||
from numpy.testing import assert_array_equal, assert_raises
|
||||
from skimage.data import moon
|
||||
from skimage.feature import CenSurE
|
||||
from skimage.feature import CENSURE
|
||||
|
||||
|
||||
img = moon()
|
||||
@@ -9,25 +9,25 @@ img = moon()
|
||||
|
||||
def test_keypoints_censure_color_image_unsupported_error():
|
||||
"""Censure keypoints can be extracted from gray-scale images only."""
|
||||
assert_raises(ValueError, CenSurE().detect, np.zeros((20, 20, 3)))
|
||||
assert_raises(ValueError, CENSURE().detect, np.zeros((20, 20, 3)))
|
||||
|
||||
|
||||
def test_keypoints_censure_mode_validity_error():
|
||||
"""Mode argument in keypoints_censure can be either DoB, Octagon or
|
||||
STAR."""
|
||||
assert_raises(ValueError, CenSurE, mode='dummy')
|
||||
assert_raises(ValueError, CENSURE, 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."""
|
||||
assert_raises(ValueError, CenSurE, min_scale=1, max_scale=2)
|
||||
assert_raises(ValueError, CENSURE, 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."""
|
||||
detector = CenSurE()
|
||||
detector = CENSURE()
|
||||
detector.detect(img)
|
||||
expected_keypoints = np.array([[ 21, 497],
|
||||
[ 36, 46],
|
||||
@@ -48,7 +48,7 @@ def test_keypoints_censure_moon_image_octagon():
|
||||
"""Verify the actual Censure keypoints and their corresponding scale with
|
||||
the expected values for Octagon filter."""
|
||||
|
||||
detector = CenSurE(mode='octagon')
|
||||
detector = CENSURE(mode='octagon')
|
||||
detector.detect(img)
|
||||
expected_keypoints = np.array([[ 21, 496],
|
||||
[ 35, 46],
|
||||
@@ -65,7 +65,7 @@ def test_keypoints_censure_moon_image_octagon():
|
||||
def test_keypoints_censure_moon_image_star():
|
||||
"""Verify the actual Censure keypoints and their corresponding scale with
|
||||
the expected values for STAR filter."""
|
||||
detector = CenSurE(mode='star')
|
||||
detector = CENSURE(mode='star')
|
||||
detector.detect(img)
|
||||
expected_keypoints = np.array([[ 21, 497],
|
||||
[ 36, 46],
|
||||
|
||||
Reference in New Issue
Block a user