Hello Alexey,
Yes, the full code includes the point cloud densification before duplicatinig chunks. According to the console, there's a line saying "XXXX points extracted".
I did the point cloud manually in one chunk, it have it now displayed properly. I'll try to run the chunk duplication with a separate script if that's what you mean?
Here's the full code:
import os, sys, PhotoScan
doc = PhotoScan.app.document
chunk = doc.addChunk()
nbTrous = int(sys.argv[1])
path_photos = PhotoScan.app.getExistingDirectory("""Spécifiez le dossier
contenant les photos""")
path_photos += "\\"
# Checking save filename
project_path = PhotoScan.app.getSaveFileName("""Spécifiez le nom du projet
à enregistrer : """)
if not project_path:
print("""Annulation du script : pas de chemin d'enregistrement fourni""")
if project_path[-4:].lower() != ".psx":
project_path += ".psx"
# Saving for G3D Reco
project_path_reco = PhotoScan.app.getSaveFileName("""Spécifiez le nom du projet
à enregistrer pour Green 3D Reco : """)
if not project_path_reco:
print("""Annulation du script : pas de chemin d'enregistrement fourni""")
if project_path_reco[-4:].lower() != ".psx":
project_path_reco += ".psx"
image_list = os.listdir(path_photos)
photo_list = list()
for photo in image_list:
if photo.rsplit(".",1)[1].upper() in ["JPG", "JPEG", "TIF", "PNG"]:
photo_list.append(path_photos + photo)
print(photo)
else:
print("""Pas de photo exploitable dans le dossier.""")
print(photo_list)
chunk.addPhotos(photo_list)
PhotoScan.app.update()
chunk.matchPhotos(accuracy = PhotoScan.MediumAccuracy,
preselection = PhotoScan.ReferencePreselection, filter_mask = False,
keypoint_limit = 40000, tiepoint_limit = 4000)
chunk.alignCameras()
doc.save(project_path_reco)
chunk.buildDenseCloud(quality = PhotoScan.MediumQuality,
filter = PhotoScan.AggressiveFiltering)
doc.save(project_path_reco)
chunkIter = 1
chunk = doc.chunk # active chunk, if there's any in the project
while chunkIter <= nbTrous:
chunk.label = "Trou" + str(chunkIter) + "-Green"
chunk = doc.chunk.copy()
chunk.label = "Trou" + str(chunkIter) + "-Approche"
chunk = doc.chunk.copy()
chunkIter += 1
doc.save(project_path)
Bonus question: how can I use the PhotoScan.estimateImageQuality to align only photos with a quality score > 0,5?