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
Fixing example point_cloud_capture.py with getting the numpy array sh…
…ape and having the correct order of the width vs height.
  • Loading branch information
JonathanESantos committed Apr 26, 2021
commit 25c87485fe0612aa9393c4840311b272a9d9e41c
3 changes: 1 addition & 2 deletions src/python/k4a/examples/point_cloud_capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
xyz_image = transformation.depth_image_to_point_cloud(capture.depth, k4a.ECalibrationType.DEPTH)

# 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)
height, width, channels = xyz_image.data.shape
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