Dear all,
I am processing helicopter borne RGB images over snow covered arctic sea ice. I found when employing the same dataset with different brightness corrections different matches are found when aligning the images. When applying both datasets, e.g. the original one and the brightness corrected one considerably more images can be aligned than with just one of the datasets. So the idea is to use both datasets for the final image alignment. This is working quite well in the GUI but somehow I cannot get it running in the python API. Here is my code which in its current form only uses the second dataset in the alignment:
...
Images = glob.glob(AerialImagesPattern)
chunk.addPhotos(Images)
crs = Metashape.CoordinateSystem("EPSG::4326")
chunk.importReference(path=OrientationFile, format=Metashape.ReferenceFormatCSV, columns='nyxzabc', crs = crs, delimiter=';', create_markers=False,skip_rows=1)
user_calib = Metashape.Calibration()
user_calib.load(CalibFile)
for sensor in chunk.sensors:
sensor.user_calib = user_calib
sensor.fixed = False
chunk.matchPhotos(reference_preselection = True)
chunk.alignCameras(adaptive_fitting=True)
chunk.optimizeCameras(adaptive_fitting=True)
doc.save()
for camera in chunk.cameras:
camera.photo.path = "/".join(["RAW/Lin_corr", camera.photo.path.rsplit("/",1)[1]])
chunk.matchPhotos(keep_keypoints=True,reset_matches=True)
chunk.alignCameras(reset_alignment=False,adaptive_fitting=True)
chunk.buildDepthMaps(filter_mode=Metashape.AggressiveFiltering)
doc.save()
when I set reset_matches=False I get "Warning: Can't resume matching without keypoints" and only the first dataset is used for the image alignment. What am I missing?
Cheers,
Nik