Hi,
I am using the following Metashape python script-1 to generate the 3D using multiple images and save the PLY and PSZ files. But the PSZ generated is showing in WGS coordinate system when I try to read again using Metshape python script-2. I need the output PSZ in Local coordinate system XYZ. Can someone help me?
script-1:
import os
import Metashape
doc = Metashape.app.document
chunk = doc.addChunk()
images_dir = '<path_to_image_directory>
images_list = os.listdir(images_dir)
images = [os.path.join(images_dir,img_name) for img_name in images_list if img_name.endswith('.JPG')]
chunk.addPhotos(images)
chunk.matchPhotos(downscale=1, generic_preselection=True, reference_preselection=False)
chunk.alignCameras()
chunk.buildDepthMaps(downscale=2, filter_mode=Metashape.AggressiveFiltering)
chunk.buildDenseCloud()
chunk.buildModel(surface_type=Metashape.Arbitrary, interpolation=Metashape.EnabledInterpolation,face_count_custom=6000000, face_count=Metashape.CustomFaceCount)
chunk.buildUV(mapping_mode=Metashape.GenericMapping)
chunk.buildTexture(texture_size=4096)
PhotoScanPlyFile = 'out.ply'
successLoad=chunk.exportModel(path=PhotoScanPlyFile, format=Metashape.ModelFormat.ModelFormatPLY, texture_format=Metashape.ImageFormat.ImageFormatJPEG)
psz_path = 'out.psz'
doc.save(path=psz_path)
script-2:
import Metashape
doc = Metashape.Document()
doc.open('out.psz')
chunk = doc.chunk
print(chunk.crs)
The output of script-2 is:
<CoordinateSystem 'WGS 84 (EPSG::4326)'>
How can I get the output psz in Local Coordinate system XYZ ?