# HG changeset patch # User Nicolas Saunier # Date 1639769205 18000 # Node ID 2f89dc3d99e5f31ec9d5f92d289eb1b1bb4bf5c0 # Parent c1766bb5076c74fab15d0020d4dda694a1343bca clarification of worldToImageProject method diff -r c1766bb5076c -r 2f89dc3d99e5 trafficintelligence/cvutils.py --- a/trafficintelligence/cvutils.py Mon Oct 18 11:42:53 2021 -0400 +++ b/trafficintelligence/cvutils.py Fri Dec 17 14:26:45 2021 -0500 @@ -569,9 +569,11 @@ return homographyProject(points, homography) def worldToImageProject(points, intrinsicCameraMatrix = None, distortionCoefficients = None, homography = None): - '''Projects points (2xN array) from image (video) space to world space + '''Projects points (2xN array) from world space to image (video) space 1. through undistorting if provided by intrinsic camera matrix and distortion coefficients - 2. through homograph projection (from ideal point (no camera) to world)''' + 2. through homograph projection (from ideal point (no camera) to world) + + Warning: this usually means to invert the homography if computer from image (ideal point) to world space, eg using numpy.linalg.inv''' if points.shape[0] != 2: raise Exception('points of dimension {}'.format(points.shape))