From 2d3cc8e0a047f23a747cbef991138a04db4b077c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Tue, 11 Sep 2012 19:39:27 +0200 Subject: [PATCH] Add more detailed description of corner detectors in doc strings --- skimage/feature/corner.py | 37 +++++++++++++++++++++++++++-------- skimage/feature/corner_cy.pyx | 3 ++- 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/skimage/feature/corner.py b/skimage/feature/corner.py index c7e64233..4302e8d0 100644 --- a/skimage/feature/corner.py +++ b/skimage/feature/corner.py @@ -59,8 +59,13 @@ def _compute_auto_correlation(image, sigma): def corner_kitchen_rosenfeld(image): """Compute Kitchen and Rosenfeld response image. - This corner detector uses information in the auto-correlation matrix - (sum of squared differences) to make assumptions about the type of point. + The corner measure is calculated as follows:: + + (imxx * imy**2 + imyy * imx**2 - 2 * imxy * imx * imy) + ------------------------------------------------------ + (imx**2 + imy**2) + + Where imx and imy are the first and imxx, imxy, imyy the second derivatives. Parameters ---------- @@ -87,8 +92,19 @@ def corner_kitchen_rosenfeld(image): def corner_harris(image, method='k', k=0.05, eps=1e-6, sigma=1): """Compute Harris response image. - This corner detector uses information in the auto-correlation matrix - (sum of squared differences) to make assumptions about the type of point. + This corner detector uses information from the auto-correlation matrix A:: + + A = [(imx**2) (imx*imy)] = [Axx Axy] + [(imx*imy) (imy**2)] [Axy Ayy] + + Where imx and imy are the first derivatives averaged with a gaussian filter. + The corner measure is then defined as:: + + det(A) - k * trace(A)**2 + + or:: + + 2 * det(A) / (trace(A) + eps) Parameters ---------- @@ -157,10 +173,15 @@ def corner_harris(image, method='k', k=0.05, eps=1e-6, sigma=1): def corner_shi_tomasi(image, sigma=1): """Compute Shi-Tomasi (Kanade-Tomasi) response image. - This corner detector uses information in the auto-correlation matrix - (sum of squared differences) to make assumptions about the type of point. - It is computationally more expensive than the harris corner detector as - it directly computes the minimum eigenvalue of the auto-correlation matrix. + This corner detector uses information from the auto-correlation matrix A:: + + A = [(imx**2) (imx*imy)] = [Axx Axy] + [(imx*imy) (imy**2)] [Axy Ayy] + + Where imx and imy are the first derivatives averaged with a gaussian filter. + The corner measure is then defined as the smaller eigenvalue of A:: + + ((Axx + Ayy) - sqrt((Axx - Ayy)**2 + 4 * Axy**2)) / 2 Parameters ---------- diff --git a/skimage/feature/corner_cy.pyx b/skimage/feature/corner_cy.pyx index 6094d937..94d69772 100644 --- a/skimage/feature/corner_cy.pyx +++ b/skimage/feature/corner_cy.pyx @@ -13,7 +13,8 @@ from skimage.util import img_as_float def corner_moravec(image, int window_size=1): """Compute Moravec response image. - This interest operator is comparatively fast but not rotation invariant. + This is one of the simplest corner detectors and is comparatively fast but + has several limitations (e.g. not rotation invariant). Parameters ----------