From 0d50582ccbfcaf3e9b6ae875f57893de6fbbcb92 Mon Sep 17 00:00:00 2001 From: Brian Holt Date: Sat, 17 Sep 2011 18:57:36 +0100 Subject: [PATCH] replaced arctan with arctan2 --- scikits/image/feature/hog.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scikits/image/feature/hog.py b/scikits/image/feature/hog.py index bdef8d2a..cf4dd852 100644 --- a/scikits/image/feature/hog.py +++ b/scikits/image/feature/hog.py @@ -4,7 +4,7 @@ """ import numpy as np -from scipy import sqrt, pi, arctan, cos, sin +from scipy import sqrt, pi, arctan2, cos, sin def hog(image, n_orientations=9, pixels_per_cell=(8, 8), @@ -104,7 +104,7 @@ def hog(image, n_orientations=9, pixels_per_cell=(8, 8), """ magnitude = sqrt(gx ** 2 + gy ** 2) - orientation = arctan(gy / (gx + 1e-15)) * (180 / pi) + 90 + orientation = arctan2(gy, (gx + 1e-15)) * (180 / pi) + 90 # compute n_orientations integral images integral_images = []