I was following this topic to try to get the buffer data from a camera and save it as a numpy
array. Following the topic I reused this code:
base.graphicsEngine.renderFrame()
dr = base.camNode.getDisplayRegion(0)
tex = dr.getScreenshot()
data = tex.getRamImage()
image = np.frombuffer(data,np.uint8)
image.shape = (tex.getYSize(),tex.getXSize(),tex.getNumComponents())
print(image)
However, I get this error:
File "main.py", line 137, in __init__
image = np.frombuffer(data,np.uint8)
AttributeError: 'panda3d.core.ConstPointerToArray_unsigned_char' object has no attribute '__buffer__'
Any advice?