# HG changeset patch # User MohamedGomaa # Date 1404841436 14400 # Node ID 97c5fef5b2d61d1482406259ef3cc213bbf2c8e0 # Parent 6c0923f1ce6897c7dbe34319e6a139a6986f5fa2 corrected bugs diff -r 6c0923f1ce68 -r 97c5fef5b2d6 python/cvutils.py --- a/python/cvutils.py Thu Jul 03 14:30:20 2014 -0400 +++ b/python/cvutils.py Tue Jul 08 13:43:56 2014 -0400 @@ -348,7 +348,7 @@ prod = dot(homography, augmentedPoints) return prod[0:2]/prod[2] else: - return p + return points def project(homography, p): '''Returns the coordinates of the projection of the point p with coordinates p[0], p[1] diff -r 6c0923f1ce68 -r 97c5fef5b2d6 python/utils.py --- a/python/utils.py Thu Jul 03 14:30:20 2014 -0400 +++ b/python/utils.py Tue Jul 08 13:43:56 2014 -0400 @@ -246,9 +246,10 @@ def crossProduct(l1, l2): return l1[0]*l2[1]-l1[1]*l2[0] -def filterMovingWindow(input, halfWidth): +def filterMovingWindow(inputSignal, halfWidth): '''Returns an array obtained after the smoothing of the input by a moving average The first and last points are copied from the original.''' + from numpy import ones,convolve,array width = float(halfWidth*2+1) win = ones(width,'d') result = convolve(win/width,array(inputSignal),'same')