From 2f11f2277bb1ed9afcf30be8b4eb55745d507637 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Fri, 29 Nov 2013 21:55:21 +0100 Subject: [PATCH] Improve corner_orientations example output --- skimage/feature/corner_cy.pyx | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/skimage/feature/corner_cy.pyx b/skimage/feature/corner_cy.pyx index 688063c8..7249fde6 100644 --- a/skimage/feature/corner_cy.pyx +++ b/skimage/feature/corner_cy.pyx @@ -176,7 +176,7 @@ def corner_orientations(image, Py_ssize_t[:, :] corners, mask): The orientation of corners is computed using the first order central moment i.e. the center of mass approach. The corner orientation is the angle of - the vector from the corner coordinate to the intensity centroid in the + the vector from the corner coordinate to the intensity centroid in the local neighborhood around the corner calculated using first order central moment. @@ -206,23 +206,23 @@ def corner_orientations(image, Py_ssize_t[:, :] corners, mask): Examples -------- >>> from skimage.morphology import octagon - >>> from skimage.feature import corner_fast, corner_peaks, \ - ... corner_orientations + >>> from skimage.feature import (corner_fast, corner_peaks, + ... corner_orientations) >>> square = np.zeros((12, 12)) >>> square[3:9, 3:9] = 1 - >>> square - array([[ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.], - [ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.], - [ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.], - [ 0., 0., 0., 1., 1., 1., 1., 1., 1., 0., 0., 0.], - [ 0., 0., 0., 1., 1., 1., 1., 1., 1., 0., 0., 0.], - [ 0., 0., 0., 1., 1., 1., 1., 1., 1., 0., 0., 0.], - [ 0., 0., 0., 1., 1., 1., 1., 1., 1., 0., 0., 0.], - [ 0., 0., 0., 1., 1., 1., 1., 1., 1., 0., 0., 0.], - [ 0., 0., 0., 1., 1., 1., 1., 1., 1., 0., 0., 0.], - [ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.], - [ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.], - [ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.]]) + >>> square.astype(int) + array([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0], + [0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0], + [0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0], + [0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0], + [0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0], + [0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]) >>> corners = corner_peaks(corner_fast(square, 9), min_distance=1) >>> corners array([[3, 3],