Summary: Nested Classes | Inherited Methods | [Expand All]
public class

# MultiProcessor

extends Object
implements Processor<T>

java.lang.Object
↳ | com.google.android.gms.vision.MultiProcessor<T>

## Class Overview

Detection processor which distributes the items of a detection result among individual trackers. This enables detection result processing code to be defined at the individual item level, avoiding the need for boilerplate code for iterating over and managing groups of items.

When a new item is detected, a supplied `MultiProcessor.Factory` is used to create a `Tracker` instance to receive notifications on that item. This instance will be notified as the item changes, and eventually when the item is gone. The tracker may accumulate whatever state is appropriate over the life cycle of the item. For example, for gesture detection a face tracker may keep a record over time of recent landmark positions used in detecting a gesture such as blinking or a head nod.

For example, the code below creates and starts a pipeline that continuously receives preview frames from a camera source, runs detection on the frames, and uses a multiprocessor to continuously deliver notifications over multiple frames to tracker instances (a different tracker instance is created and managed for each distinct detected item).

    detector.setProcessor(
       new MultiProcessor.Builder(new MyTrackerFactory()).build());

     CameraSource cameraSource = new CameraSource.Builder(context, detector)
       .build()
       .start();

Where "MyTrackerFactory" is an implementation of `MultiProcessor.Factory` for creating a `Tracker` instance for each distinct detected item.

## Summary

Nested Classes
class | MultiProcessor.Builder<T> | Builder for creating a multiprocessor instance.
interface | MultiProcessor.Factory<T> | Factory for creating new tracker instances.

[Expand] Inherited Methods
From class java.lang.Object
Object | clone()
boolean | equals(Object arg0)
void | finalize()
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)
final void | wait()
From interface com.google.android.gms.vision.Detector.Processor
abstract void | receiveDetections(Detections<T> detections) Called by the detector to deliver detection results to the processor.
abstract void | release() Shuts down and releases associated processor resources.