Frame

Also:"vision"
public classFrameextendsObject

Image data with associatedmetadata.

A frame is constructed via thebuilder class, specifying the image data, dimensions, and sequencing information (frame ID, timestamp).

Nested Class Summary

class Frame.Builder Builder for creating a frame instance.
class Frame.Metadata Frame metadata, describing the image dimensions, rotation, and sequencing information.

Constant Summary

int ROTATION_0
int ROTATION_180
int ROTATION_270
int ROTATION_90

Public Method Summary

Bitmap
getBitmap()
Returns the bitmap which was specified in creating this frame, or null if no bitmap was used to create this frame.
ByteBuffer
getGrayscaleImageData()
Returns the grayscale version of the frame data, with one byte per pixel.
Frame.Metadata
getMetadata()
Returns the metadata associated with the frame.

Inherited Method Summary

Constants

public static final int ROTATION_0

Also:"vision"
Constant Value:0

public static final int ROTATION_180

Also:"vision"
Constant Value:2

public static final int ROTATION_270

Also:"vision"
Constant Value:3

public static final int ROTATION_90

Also:"vision"
Constant Value:1

Public Methods

publicBitmap getBitmap()

Also:"vision"

Returns the bitmap which was specified in creating this frame, or null if no bitmap was used to create this frame. If the bitmap is not available, thengetGrayscaleImageData() should be called instead.

publicByteBuffer getGrayscaleImageData()

Also:"vision"

Returns the grayscale version of the frame data, with one byte per pixel. Note that the returned byte buffer will be prefixed by the Y channel (i.e., the grayscale image data), but may optionally include additional image data beyond the Y channel (this can be ignored).

If a bitmap was specified when creating this frame, the bitmap is first converted to a grayscale byte[] (allocation / copy required). It is recommended that you use the bitmap directly throughgetBitmap() if the associated native detection code supports it, since this would move the grayscale conversion into native code where it will be faster.

publicFrame.Metadata getMetadata()

Also:"vision"

Returns the metadata associated with the frame.