it passes all checkings.
authoryeom <yeom>
Wed, 21 Sep 2011 00:11:56 +0000 (00:11 +0000)
committeryeom <yeom>
Wed, 21 Sep 2011 00:11:56 +0000 (00:11 +0000)
Robust/src/Benchmarks/SSJava/EyeTracking/ClassifierTree.java
Robust/src/Benchmarks/SSJava/EyeTracking/DeviationScanner.java
Robust/src/Benchmarks/SSJava/EyeTracking/LEA.java
Robust/src/Benchmarks/SSJava/EyeTracking/LEAImplementation.java

index d63e3dc6c9368094c3740b5ccc03a0a1c7ea39c6..637ac6262af6bc6e5726d81d591b4f7aa7be1fd3 100644 (file)
@@ -95,7 +95,7 @@ public class ClassifierTree {
     @LOC("THIS,ClassifierTree.C") int startPosX = (int) lastCoordinates.getX();
     @LOC("THIS,ClassifierTree.C") int startPosY = (int) lastCoordinates.getX();
 
-    for (@LOC("THIS,ClassifierTree.C") float factorDiff = 0.0f; Math.abs(factorDiff) <= maxScaleDifference; factorDiff =
+    TERMINATE: for (@LOC("THIS,ClassifierTree.C") float factorDiff = 0.0f; Math.abs(factorDiff) <= maxScaleDifference; factorDiff =
         (factorDiff + sgn(factorDiff) * 0.1f) * -1 // we alternate between
                                                    // negative and positiv
                                                    // factors
@@ -114,14 +114,15 @@ public class ClassifierTree {
       @LOC("THIS,ClassifierTree.C") int maxDiffX = Math.max(Math.abs(startPosX - maxX), startPosX);
       @LOC("THIS,ClassifierTree.C") int maxDiffY = Math.max(Math.abs(startPosY - maxY), startPosY);
 
-      for (@LOC("CXY") float xDiff = 0.1f; Math.abs(xDiff) <= maxDiffX; xDiff =
+      TERMINATE: for (@LOC("CXY") float xDiff = 0.1f; Math.abs(xDiff) <= maxDiffX; xDiff =
           (xDiff + sgn(xDiff) * 0.5f) * -1) {
         @LOC("CXY") int xPos = Math.round((float) (startPosX + xDiff));
+
         if (xPos < 0 || xPos > maxX)
           continue;
 
         // yLines:
-        for (@LOC("CXY") float yDiff = 0.1f; Math.abs(yDiff) <= maxDiffY; yDiff =
+        TERMINATE: for (@LOC("CXY") float yDiff = 0.1f; Math.abs(yDiff) <= maxDiffY; yDiff =
             (yDiff + sgn(yDiff) * 0.5f) * -1) {
           @LOC("CXY") int yPos = Math.round(startPosY + yDiff);
           if (yPos < 0 || yPos > maxY)
index 052c7f4bdc25a45dd654612530a1f786be97078f..c3749fd7f8f62b7b9cca30fd591297f545f358aa 100644 (file)
@@ -64,6 +64,8 @@ public class DeviationScanner {
 \r
     if (size < eyePositions.length) {\r
       size++;\r
+    }else{\r
+      size= eyePositions.length;\r
     }\r
 \r
   }\r
index 587a59f9a32a7c6fd674e8db1b135835ed104978..ea5f7e08a15210c7b41091d12fe27e3d89e3f845 100644 (file)
@@ -92,10 +92,9 @@ public class LEA {
   @LATTICE("THIS<IMG,IMG<C,C*,THISLOC=THIS")
   public void doRun() {
 
-    @LOC("C") int maxCount = 37;
     @LOC("C") int i = 0;
 
-    SSJAVA: while (i < maxCount) {
+    SSJAVA: while (i < 37) {
       @LOC("IMG") Image image = ImageReader.readImage("data/b" + i + ".bmp");
       i++;
       if (image == null) {
@@ -110,7 +109,7 @@ public class LEA {
 
   private void processImage(@LOC("IN") Image image) {
     @LOC("THIS,LEA.POS") FaceAndEyePosition positions = implementation.getEyePosition(image);
-    if (positions.getEyePosition() != null) {
+//    if (positions.getEyePosition() != null) {
       deviationScanner.addEyePosition(positions.getEyePosition());
       @LOC("THIS,LEA.DEV,DeviationScanner.DEV") int deviation =
           deviationScanner.scanForDeviation(positions.getFacePosition());// positions.getEyePosition().getDeviation(lastPositions.getEyePosition());
@@ -118,7 +117,7 @@ public class LEA {
         System.out.println("deviation=" + deviationScanner.toStringDeviation(deviation));
         // notifyEyeMovementListenerEyeMoved(deviation);
       }
-    }
+//    }
     lastPositions = positions;
   }
 
index bbdf2ba6ec036c7b60369858665da494dfb4f8c4..4b7fc10d89f6493e75aa5f8f7c54aee67733c963 100644 (file)
@@ -51,6 +51,8 @@ public class LEAImplementation {
       if (point != null) {
         eyePosition = new EyePosition(point, lastRectangle);
       }
+    } else {
+      lastRectangle = null;
     }
     System.out.println("eyePosition=" + eyePosition);