# HG changeset patch # User Nicolas Saunier # Date 1394660209 14400 # Node ID a50c026fdf1412380d90c4b0099f5d2b4b37d950 # Parent a8f95bbd79bcf80c1a80f7dfa3d93e68440efb40 functions to compute inverse mapping diff -r a8f95bbd79bc -r a50c026fdf14 python/cvutils.py --- a/python/cvutils.py Wed Mar 12 13:36:54 2014 -0400 +++ b/python/cvutils.py Wed Mar 12 17:36:49 2014 -0400 @@ -265,7 +265,7 @@ H, mask = cv2.findHomography(array(srcPoints), array(dstPoints), method, ransacReprojThreshold) return H - def correctedCoordinates(x,y, map1, map2): + def correctedCoordinates(x,y, map1, map2, maxDistance = 1.): '''Returns the coordinates of a point in undistorted image map1 and map2 are the mapping functions from undistorted image to distorted (original image) @@ -274,13 +274,25 @@ from matplotlib.mlab import find distx = abs(map1-x) disty = abs(map2-y) - indices = logical_and(distx<1, disty<1) + indices = logical_and(distx