Android Head Tracking

From Immersive Visualization Lab Wiki
Revision as of 23:15, 19 May 2013 by Khdang (Talk | contribs)

Jump to: navigation, search

Contents

Project Overview

This project's main goal is to be able to create an application on the Android mobile platform that will use face detection to track the head movements of the user. The face detection is used with OpenCV and Androids Face Detection API, and with these algorithms, we are able to locate the face with the device's front facing camera. After face detection has been implemented, we would need to be able to track the faces X,Y and Z coordinates (relative to the camera). With this data, we would be able to create a 3D model view where the user would be able to look around the object by simply moving their head.


Significant Updates

  • May 8-9 Discovered helpful Face Detection/Eye Tracking algorithm, and successfully set up environment and code to work as a base.
  • May 7 - Got face detection samples running on android device (complied on development computer)
  • April 30 - Found Error with Hardware on API on Development device.
  • April 23 - Gained Control of the Camera

TO DO

  • Using openCV for face detection
    • Testing face detection samples on development device.
    • Finding the range of Face Detection
  • Display eye positions, and other helpful information
  • Enable Front Camera
  • Comb through Eye Detection code to create usable functions
  • Create simple openGL interface

Known Bugs/Issues

  • Android Face Detection API
    • Only works for Ice Cream Sandwich [API 14.0 4.0] and up
    • Not all Devices Support the FaceDetection API
  • OpenCV Samples
    • Sample Face Detection Code is not the most accurate face detection
      • Need to do more testing on faces and different lighting and back ground
    • Face Detection works when user looks directly at the camera but has issues finding sides of the face.
  • Eye Tracking
    • Pupal are not tracked correctly like in the tutorial but I will not being using that data for this project and will focus on bounding box around the eyes for coordinates

Additional Information

Android API

  • The following code allows determines if the hardware of the device support Face Detection API
// if faces is less than zero then device does not support face detection 
int faces = params.getMaxNumDetectedFaces(); 
  • Used within a check function
/** 
     * faceDetectionCheck Method
     * @param currentCamera	the current Camera used for the application
     * Checks to see if the current camera passed 
     * @return
     */
    private static boolean faceDetectionCheck(Camera currentCamera){ 
    	Camera.Parameters params = currentCamera.getParameters();
        System.out.println("Checking to see if face detection works on the Device");
        // start face detection only *after* preview has started
        int faces = params.getMaxNumDetectedFaces();
        if(faces > 0){
        		System.out.println("Android Face Detection is compatable on this Device");
        		return true;
        }
        System.out.println("Android Face Detection API is not compatable");
    	
    	return false;
        }
    

OpenCV Samples

  • This the the result from OpenCV face detection sample.
    • -Ken-openCV example1.jpg
  • OpenCV Testing with Human Face
    • -Ken-openCV face.jpg

OpenCV Eye Tracking

  • Base Tutorial 1 model running on Asus Transformer
    • Eye-Tracking.jpg

Permissions

    <uses-permission android:name="android.permission.CAMERA"/>
    <uses-feature android:name="android.hardware.camera" />
    <uses-feature android:name="android.hardware.camera.autofocus" />