Detect faces with OpenCV on Android Devices
Introduction
Background
Create a project, add OpenCV, and read camera frames
Face detection
Next Steps
Detect faces with OpenCV on Android Devices
Review frequently asked questions
These FAQs were drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.
Use the Empty Views Activity template. It matches the structure expected by the instructions and keeps the project minimal.
Your project should sync and build without errors, and OpenCV classes should resolve in the editor. You can confirm runtime availability when the app runs on the device without OpenCV initialization errors.
No. You’ll use OpenCV’s pre‑trained Haar cascade for face detection, so you don’t need to train a model.
Use a Haar cascade XML file provided by OpenCV for face detection. It contains pre‑trained data the classifier loads at runtime.
You should see camera frames retrieved and processed with the Haar cascade classifier. Check for detections according to your app’s processing and display logic.