Forum

Author Topic: how to save psz in local coordinate system XYZ ?  (Read 2071 times)

abhigarg

  • Newbie
  • *
  • Posts: 1
    • View Profile
how to save psz in local coordinate system XYZ ?
« on: September 18, 2020, 06:38:49 AM »
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:

Code: [Select]
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:

Code: [Select]
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 ?
« Last Edit: September 18, 2020, 06:41:08 AM by abhigarg »