October 2018
Intermediate to advanced
246 pages
6h 26m
English
Let's create this instance of a FirebaseVisionImage using a ByteBuffer. To do so, though, we must first create an instance of a FirebaseVisionImageMetadata. This contains the data required to construct the vision image, such as format, rotation, and measurements (height and width) as follows:
FirebaseVisionImageMetadata metadata = new FirebaseVisionImageMetadata.Builder() .setWidth(1280) .setHeight(720) .setFormat(FirebaseVisionImageMetadata.IMAGE_FORMAT_NV21) .setRotation(rotation) .build();
We can then pass this along with our ByteBuffer to create the following instance:
FirebaseVisionImage myImage = FirebaseVisionImage.fromByteBuffer(buffer, metadata);
Read now
Unlock full access