Forum

Author Topic: Export .xyz points without camera positions  (Read 7090 times)

beauwalker

  • Newbie
  • *
  • Posts: 1
    • View Profile
Export .xyz points without camera positions
« on: April 30, 2013, 01:00:40 AM »
I am running a Python script to create point clouds from paired stereo images. I wondering how to export only the XYZ points without the camera positions. I am using the command exportPoints( path, format = 'xyz') and am able to generate a point cloud but the camera positions are always included. I'd like to be able to export without the cameras. Is there a way to do this from Python?

Thank you.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: Export .xyz points without camera positions
« Reply #1 on: April 30, 2013, 11:54:20 AM »
Hello beauwalker,

You can create custom point cloud export script, for example:
Code: [Select]
doc = PhotoScan.app.document
chunk = doc.activeChunk
proj = chunk.projection
transform = chunk.transform
cloud = chunk.point_cloud.points

for point in cloud:

if not point.valid:
continue

p_vector = point.coord
if transform:
p_vector.size = 4
p_vector.w = 1
p_vector = transform * p_vector
p_vector.size = 3
p_vector = proj.project(p_vector)

(x, y, z) = p_vector
(r, g, b) = point.color

file.write("{:.5f}".format(x) + "\t{:.5f}".format(y) + "\t{:.4f}".format(z) + "\t" + str(r) + "\t" + str(g) + "\t" + str(b) +"\n")


However, I've just checked the .exportPoint() command and it saves only point cloud with XYZ coordinates, RGB color and Normal vector.
« Last Edit: April 30, 2013, 01:09:06 PM by Alexey Pasumansky »
Best regards,
Alexey Pasumansky,
Agisoft LLC