Closed tschoeni closed 5 years ago
Can you describe how to do that, since the images are not squares (and you probably have done this before)?
From the pixel resolution of an image and the area you can compute what the side lengths are in meters and thus have a pixel / meter ratio for an image. To combine it with the lat/lon of the image you have to make some assumptions: 1) The seafloor is flat and the camera was oriented perfectly perpendicular to it. 2) The lat/lon coordinates (img_lat,img_lon) correspond to the top left corner of the image.
You then need to convert image size in meters into image size in degrees (which depends on the location, see https://en.wikipedia.org/wiki/Decimal_degrees). Combined with the known meter / pixel ratio you can then compute a scaling factor from pixels to degrees (px_to_degree).
The Pixel coordinates are then:
px_lat [°] = img_lat - px_to_degree * sqrt(x^2 [px^2] + x^2 [px^2]) * sin(atan(y [px] / x [px]) - heading [°])
px_lon [°] = img_lon + px_to_degree * sqrt(x^2 [px^2] + x^2 [px^2]) * cos(atan(y [px] / x [px]) - heading [°])
where x and y are the pixel coordinates within the image as stored in annotation_points, heading is the direction of the camera (0 if the x axis of an image is parallel to the equator, 90 if the x axis of an image is parallel to a meridian and the direction of movement is eastward).
This all depends by a fair amount on coordinates, +/- rules and degree systems (radians vs degrees! make sure the library used to compute sin / cos / atan provides and uses the correct values).
This might be resolved with biigle/geo#18.
While reporting could you please compute the latitude & longitude of each annotation? You report image_lat/lon and px_x/y but from the known image resolution (in m^2) and eventually the GPS_heading you can compute px_lat/lon as well.