Search code examples
opencvgpsaugmented-realitypixel

GPS to Pixel coordinate


I want to display Radar information on the vessel identified in the Camera image.

At this point, the work is complete.

  1. Camera Image: The ship was identified by object recognition.

  2. Radar information: Identified the latitude, longitude, distance, and azimuth of the vessel (A, B, C).

Three sea-going vessels and a radar plot

The camera and radar are located at the same position and know the latitude, longitude, roll, and pitch values.

How can we match GPS information by converting pixel coordinates?

Same three vessels annotated with distances


Solution

  • You want to project the 3D coordinates to the image plane. A more detailed information about the theory behind can be found in the OpenCV documentation.

    This is a brief description of how it could be done:

    1. Compute your vessel's 3D coordinates relative to your camera position.
    2. You need a calibrated camera. You need the interior camera parameters to compute the projection from 3D coordinates to 2D image coordinates.
    3. Use e.g. OpenCV and projectPoints (see doc here) to compute the 2D image coordinates based on the relative 3D coordinates and your camera parameters. Because you use the relative position of the vessel you don't need the exterior orientation of your camera. So translation and rotation become zero.