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:
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.
In the application tag, add the following line to make a fullscreen application:
android:theme="@android:style/Theme.NoTitleBar.Fullscreen...