# Convert land-based camera image pixel x,y to ground lat/long or x,y,z

I have a number of cameras at various known locations (x,y,z) and directions that are above ground about 20 feet pointed at different ground locations about 100 feet away from each camera, and whose furthest fields of view (FOV) are about 300 feet. None of the cameras are pointing directly N-S or E-W. Because of the relatively short distance, I don't need to take into consideration the curvature of the Earth.

I am detecting moving objects within the camera FOV and obtaining their image pixel x,y contours and centroids. How can I convert the pixel x,y locations into (initially 'flat') lat long coordinates or relative ground x,y locations? I am obtaining elevation data, so will be adding the ground height (z).

Am trying to do this in Java as much as possible, so any pointers (e.g., algorithms, code libraries, etc) are welcome

• See, inter alia, gis.stackexchange.com/questions/86446, gis.stackexchange.com/questions/52277, gis.stackexchange.com/questions/29436, and gis.stackexchange.com/questions/15515. Most of these were found by searching our site for "camera". I'm pretty sure we do not have any threads that explicitly provide an algorithm; most give general advice or pointers to software. – whuber Feb 22 '14 at 14:20
• I am not sure I understand exactly what you are trying to accomplish. Pictovera takes 2d images, matches locations based on 3 or more images, and creates a 3d point cloud which can then be used to create a surface model. Is this what you are trying to accomplish? – Barbarossa Feb 22 '14 at 14:32
• Thanks for the pointers, my search included too many parameters, so I had only found the one on the handdrawn picture. This gets me going in the right direction, and I've so far found; – Will Feb 22 '14 at 17:50
• - GeoToolkit.org - GeoAPI.org - Beam (brockmann-consult.de/cms/web/beam) - JHLabs (jhlabs.com/java/maps/proj) The latter has a large number of projections, and I'm at a loss for understanding which one I should be using - any pointers? For projections with height data where I need to find the lat/long of an object on an image, I think I need to do orthorectification - is that correct or is that overkill? – Will Feb 22 '14 at 18:39
• I believe what I am trying to find now is the projective homography transformation that relates image coordinates to the ground plane coordinates, though it really needs to be a 2D to 3D transformation taking into consideration the DEM. plus.maths.org/issue23/features/criminisi/homography.gif – Will Feb 23 '14 at 1:13