Package: pypsxlib
AboutPython library for reading, modifying and writing Agisoft Photoscan/Metashape PSX projects. Unofficial.Pretty rough at the moment.Questions? Contributions? Bug reports? Open an issue on thegitlab page for the project.
I am very interested in hearing your use cases forpypsxlibto help drive the roadmap.ContributorsLuke MillerThankspypsxlibmade for 'Project 39', a creative art project supported by Creative Victoria.RoadmapTest suite to find where the psx specification is unsupportedCreate transformation objects for manipulation instead of stringsAdd texture supportAdd mask supportAdd dense cloud supportAdd depth maps supportCopy images+masks across chunksQuickstartInstallingpip install pypsxlibHow do I...Load a .PSX projectfrompypsxlibimportProjectproject=Project().load_psx("myProject.psx")# not all features supportedSave a .PSX projectproject=Project("myProject")project.path="/path/for/project"project.save()# project.name and project.path must be setAdd a Chunkp=Project("myProject")p.defaults()# create a new app and documentp.add_chunk()# add an empty chunkAccess a chunkchunk=p.apps[0].documents[0].chunks[0]Access thumbnailschunk.frames[0].thumbnailsCopy a chunk's bounding box to all other chunksdoc=project.apps[0].documents[0]# or project.document shortcutboundingbox=copy.copy(doc.chunks[0].region)forchunkindoc.chunks[1:]:chunk.region=boundingboxDuplicate a Chunkfrompypsxlibimportutilsp=Project().load("projects/sample.psx")assertlen(p.document.chunks)==1utils.duplicate_chunk(p,0)assertlen(p.document.chunks)==2Access the point data of a meshdoc=project.apps[0].documents[0]mesh=doc.chunks[0].frames[0].model.meshprint(mesh.faceCount)# uses plyfile module to load dataprint([xforxindoc.plydata])# all the verticesSourcegit clone https://gitlab.com/dodgyville/pypsxlib.gitReference.psx project layoutmyProject.psx
myProject.files/
myProject.files/project.zip
myProject.files/<chunkid>/
myProject.files/<chunkid>/chunk.zip
myProject.files/<chunkid>/<frameid>/
myProject.files/<chunkid>/<frameid>/frame.zip
myProject.files/<chunkid>/<frameid>/thumbnails/
myProject.files/<chunkid>/<frameid>/thumbnails/thumbnails.zipChangelogv0.2.0add lens distortion supportaddenabledfield to chunk camerasaddchunk.load_xmlto load direct from xml stringchangechunk.regionandchunk.transformto load direct into numpy arraysfix load bug when no active chunkfix bug where sensor property would not loadlots of small fixes and new testsv0.1.8improved handling for single imagesaddnum_of_repeatsarg toutils.duplicate_chunkv0.1.7fix bugsadd better path supportadd utilsaddutils.duplicate_chunkaddProject.deleteandProject.documentv0.1.5fix packaging issuev0.1.4add calibration support to Sensoradd params support to Sensoradd loading and saving for model and mesh datafix minor bugsv0.1.3add loading and saving for point cloud dataadd covariance support to Sensorfix minor bugsv0.1.2improve support for loading and saving thumbnailsadd loading and saving for camera transformationsadd loading and saving of bounding boxesadd chunk transform, region and meta savingfix bugsv0.1.1improve support for loading project with multiple chunks and camerasimprove support for loading modelsimprove support for loading framesimprove support for loading aligned photosv0.1.0initial release