webots icon indicating copy to clipboard operation
webots copied to clipboard

documentation's code snippet doesn't work

Open nice-bicycle opened this issue 1 year ago • 0 comments

cameraData = camera.getImage()

# get the gray component of the pixel (5,10)
gray = Camera.imageGetGray(cameraData, camera.getWidth(), 5, 10)

This crashes. You should also give a better example, since the fact that getImage returns a 1d byte array is not easy to find in the documentation. I would have been happy if there were helper functions so I didn't have to know getImage returns a 1d byte array.

nice-bicycle avatar Dec 05 '23 05:12 nice-bicycle