Frame.Metadata

public static class Frame.Metadata extends Object

Frame metadata, describing the image dimensions, rotation, and sequencing information.

Public Constructor Summary

Public Method Summary

int
getFormat()
Returns the format of this image if image data is set.
int
getHeight()
Returns the frame height.
int
getId()
Returns the frame ID.
int
getRotation()
Returns the image rotation, indicating the counter-clockwise rotation from the upright orientation.
long
getTimestampMillis()
Returns the timestamp, in milliseconds.
int
getWidth()
Returns the frame width.

Inherited Method Summary

Public Constructors

public Frame.Metadata ()

public Frame.Metadata (Frame.Metadata metadata)

Public Methods

public int getFormat ()

Returns the format of this image if image data is set.

Returns

public int getHeight ()

Returns the frame height.

public int getId ()

Returns the frame ID. A frame source such as a live video camera or a video player is expected to assign IDs in monotonically increasing order, to indicate the sequence that the frame appeared relative to other frames.

public int getRotation ()

Returns the image rotation, indicating the counter-clockwise rotation from the upright orientation. Has the same meaning as in getRotation().

Since the camera may deliver images that are rotated (e.g., if the user holds the device upside down), specifying the rotation with the image indicates how to make the image be upright, if necessary. Some detectors may rely upon rotating the image before attempting detection, whereas others may not. In preserving the original image from the camera along with this value, the detector may choose whether to make this correction (and to assume the associated cost).

However, note that the detector is expected to report detection position coordinates that are relative to the upright version of the image (whether or not the image was actually rotated by the detector). The Detector will always deliver frame metadata to the Detector.Processor that indicates the dimensions and orientation of an unrotated, upright frame.

public long getTimestampMillis ()

Returns the timestamp, in milliseconds.

A frame source such as a live video camera or a video player is expected to assign timestamps in a way that makes sense for the medium. For example, live video may use the capture time of each frame, whereas a video player may use the elapsed time to the frame within the video. Timestamps should be in monotonically increasing order, to indicate the passage of time.

public int getWidth ()

Returns the frame width.