Hi,
I am using a trial version of Photoscan Pro. I have written following python script to generate an orthophoto from a list of UAV frames.
import os
import PhotoScan
import sys
doc = PhotoScan.app.document
chunk = PhotoScan.Chunk()
chunk.label = "New Chunk"
doc.chunks.add(chunk)
print("Srcipt started")
path_photos= "G:/UAV_images/test_photoscan_script"
project_path= "G:/UAV_images/test_photoscan_script/project/test.psz"
mosaic_path= "G:/UAV_images/test_photoscan_script/test.tif"
#adding photos
image_list = os.listdir(path_photos)
for photo in image_list:
if ("jpg" or "jpeg" or "tif" or "png") in photo.lower():
chunk.photos.add(path_photos + photo)
PhotoScan.app.update()
#align photos
chunk.matchPhotos(accuracy = "high", preselection = "ground control", filter_mask = False, point_limit = 40000)
#doc.activeChunk.matchPhotos(accuracy = "high", preselection = "generic", filter_mask = False, point_limit = 50000)
chunk.alignPhotos()
#chunk.buildDepth(quality="medium")
#build dense cloud
chunk.buildDenseCloud(quality = "high", filter = "aggressive")
#build mesh
chunk.buildModel(surface = "height field", source = "dense", interpolation = "enabled", faces="medium")
#build texture
chunk.buildTexture(mapping = "orthophoto", blending = "mosaic", color_correction = False, size = 4096, count = 1)
#decimate model
chunk.decimateModel(face_count = 200000)
#save
doc.save(project_path)
PhotoScan.app.update()
print("Script finished")
After executing the above python script when I try to export Orthophoto from GUI, the Geographic radio button is disabled only Planar is enabled. But I want a georeferenced Orthophoto. I might have missed something in the script, could you please help me to resolve this.
FYI, I have tried the batch Process under workflow menu and use the same set of arguments. Surprisingly it has enabled the Geographic option. But I badly need the python script to work.
Thanks.
PPodder