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 implementation.

../_images/plot_censure_1.png

from skimage import data
from skimage import transform as tf
from skimage.feature import CENSURE
from skimage.color import rgb2gray
import matplotlib.pyplot as plt


img1 = rgb2gray(data.lena())
tform = tf.AffineTransform(scale=(1.5, 1.5), rotation=0.5,
                           translation=(150, -200))
img2 = tf.warp(img1, tform)

detector = CENSURE()

fig, ax = plt.subplots(nrows=1, ncols=2)

plt.gray()

detector.detect(img1)

ax[0].imshow(img1)
ax[0].axis('off')
ax[0].scatter(detector.keypoints[:, 1], detector.keypoints[:, 0],
              2 ** detector.scales, facecolors='none', edgecolors='r')

detector.detect(img2)

ax[1].imshow(img2)
ax[1].axis('off')
ax[1].scatter(detector.keypoints[:, 1], detector.keypoints[:, 0],
              2 ** detector.scales, facecolors='none', edgecolors='r')

plt.show()

STDOUT


        

STDERR


        

Python source code: download (generated using skimage 0.11dev)

IPython Notebook: download (generated using skimage 0.11dev)

ZnJvbSBza2ltYWdlIGltcG9ydCBkYXRhCmZyb20gc2tpbWFnZSBpbXBvcnQgdHJhbnNmb3JtIGFzIHRmCmZyb20gc2tpbWFnZS5mZWF0dXJlIGltcG9ydCBDRU5TVVJFCmZyb20gc2tpbWFnZS5jb2xvciBpbXBvcnQgcmdiMmdyYXkKaW1wb3J0IG1hdHBsb3RsaWIucHlwbG90IGFzIHBsdAoKCmltZzEgPSByZ2IyZ3JheShkYXRhLmxlbmEoKSkKdGZvcm0gPSB0Zi5BZmZpbmVUcmFuc2Zvcm0oc2NhbGU9KDEuNSwgMS41KSwgcm90YXRpb249MC41LAogICAgICAgICAgICAgICAgICAgICAgICAgICB0cmFuc2xhdGlvbj0oMTUwLCAtMjAwKSkKaW1nMiA9IHRmLndhcnAoaW1nMSwgdGZvcm0pCgpkZXRlY3RvciA9IENFTlNVUkUoKQoKZmlnLCBheCA9IHBsdC5zdWJwbG90cyhucm93cz0xLCBuY29scz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