java.lang.Object | |
↳ | com.google.android.gms.vision.Tracker<T> |
A tracker is used to receive notifications for a detected item over time. Subclasses should override the relevant methods below to implement the logic associated with tracking an item in a particular way.
Note that Tracker requires the Detector
return stable IDs across frames for the same
object. As a result, some Detectors (such as TextRecognizer
) currently do not work well
with Tracker, and developers may need to implement their own tracking mechanism.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Called to indicate that the item associated with the ID previously reported via
onNewItem(int, Object) has been assumed to be gone forever. | |||||||||||
Called if either the tracked item was not detected at all in a frame, or if the specific item
identity associated with the tracker is not present in the current frame.
| |||||||||||
This method is called to initially assert a new item when it is detected.
| |||||||||||
As an item is detected over time, this method is called to give an update for the item in the
context of the overall detection.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Called to indicate that the item associated with the ID previously reported via onNewItem(int, Object)
has been assumed to be gone forever.
Called if either the tracked item was not detected at all in a frame, or if the specific item
identity associated with the tracker is not present in the current frame. It's possible that
the item may be missed for a few frames, and will reappear later, depending upon the detector
settings. onUpdate(Detector.Detections
would then be called.
Parameters | |
---|---|
detections |
Detections :
full detection results for the frame and associated frame metadata
|
This method is called to initially assert a new item when it is detected. The ID will remain
constant for all calls to onUpdate(Detector.Detections
until onDone()
is called.
onUpdate(Detector.Detections
is always called immediately following this method call, with the same
item that was passed into this method.
Parameters | |
---|---|
id |
int :
ID representing the specific detected item |
item |
T :
detection information for the newly detected item
|
As an item is detected over time, this method is called to give an update for the item in the
context of the overall detection. Each item that is received has the same ID as the most recent
call of onNewItem(int, Object)
. That is, it has been determined to be the same tracked
item as was initially seen.
Parameters | |
---|---|
detections |
Detections :
full detection results and associated frame metadata |
item |
T :
detection information for the tracker's associated item
|