dclipca
dclipca

Reputation: 1937

Getting byte[] or ByteBuffer from CameraX ImageAnalysis

Is there a way to get a byte[] or ByteBuffer from the CameraX ImageAnalysis use case? Any insight is appreciated.

Upvotes: 0

Views: 946

Answers (1)

Xi 张熹
Xi 张熹

Reputation: 11071

From CameraX test app:

byte[] bytes = new byte[image.getPlanes()[0].getBuffer().remaining()];
image.getPlanes()[0].getBuffer().get(bytes);

Upvotes: 2

Related Questions