public interface VisionAnalyzer<T>
ExtendsAutoCloseable
Known subtypesBarcodeScanner, DocumentScanner, FaceDetector, ImageLabeler, PoseDetector, SelfieSegmenter, TextRecognizer
Reusable, closable on-device analyzer for still images or camera frames.
This is the type VisionCameraView is parameterized on, so the
concrete analyzer and its result type travel together:
VisionAnalyzer<Barcode[]> analyzer = new BarcodeScanner();
VisionCameraView<Barcode[]> view = new VisionCameraView<Barcode[]>(analyzer);
Implementations may retain native detectors and models between calls, so create one analyzer per stream/workflow and close it when finished. Backend creation, request scheduling, capability checks, and close are serialized so a concurrent close cannot leave a newly created backend attached after the analyzer has closed.
Methods
public abstract boolean isSupported() | Tests the exact feature/backend pair configured for this analyzer. |
public abstract AsyncResource<T> process(VisionImage image) | Starts one asynchronous analysis without uploading the image. |
public abstract void close() | Releases native detector/model resources; further processing fails. |
Method details
isSupported
public abstract boolean isSupported()Tests the exact feature/backend pair configured for this analyzer.
Returns
true when the current target supports itprocess
public abstract AsyncResource<T> process(VisionImage image)Starts one asynchronous analysis without uploading the image.
Parameters
imageVisionImage- encoded or raw input
Returns
asynchronous typed result delivered on the EDT
close
public abstract void close()Releases native detector/model resources; further processing fails.