# Package com.codename1.ai.vision

package com.codename1.ai.vision

Vendor-neutral on-device vision APIs for still images and live camera frames.

The automatic backend uses Apple Vision/Core Image on iOS and Mac Catalyst and ML Kit on Android. Unsupported ports report that through `isSupported()`. Optional backends are selected with `VisionBackends`.

Each analyzer is a separate build-time feature. Referencing one analyzer causes the builder to retain only its platform adapter and native dependency. `VisionPipeline` safely copies callback-owned camera frames and drops stale pending frames under load.

- Related Packages
  Package
  Description
  com.codename1.ai
  Codename One's AI / LLM client surface plus the value types, streaming primitives, and chat-binding helpers that sit on top of it.
  com.codename1.ai.inference
  Reusable on-device inference sessions for `.tflite` models.
  com.codename1.ai.language
  Vendor-neutral on-device language identification, translation, and smart reply.
- Class
  Description
  Barcode
  Portable barcode observation with normalized geometry.
  BarcodeScanner
  Creates reusable still-image or live-frame barcode analyzers.
  DocumentScanner
  Creates reusable document-boundary and perspective-correction analyzers.
  DocumentScanResult
  Corrected document pages returned as encoded image data.
  Face
  Portable face observation.
  FaceDetector
  Creates reusable on-device face analyzers.
  ImageLabel
  Portable ranked image-classification label.
  ImageLabeler
  Creates reusable on-device image classifiers.
  Pose
  Portable body-pose result.
  Pose.Landmark
  One named body joint with normalized position and confidence.
  PoseDetector
  Creates reusable body-pose analyzers.
  SegmentationMask
  Dense per-pixel foreground confidence mask.
  SelfieSegmenter
  Creates reusable foreground/person segmentation analyzers.
  TextRecognitionResult
  OCR output containing the complete recognized text and portable block-level geometry.
  TextRecognitionResult.TextBlock
  One recognized text block with confidence and normalized bounds.
  TextRecognizer
  Creates reusable on-device OCR analyzers.
  TextScript
  Writing system selectors for `TextRecognizer`.
  VisionAnalyzer<T>
  Reusable, closable on-device analyzer for still images or camera frames.
  VisionBackend
  Identifies a vision implementation.
  VisionBackends
  Vision backend selectors.
  VisionException
  Failure reported by an on-device vision backend.
  VisionFeature
  Features understood by the shared vision backend.
  VisionImage
  Immutable input for encoded still images or raw camera pixels.
  VisionMetadata
  Optional backend identity and backend-specific diagnostic strings attached to a vision result.
  VisionOptions
  Common analyzer configuration.
  VisionPipeline<T>
  Connects a camera frame stream to a reusable analyzer with keep-only-latest backpressure.
  VisionPipelineListener<T>
  Receives live vision results and recoverable analysis failures on the EDT.
  VisionPoint
  Immutable point in a normalized, top-left-origin coordinate space.
  VisionRect
  Immutable normalized rectangle using a top-left origin.