changeset 1174:2f89dc3d99e5

clarification of worldToImageProject method
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Fri, 17 Dec 2021 14:26:45 -0500
parents c1766bb5076c
children 35725db5e83f
files trafficintelligence/cvutils.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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))