In my workflow, I add photos that are in multiple folders. Sometimes a photo with a specific name (e.g. IMG_1001.JPG) can appear in more than one folder, even though it's actually a different photo. Metashape's default label for the cameras is just the photo filename, which means I can end up with multiple cameras with the same label. This is not acceptable, because my GCP workflow requires referencing specific cameras by their labels. Therefore, I relabel my cameras to have unique labels (the label includes the name of the folder it was in):
for camera in doc.chunk.cameras:
path = camera.photo.path
path_parts = path.split("/")[-2:]
newlabel = "/".join(path_parts)
camera.label = newlabel
However, I have noticed that if I relabel the cameras, I get a different alignment than if I don't relabel them. The alignment is much worse if I have relabeled the cameras first. For example, Metashape thinks some groups of cameras are pointing toward the sky or at very oblique angles, even though they are actually all pointing directly downward. The only thing I change between the two runs is whether or not the cameras get relabeled. I do the relabeling immediately after adding the photos. I have repeated this multiple times and I always get the same results.