Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering OpenCV Android Application Programming

You're reading from   Mastering OpenCV Android Application Programming Master the art of implementing computer vision algorithms on Android platforms to build robust and efficient applications

Arrow left icon
Product type Paperback
Published in Jul 2015
Publisher
ISBN-13 9781783988204
Length 216 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Toc

Face detection using the cascade classifier


One of the most common applications of the cascade classifier is face detection. Implementation for both Haar and LBP classifiers on Android using OpenCV is very similar; the only difference is in the model that we use to detect faces. Let's work on a generic application for face detection and make relevant changes to the application to accommodate both Haar and LBP cascades. The application will display the camera preview on the entire screen (landscape orientation) and make rectangles around faces in each frame. It will also provide an option to switch between the front and back camera. Following are the steps to create this application:

  1. Create a new Eclipse (or Android Studio) project with a blank activity and call the application Face Detection. It will be a landscape application with a fullscreen camera preview.

  2. In the application tag, add the following line to make a fullscreen application:

    android:theme="@android:style/Theme.NoTitleBar.Fullscreen...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image