Hi Nico,
Is this a suggestion or a question? You are not really clear on that. Nevertheless, it is already part of the api. I use the following code (based on the documentation), I hope it is usefull for others.
# first load a document, 'photoScanFile' is set to a .psz file in my case
document = PhotoScan.Document()
document.open(photoScanFile)
# set frame for the first (0) chunk, i is desired frame (in my case this is part of a loop):
i = 2
document.chunks[0].frame = i
# The first frame is always frame 0
first_frame = 0
# the last name is the number of frames
last_frame = document.chunks[0].frame_count
The loop I use if for exporting all frames, it looks like this:
for i in range(0,document.chunks[0].frame_count):
# export file names
outputDEM = '%s/DEM_%04i.tif' % (outputDir, i+1)
outputOrtho = '%s/Ortho_%04i.tif' % (outputDir, i+1)
# set current frame
document.chunks[0].frame = i
# export dem and orthophoto
document.chunks[0].exportDem(outputDEM, format='tif', region=exportRegion, dx=gridSize, dy=gridSize)
document.chunks[0].exportOrthophoto(outputOrtho, format='tif', region=exportRegion, dx=gridSize, dy=gridSize)