Probably this question was asked, but I couldn't find solution to my problem. I have an image with exif GPS location (which is position of the camera) as well as elevation above sea level. How can I calculate (estimate) positions/coordinates of objects present in an image? Is it possible to measure distance from camera to objects photographed with only one point of reference? What parameters beyond exif data are needed to perform such calculation?
1 Answer
N.B. All the below calculations are approximate because the distance is line, but it is actually arc and so on.
First you need the distance between the camera and object d
and also the angle between the line (camera to object) and equator alpha
.
Then you calculate the length of two arcs (lat, long):
lat1=sin(alpha)*d
long1=cos(alpha)*d
Then you calculate two angles which need to be added to camera coordinates:
lat_ang=lat1*180/6371/π
long_ang=long1*180/6371/π
This calculation is in degrees and 6371 meters is a radius of Earth (approximated as a sphere), π
=3.14159265 (https://en.wikipedia.org/wiki/Pi)
and then add those angles to current GPS coordinates:
obj_lat=GPS_lat+lat_ang
obj_long=GPS_long+long_ang
But I will recommend you another way to simply get the coordinates: go to Google maps, enter coordinates (from photo), find the object you want to get location, right click and you will get the coordinates of this object.
-
1And there are free maps on the Web if Google's terms are unpalatable. Though note that many objects one might photograph (e.g. ships) aren't plotted, because they move too quickly to be represented well on a map. (Actually, that might be a bad example, given MarineTraffic history, but it applies to e.g. wildlife, too). Jan 23, 2022 at 13:14
-
@TobySpeight, right, openstreetmaps display coordinates with right click->show address. And IMHO it is not need to see the object on the sat photo, just to use average position (from photographer memory) Jan 23, 2022 at 13:24