*
* @author Florian Frankenberger
*/
+@LATTICE("R<CT,R*")
+@METHODDEFAULT("OUT<THIS,THIS<IN,THISLOC=THIS,RETURNLOC=OUT")
public class LEAImplementation {
+ @LOC("CT")
private ClassifierTree classifierTree;
- private Rectangle2D lastRectangle;
-
public LEAImplementation() {
this.loadFaceData();
}
- public FaceAndEyePosition getEyePosition(Image image) {
- if (image == null)
- return null;
-
- Rectangle2D faceRect = classifierTree.locateFaceRadial(image, lastRectangle);
- EyePosition eyePosition = null;
- if (faceRect != null) {
- lastRectangle = faceRect;
- faceRect = null;
- Point point = readEyes(image, lastRectangle);
- if (point != null) {
- eyePosition = new EyePosition(point, lastRectangle);
- }
- }
- System.out.println("eyePosition=" + eyePosition);
-
- return new FaceAndEyePosition(lastRectangle, eyePosition);
- }
-
- private Point readEyes(Image image, Rectangle2D rect) {
- EyeDetector ed = new EyeDetector(image, rect);
- return ed.detectEye();
+ @LATTICE("OUT<V,V<THIS,THIS<IN,V*,THISLOC=THIS,RETURNLOC=OUT")
+ @PCLOC("THIS")
+ public FaceAndEyePosition getEyePosition(@LOC("IN") Image image) {
+ return classifierTree.getEyePosition(image);
}
public boolean needsCalibration() {
}
/**
- * This method loads the faceData from a file called facedata.dat which should
- * be within the jar-file
+ * This method loads the faceData from a file called facedata.dat which should be within the
+ * jar-file
*/
private void loadFaceData() {