Forum

Author Topic: Bug in Tools/Marker/Marker Import with same photo names  (Read 6428 times)

andyroo

  • Sr. Member
  • ****
  • Posts: 450
    • View Profile
Bug in Tools/Marker/Marker Import with same photo names
« on: June 17, 2015, 03:11:55 AM »
I am working on a project where I have several images with the same name (IMG_XXXX.JPG), where the cameras are divided into different groups by flight date. I have found that if I export markers (Tools/Export/Export Markers), delete them, and re-import them, then marker coordinates are not reliably assigned to the correct image - in  other words, the marker coordinates saved on one image don't reliably come back to that image, and are instead sometimes applied to another image with the same name, in a different image group. This results in all hell breaking loose during model optimization, and some very funky results when updating too.

Initially I thought I had made some badly-formed XML when I was importing marker locations from another project, but when I got the markers correct in the new project, then saved the project, exported markers, deleted markers, and imported them again, the problem re-occurred - green control point flags showed up on images in different groups, but with the same name, as images that were originally tagged with GCP locations.

EDIT - This is becoming more of an issue as I expand the project to cover 10 000 images +. pair selection time is dramatically increased if I don't remove GCPs, but if I manually remove them and re-add them by exporting, then importing markers, then I have to go through all the markers by hand and remove erroneous ones.
« Last Edit: June 30, 2015, 08:40:59 PM by andyroo »

Dmitry Semyonov

  • Agisoft Technical Support
  • Full Member
  • *****
  • Posts: 201
    • View Profile
Re: Bug in Tools/Marker/Marker Import with same photo names
« Reply #1 on: July 08, 2015, 01:06:29 PM »
Hello Andy,

PhotoScan uses camera labels to match marker projections to specific photos during marker import. Camera labels are initialized to image file names by default. This can result in ambiguous selection of photos in case there are multiple images with the same file name in the chunk.

A possible solution to this problem is to rename image files after each flight adding the date of the flight (or flight id) to the beginning of the file name.

In case renaming of the images is not acceptable, camera labels can be modified in the similar way using a Python script after the images are added to the project. For example, a Python script can read EXIF date for each photo and add it to the camera label.

In case you are interested in a Python solution (with keeping original file names intact) - we will be happy to help you with a script.
With best regards,
Dmitry Semyonov
Agisoft

bassistas

  • Newbie
  • *
  • Posts: 42
    • View Profile
Re: Bug in Tools/Marker/Marker Import with same photo names
« Reply #2 on: January 04, 2022, 10:33:59 PM »
Hello Andy,

PhotoScan uses camera labels to match marker projections to specific photos during marker import. Camera labels are initialized to image file names by default. This can result in ambiguous selection of photos in case there are multiple images with the same file name in the chunk.

A possible solution to this problem is to rename image files after each flight adding the date of the flight (or flight id) to the beginning of the file name.

In case renaming of the images is not acceptable, camera labels can be modified in the similar way using a Python script after the images are added to the project. For example, a Python script can read EXIF date for each photo and add it to the camera label.

In case you are interested in a Python solution (with keeping original file names intact) - we will be happy to help you with a script.

Hello, I have the same problem, I have a project with some photos from a Dji phantom 4 pro imported in metashape and I have added a lot of markers. Now I want to move the photos to a new chunk as well as the markers and when I import the markers xml file into the new chunk where there is a duplicate filename from the drone photos the markers are placed wrong. Is there any script available somewhere that can solve this by using the EXIF data stored on each of these photos?
« Last Edit: January 05, 2022, 05:29:10 AM by bassistas »