Accidently found that Android itself has a FaceDetector class #android.media.FaceDetector but it only gives found faces without feature points. It use FFTEm library, I will dig it later. FFT is Fast Fourier Transform, EM may refer to "expectation-maximization". http://stackoverflow.com/questions/335
| 50 | * |
| 51 | */ |
| 52 | public class FaceDetector |
| 53 | { |
| 54 | private static final String TAG = FaceDetector.class.getSimpleName(); |
| 55 | private static final boolean NATIVE = true; |
| 56 | |
| 57 | // private static final int MIN_SIZE = 30; |
| 58 | |
| 59 | // ROI (region Of Interest), these values must match up with the enum in jni/stasm/roi.h |
| 60 | public enum Roi |
| 61 | { |
| 62 | FACE, // the whole face (0, 0) |
| 63 | EYE_BROW_L, |
| 64 | EYE_BROW_R, |
| 65 | EYE_LASH_L, |
| 66 | EYE_LASH_R, |
| 67 | EYE_SHADOW_L, |
| 68 | EYE_SHADOW_R, |
| 69 | IRIS_L, |
| 70 | IRIS_R, |
| 71 | BLUSHER_L, |
| 72 | BLUSHER_R, |
| 73 | NOSE, |
| 74 | LIPS; // upper lip and lower lip |
| 75 | } |
| 76 | |
| 77 | public static class RoiInfo |
| 78 | { |
| 79 | public PointF origion; // (left, top) |
| 80 | public PointF pivot; |
| 81 | public Mat mask; |
| 82 | |
| 83 | RoiInfo() |
| 84 | { |
| 85 | origion = new PointF(); |
| 86 | pivot = new PointF(); |
| 87 | mask = new Mat(); |
| 88 | } |
| 89 | |
| 90 | // This method is used is used by JNI. (Don't delete it) |
| 91 | @SuppressWarnings("unused") |
| 92 | RoiInfo(PointF origion, PointF pivot, Mat mask) |
| 93 | { |
| 94 | this.origion = origion; |
| 95 | this.pivot = pivot; |
| 96 | this.mask = mask; |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | private RoiInfo[] regions; // cache, filled by C++ |
| 101 | |
| 102 | private CascadeClassifier classifier_face; |
| 103 | private CascadeClassifier classifier_eye_l; |
| 104 | private CascadeClassifier classifier_eye_r; |
| 105 | private CascadeClassifier classifier_mouth; |
| 106 | |
| 107 | private String data_dir; |
| 108 | |
| 109 | // private int image_width, image_height; |
nothing calls this directly
no outgoing calls
no test coverage detected