java.lang.Object | |
↳ | com.google.android.gms.vision.FocusingProcessor<T> |
![]() |
Base class for implementing a processor
which filters the set of
detection results, consistently delivering a single detected item to an associated Tracker
.
Subclasses implement selectFocus(Detections)
to define the criteria for initially selecting the detected item in which to "focus upon". Once
selected, this same detected item will be sent to the tracker for as long as it exists in
consecutive frames handled by a detector. That is, the tracking ID of the selected item, as
included in the getDetectedItems()
result, determines the selected
item for subsequent frames. After the selected item is no longer visible, a new item will be
selected as the focus.
For example, the code below creates and starts a pipeline that continuously receives preview frames from a camera source, runs detection on frames, and uses a focusing processor to continuously deliver a specific item of interest to a tracker over multiple frames.
detector.setProcessor(
new MyFooFocusingProcessor(
detector,
new MyFooTracker()));
CameraSource cameraSource = new CameraSource.Builder(context, detector)
.build()
.start();
Where "MyFooFocusingProcessor" is a subclass of FocusingProcessor and "MyFooTracker" is a
subclass of Tracker
, for an associated detector for finding "Foo" items.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a focusing processor.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Notifies the associated tracker that tracking has completed.
| |||||||||||
Subclasses implement this method to select the item on which to focus.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Creates a focusing processor.
Parameters | |
---|---|
detector |
Detector :
associated detector instance which generates the detection results to be
filtered by this focusing processor. This class calls back into setFocus(int) as a hint to the detector, allowing the detector to (optionally)
choose to short circuit full frame detection if it is faster to just detect the focus item
of interest. |
tracker |
Tracker :
instance to receive notifications on the status of the focus item of interest.
|
Notifies the associated tracker that tracking has completed.
Subclasses implement this method to select the item on which to focus.
Parameters | |
---|---|
detections |
Detections :
detection results received from a detector |
Returns | |
---|---|
int |
the tracking ID of the detection item on which to focus, discovered as the key of the
associated selected item in the SparseArray , which is obtained from
the detections' getDetectedItems() method.
|