Android Camerax Mlkit

Seamless integration of CameraX with Google ML Kit for vision tasks.

prasad-vennam Updated

File contents

CameraX & ML Kit Vision Integration 📸

Efficient real-time image analysis.

⚡ When to Use

  • When asked to build barcode scanners, text recognition, or live face detection.

🏗️ Core Rules / Pillars

1. ImageAnalysis UseCase

  • Pattern: ALWAYS use CameraX's ImageAnalysis use case bound to the lifecycle.
  • Implementation: Pipe the ImageProxy directly to an InputImage for ML Kit, ensuring you call imageProxy.close() inside the .addOnCompleteListener.

🚧 Critical Anti-Hallucination Guards

  • Trap: NEVER hold references to ImageProxy outside the analyzer scope to avoid out-of-memory errors!

prasad-vennam/Awesome-Android-AI-Agent-Skills/tree/main/skills/android-camerax-mlkit commit e0c9c468cb

Frequently asked questions

npx skillmds@latest add prasad-vennam/android-camerax-mlkit