Image Resector

By: Sam Kimak

04/16/2024

Categories: Project Tags: Tool

Image Resector is a browser tool for working out where a photo was taken. It uses resection, a surveying technique: if you can see two or more landmarks with known locations, the angles between them tell you where you must have been standing.

Using it

  1. Load a photo and enter the camera’s horizontal field of view (FOV).
  2. Mark landmarks by clicking points in the image you can also find on a map, such as a tower, a peak, or a building corner.
  3. Place each landmark on the map. Click where it actually is, using the search box to get to the right area.
  4. Give at least one bearing, meaning the compass direction from the camera to one of the landmarks, so the tool knows which way the photo faces.

For each landmark, the tool draws a line on the map pointing back toward where the camera would have been. Where the lines cross is the estimated position.

How it works

The math is fairly simple. A landmark’s horizontal pixel position in the photo, combined with the FOV, gives its angle relative to the other landmarks. The known bearing anchors those angles to real compass directions, so every landmark gets an absolute bearing from the camera. Flipping that by 180° gives a back-bearing from the landmark toward the camera, and that’s the line drawn on the map.

The map is Google Maps. The rest is plain JavaScript, HTML, and CSS, with no build step. You can also load more than one image and mark points on each.

Source

The code is on GitHub: Skimak/image-resector

>> Home