summaryrefslogtreecommitdiff
path: root/examples/pybullet/examples/pointCloudFromCameraImage.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/pybullet/examples/pointCloudFromCameraImage.py')
-rw-r--r--examples/pybullet/examples/pointCloudFromCameraImage.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/examples/pybullet/examples/pointCloudFromCameraImage.py b/examples/pybullet/examples/pointCloudFromCameraImage.py
index a156090f8..23fbe302f 100644
--- a/examples/pybullet/examples/pointCloudFromCameraImage.py
+++ b/examples/pybullet/examples/pointCloudFromCameraImage.py
@@ -72,8 +72,10 @@ imgW = int(width / 10)
imgH = int(height / 10)
img = p.getCameraImage(imgW, imgH, renderer=p.ER_BULLET_HARDWARE_OPENGL)
-rgbBuffer = img[2]
-depthBuffer = img[3]
+rgbBuffer = np.reshape(img[2], (imgH, imgW, 4))
+# NOTE: this depth buffer's reshaping does not match the [w, h] convention for
+# OpenGL depth buffers. See getCameraImageTest.py for an OpenGL depth buffer
+depthBuffer = np.reshape(img[3], [imgH, imgW])
print("rgbBuffer.shape=", rgbBuffer.shape)
print("depthBuffer.shape=", depthBuffer.shape)