Hello Frank,
Could you please try the following script on your data.
You can use argument field for better results. It is some kind of tolerance and is 50 by default, lower values mean more strict criterion, but I do not recommend to go under 5-10 units:
import sys
import PhotoScan
doc = PhotoScan.app.document
chunk = doc.activeChunk
arg = 50 #tolerance by default
if len(sys.argv) > 1:
arg = int(sys.argv[1])
print("Script started.")
camera_list = list(chunk.cameras)
for camera in list(camera_list): #removing from list NA and disabled cameras
if not (camera.transform and camera.enabled):
camera_list.remove(camera)
dist = list()
for i in range(0, len(camera_list)):
icamera = camera_list[i]
for j in range(i + 1, len(camera_list)):
jcamera = camera_list[j]
stereobase = (icamera.center - jcamera.center).norm()
dist.append(stereobase)
dist.sort()
mediana = dist[len(dist) // 2]
for i in range(0, len(camera_list)):
icamera = camera_list[i]
if not icamera.enabled:
continue
for j in range(i + 1, len(camera_list)):
jcamera = camera_list[j]
stereobase = (icamera.center - jcamera.center).norm()
if stereobase < mediana / arg:
jcamera.enabled = False
continue
print("Script finished.")