Skip to content
This repository was archived by the owner on Aug 22, 2024. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Replacing point cloud example to use numpy reshape.
  • Loading branch information
JonathanESantos committed Apr 19, 2021
commit 5f33e6116f8ddde5c1925a9878008444b3f3024b
4 changes: 1 addition & 3 deletions src/python/k4a/examples/point_cloud_capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
# Save Point Cloud To Ascii Format File. Interleave the [X, Y, Z] channels into [x0, y0, z0, x1, y1, z1, ...]
width, height, channels = xyz_image.data.shape
xyz_data = np.empty((width * height, channels,), dtype=xyz_image.data.dtype)
xyz_data[:,0] = xyz_image.data[:,:,0].reshape(width*height)
xyz_data[:,1] = xyz_image.data[:,:,1].reshape(width*height)
xyz_data[:,2] = xyz_image.data[:,:,2].reshape(width*height)
xyz_data = xyz_image.data.reshape(height * width, channels)

np.savetxt('data.txt', xyz_data, delimiter=' ', fmt='%u') # save ascii format (x y z\n x y z\n x y z\n ...)

Expand Down