Hello jvduijvenbode,
In the version 1.5.0 you can use this function in the following way:
chunk = Metashape.app.document.chunk
optimize_coverage = Metashape.Tasks.OptimizeCoverage()
optimize_coverage.max_cameras = 50 #or leave 0 for automatic estimation
optimize_coverage.apply(chunk)
The function should be applied after the alignment is performed and also requires the presence of the mesh model in the chunk. As a result some cameras may be disabled, if they are considered to provide excessive information.
[/code]