Author Topic: Align photos by timestamp using already existing import trajectory functon  (Read 515 times)


  • Newbie
  • *
  • Posts: 41
    • View Profile

I have a photoset from underwater without GPS co-ordinates recorded with an autonomous boat. The same boat has a sonar with GPS and saves a track. I would like to use the CSV file from the sonar which contains the track (trajectory) of the boat to preselect and reference the photos. At the moment it does not seem possible, as the "import trajectory" function is for laser scaners.

So Metashape can already load the boat trajectory and displays points with GPS co-ordinates and time. Now all that is needed is Metashape to also read the timestamp on each photo during the alignment process and place it on the same trajectory based on the time the photo was taken. There could be another option to the existing Reference Preselection, like Reference Preselection: Timestamp

This simple addition can help with underwater photogrammetry a lot. Since nowadays more and more underwater navigation devices can output a track which sometimes has lower accuracy than similar devices above water, but could easily be used for preselection of big datasets and rough reference of the whole model

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14965
    • View Profile
Hello Mariusz_M,

How does the boat trajectory file looks, if it is a plain text file, can you please share some lines from it (like 10-20)?

Also please share the output of the following command executed in Metashape Console pane for the actual project:
Code: [Select][0].photo.metaThe command will print out some meta information for the first image from the active chunk (if there is any sensible information, you can remove it before posting here), just to see how the time stamps correspond to the trajectory data.
Best regards,
Alexey Pasumansky,
Agisoft LLC


  • Newbie
  • *
  • Posts: 41
    • View Profile
It is a simple CSV file.

Latitude       Longitude      Depth(m)   Time(UTC)
46.5109524881009   6.6092179741136   0.00   2024-04-22T13:22:57.127
46.510946284954   6.60920896074062   0.00   2024-04-22T13:22:59.647
46.5109524881009   6.60920896074062   0.00   2024-04-22T13:22:59.942
46.510946284954   6.60920896074062   0.00   2024-04-22T13:23:00.239
46.510946284954   6.60920896074062   0.00   2024-04-22T13:23:01.964
46.5109400818063   6.60919994736765   0.00   2024-04-22T13:23:03.085
46.5109524881009   6.60920896074062   0.00   2024-04-22T13:23:15.794
46.5109524881009   6.6092179741136   0.00   2024-04-22T13:23:19.425
46.510946284954   6.6092179741136   0.00   2024-04-22T13:23:20.895
46.5109400818063   6.6092179741136   0.00   2024-04-22T13:23:23.162
46.5109338786579   6.6092179741136   0.00   2024-04-22T13:23:27.696
46.5109400818063   6.6092179741136   0.00   2024-04-22T13:23:31.141
46.5109400818063   6.60922698748657   0.00   2024-04-22T13:23:33.478

Result of the command:

{'Exif/ApertureValue': '2.5', 'Exif/DateTime': '2024:04:22 22:03:39', 'Exif/DateTimeOriginal': '2024:04:22 22:03:39', 'Exif/ExposureTime': '0.00162866', 'Exif/FNumber': '2.5', 'Exif/FocalLength': '2.71', 'Exif/FocalLengthIn35mmFilm': '15', 'Exif/ISOSpeedRatings': '184', 'Exif/Make': 'GoPro', 'Exif/Model': 'HERO10 Black', 'Exif/Orientation': '1', 'Exif/ShutterSpeedValue': '9', 'Exif/Software': 'H21.', 'File/ImageHeight': '4176', 'File/ImageWidth': '5568', 'System/FileModifyDate': '2024:04:22 22:03:38', 'System/FileSize': '5137827'}

As you can see, the sonar on the boat creates a set of points and each of them represents GPS co-ordinates and time (UTC). So it is a line with known GPS co-orginates every 1-2 seconds.

 Each photo, shot every second, has a capture date and once the internal gopro clock is syncronised (isn't at the moment), these will be corresponding times.

 So it should be no problem to put these photos on the reference line (trajectory) created by the sonar by exact capture time, so somewhere around GPS/time points and in between these points. This should allow for both preselection based on capture time and referencing by sonar track.

The sonar also saves depth, which is nothing else than negative height and can also be used in calculations. In my photoset the depth is always 0, as the pictures are taken from the surface. But including deth into calculations may make this new feature useful with ROVs and underwater navigations systems.