From 502377e9cec9788657369c1dd4eb37edd6cc33d3 Mon Sep 17 00:00:00 2001 From: Ivo Flipse Date: Mon, 15 Jun 2015 22:49:20 +0200 Subject: [PATCH] Update _hoghistogram.pyx Made the function names PEP8 compatible and added another level of indentation. I also tried renaming some things where I considered columns useful, but for example cells per row isn't entirely accurate. Any suggestions? --- skimage/feature/_hoghistogram.pyx | 38 ++++++++++++++++--------------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/skimage/feature/_hoghistogram.pyx b/skimage/feature/_hoghistogram.pyx index d6d9732d..4d3e2dfe 100644 --- a/skimage/feature/_hoghistogram.pyx +++ b/skimage/feature/_hoghistogram.pyx @@ -5,11 +5,13 @@ import numpy as np cimport numpy as cnp -cdef float CellHog(cnp.float64_t[:, :] magnitude, - cnp.float64_t[:, :] orientation, - float ori1, float ori2, - int cx, int cy, int xi, int yi, int sx, int sy): - """CellHog +cdef float cell_hog(cnp.float64_t[:, :] magnitude, + cnp.float64_t[:, :] orientation, + float ori1, float ori2, + int cx, int cy, + int xi, int yi, + int sx, int sy): + """Calculation of the cell's HOG value Parameters ---------- @@ -26,13 +28,13 @@ cdef float CellHog(cnp.float64_t[:, :] magnitude, cy : int Pixels per cell (y). xi : int - Block index (x). + Block column index. yi : int - Block index (y). + Block row index. sx : int - Image size (x). + Number of columns. sy : int - Image size (y). + Number of rows. Returns ------- @@ -55,13 +57,13 @@ cdef float CellHog(cnp.float64_t[:, :] magnitude, return total -def HogHistograms(cnp.float64_t[:, :] gx, - cnp.float64_t[:, :] gy, - int cx, int cy, - int sx, int sy, - int n_cellsx, int n_cellsy, - int visualise, int orientations, - cnp.float64_t[:, :, :] orientation_histogram): +def hog_histograms(cnp.float64_t[:, :] gx, + cnp.float64_t[:, :] gy, + int cx, int cy, + int sx, int sy, + int n_cellsx, int n_cellsy, + int visualise, int orientations, + cnp.float64_t[:, :, :] orientation_histogram): """Extract Histogram of Oriented Gradients (HOG) for a given image. Parameters @@ -75,9 +77,9 @@ def HogHistograms(cnp.float64_t[:, :] gx, cy : int Pixels per cell (y). sx : int - Image size (x). + Number of columns. sy : int - Image size (y). + Number of rows. n_cellsx : int Number of cells (x). n_cellsy : int