- * TODO: This method could quite possible be tweaked so that face recognition - * would be much faster + * TODO: This method could quite possible be tweaked so that face recognition would be much faster * * @param image * the image to process * @param lastCoordinates * the last known coordinates or null if unknown - * @return an rectangle representing the actual face position on success or - * null if no face could be detected + * @return an rectangle representing the actual face position on success or null if no face could + * be detected */ - - - public Rectangle2D locateFaceRadial( Image smallImage, - Rectangle2D lastCoordinates) { - IntegralImageData imageData = new IntegralImageData(smallImage); - float originalImageFactor = 1; + public Rectangle2D locateFaceRadial(Image smallImage, Rectangle2D lastCoordinates) { + + IntegralImageData imageData = new IntegralImageData(smallImage); + float originalImageFactor = 1; if (lastCoordinates == null) { // if we don't have a last coordinate we just begin in the center - int smallImageMaxDimension = - Math.min(smallImage.getWidth(), smallImage.getHeight()); + int smallImageMaxDimension = Math.min(smallImage.getWidth(), smallImage.getHeight()); lastCoordinates = new Rectangle2D((smallImage.getWidth() - smallImageMaxDimension) / 2.0, (smallImage.getHeight() - smallImageMaxDimension) / 2.0, smallImageMaxDimension, @@ -79,27 +73,25 @@ public class ClassifierTree { (lastCoordinates.getHeight() * (1 / originalImageFactor))); } - float startFactor = (float) (lastCoordinates.getWidth() / 100.0f); + float startFactor = (float) (lastCoordinates.getWidth() / 100.0f); // first we calculate the maximum scale factor for our 200x200 image - float maxScaleFactor = - Math.min(imageData.getWidth() / 100f, imageData.getHeight() / 100f); + float maxScaleFactor = Math.min(imageData.getWidth() / 100f, imageData.getHeight() / 100f); // maxScaleFactor = 1.0f; // we simply won't recognize faces that are smaller than 40x40 px - float minScaleFactor = 0.5f; + float minScaleFactor = 0.5f; - float maxScaleDifference = - Math.max(Math.abs(maxScaleFactor - startFactor), Math.abs(minScaleFactor - startFactor)); + float maxScaleDifference = Math.max(Math.abs(maxScaleFactor - startFactor), Math.abs(minScaleFactor - startFactor)); // border for faceYes-possibility must be greater that that - float maxBorder = 0.999f; + float maxBorder = 0.999f; - int startPosX = (int) lastCoordinates.getX(); - int startPosY = (int) lastCoordinates.getX(); + int startPosX = (int) lastCoordinates.getX(); + int startPosY = (int) lastCoordinates.getX(); - int loopidx = 0; - TERMINATE: for ( float factorDiff = 0.0f; Math.abs(factorDiff) <= maxScaleDifference; factorDiff = + int loopidx = 0; + TERMINATE: for (float factorDiff = 0.0f; Math.abs(factorDiff) <= maxScaleDifference; factorDiff = (factorDiff + sgn(factorDiff) * 0.1f) * -1 // we alternate between // negative and positiv // factors @@ -109,50 +101,49 @@ public class ClassifierTree { return null; } - float factor = startFactor + factorDiff; + float factor = startFactor + factorDiff; if (factor > maxScaleFactor || factor < minScaleFactor) continue; // now we calculate the actualDimmension - int actualDimmension = (int) (100 * factor); - int maxX = imageData.getWidth() - actualDimmension; - int maxY = imageData.getHeight() - actualDimmension; + int actualDimmension = (int) (100 * factor); + int maxX = imageData.getWidth() - actualDimmension; + int maxY = imageData.getHeight() - actualDimmension; - int maxDiffX = Math.max(Math.abs(startPosX - maxX), startPosX); - int maxDiffY = Math.max(Math.abs(startPosY - maxY), startPosY); + int maxDiffX = Math.max(Math.abs(startPosX - maxX), startPosX); + int maxDiffY = Math.max(Math.abs(startPosY - maxY), startPosY); - int xidx = 0; - TERMINATE: for ( float xDiff = 0.1f; Math.abs(xDiff) <= maxDiffX; xDiff = + int xidx = 0; + TERMINATE: for (float xDiff = 0.1f; Math.abs(xDiff) <= maxDiffX; xDiff = (xDiff + sgn(xDiff) * 0.5f) * -1) { if (++xidx > 1000) { return null; } - int xPos = Math.round((float) (startPosX + xDiff)); + int xPos = Math.round((float) (startPosX + xDiff)); if (xPos < 0 || xPos > maxX) continue; - int yidx = 0; + int yidx = 0; // yLines: - TERMINATE: for ( float yDiff = 0.1f; Math.abs(yDiff) <= maxDiffY; yDiff = + TERMINATE: for (float yDiff = 0.1f; Math.abs(yDiff) <= maxDiffY; yDiff = (yDiff + sgn(yDiff) * 0.5f) * -1) { if (++yidx > 1000) { return null; } - int yPos = Math.round(startPosY + yDiff); + int yPos = Math.round(startPosY + yDiff); if (yPos < 0 || yPos > maxY) continue; // by now we should have a valid coordinate to process which we should // do now - boolean backToYLines = false; - for ( int idx = 0; idx < classifiers.length; ++idx) { - float borderline = - 0.8f + (idx / (classifiers.length - 1)) * (maxBorder - 0.8f); + boolean backToYLines = false; + for (int idx = 0; idx < classifiers.length; ++idx) { + float borderline = 0.8f + (idx / (classifiers.length - 1)) * (maxBorder - 0.8f); if (!classifiers[idx].classifyFace(imageData, factor, xPos, yPos, borderline)) { backToYLines = true; break; @@ -167,9 +158,8 @@ public class ClassifierTree { if (backToYLines) { continue; } - Rectangle2D faceRect = - new Rectangle2D(xPos * originalImageFactor, yPos * originalImageFactor, - actualDimmension * originalImageFactor, actualDimmension * originalImageFactor); + + Rectangle2D faceRect = new Rectangle2D(xPos * originalImageFactor, yPos * originalImageFactor, actualDimmension * originalImageFactor, actualDimmension * originalImageFactor); return faceRect; @@ -184,9 +174,7 @@ public class ClassifierTree { } - - - private static int sgn( float value) { + private static int sgn(float value) { return (value < 0 ? -1 : (value > 0 ? +1 : 1)); } diff --git a/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/DeviationScanner.java b/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/DeviationScanner.java index 4cc353e0..6da3f7e1 100644 --- a/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/DeviationScanner.java +++ b/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/DeviationScanner.java @@ -23,10 +23,8 @@ * @author Florian Frankenberger */ - public class DeviationScanner { - private EyePosition eyePositions[]; // LEFT_UP(+1, -1), UP(0, -1), RIGHT_UP(-1, -1), LEFT(+1, 0), NONE(0, 0), @@ -47,8 +45,7 @@ public class DeviationScanner { eyePositions = new EyePosition[3]; } - - public void addEyePosition( EyePosition eyePosition) { + public void addEyePosition(EyePosition eyePosition) { // for ( int i = 1; i < 3; i++) { // eyePositions[i - 1] = eyePositions[i]; @@ -60,24 +57,23 @@ public class DeviationScanner { } - // - - - public int scanForDeviation( Rectangle2D faceRect) { + // + + public int scanForDeviation(Rectangle2D faceRect) { - int deviation = NONE; + int deviation = NONE; - for ( int i = 0; i < 3; i++) { + for (int i = 0; i < 3; i++) { if (eyePositions[i] == null) { return deviation; } } - double deviationX = 0; - double deviationY = 0; + double deviationX = 0; + double deviationY = 0; - int lastIdx = -1; - for ( int i = 0; i < 3; ++i) { + int lastIdx = -1; + for (int i = 0; i < 3; ++i) { if (lastIdx != -1) { deviationX += (eyePositions[i].getX() - eyePositions[lastIdx].getX()); deviationY += (eyePositions[i].getY() - eyePositions[lastIdx].getY()); @@ -85,14 +81,14 @@ public class DeviationScanner { lastIdx = i; } - final double deviationPercentX = 0.04; - final double deviationPercentY = 0.04; + final double deviationPercentX = 0.04; + final double deviationPercentY = 0.04; deviationX /= faceRect.getWidth(); deviationY /= faceRect.getWidth(); - int deviationAbsoluteX = 0; - int deviationAbsoluteY = 0; + int deviationAbsoluteX = 0; + int deviationAbsoluteY = 0; if (deviationX > deviationPercentX) deviationAbsoluteX = 1; if (deviationX < -deviationPercentX) @@ -114,8 +110,7 @@ public class DeviationScanner { return deviation; } - - public int getDirectionFor( int directionX, int directionY) { + public int getDirectionFor(int directionX, int directionY) { if (directionX == +1 && directionY == -1) { return LEFT_UP; @@ -145,7 +140,7 @@ public class DeviationScanner { eyePositions = new EyePosition[3]; } - public String toStringDeviation( int dev) { + public String toStringDeviation(int dev) { if (dev == LEFT_UP) { return "LEFT_UP"; } else if (dev == UP) { diff --git a/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/DummyCaptureDevice.java b/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/DummyCaptureDevice.java index 699a620d..e035b650 100644 --- a/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/DummyCaptureDevice.java +++ b/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/DummyCaptureDevice.java @@ -15,38 +15,44 @@ import de.darkblue.lea.ifaces.ICaptureDevice; */ public class DummyCaptureDevice implements ICaptureDevice { - /** + /** * */ - public DummyCaptureDevice() { - // TODO Auto-generated constructor stub - } - - /* (non-Javadoc) - * @see de.darkblue.lea.ifaces.ICaptureDevice#close() - */ - @Override - public void close() { - } - - /* (non-Javadoc) - * @see de.darkblue.lea.ifaces.ICaptureDevice#getFrameRate() - */ - @Override - public int getFrameRate() { - return 15; - } - - /* (non-Javadoc) - * @see de.darkblue.lea.ifaces.ICaptureDevice#getImage() - */ - @Override - public BufferedImage getImage() { - BufferedImage image = new BufferedImage(640, 480, BufferedImage.TYPE_INT_RGB); - Graphics2D g2d = (Graphics2D)image.getGraphics(); - g2d.setColor(new Color(255, 255, 255)); - g2d.fillRect(0, 0, 639, 479); - return image; - } + public DummyCaptureDevice() { + // TODO Auto-generated constructor stub + } + + /* + * (non-Javadoc) + * + * @see de.darkblue.lea.ifaces.ICaptureDevice#close() + */ + @Override + public void close() { + } + + /* + * (non-Javadoc) + * + * @see de.darkblue.lea.ifaces.ICaptureDevice#getFrameRate() + */ + @Override + public int getFrameRate() { + return 15; + } + + /* + * (non-Javadoc) + * + * @see de.darkblue.lea.ifaces.ICaptureDevice#getImage() + */ + @Override + public BufferedImage getImage() { + BufferedImage image = new BufferedImage(640, 480, BufferedImage.TYPE_INT_RGB); + Graphics2D g2d = (Graphics2D) image.getGraphics(); + g2d.setColor(new Color(255, 255, 255)); + g2d.fillRect(0, 0, 639, 479); + return image; + } } diff --git a/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/EyeDetector.java b/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/EyeDetector.java index 11443ab5..d162bc0c 100644 --- a/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/EyeDetector.java +++ b/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/EyeDetector.java @@ -23,16 +23,14 @@ * @author Florian Frankenberger */ - class EyeDetector { - private int width; - + private int height; - + private int[] pixelBuffer; - + double percent; public EyeDetector(Image image, Rectangle2D faceRect) { @@ -57,18 +55,15 @@ class EyeDetector { } - public Point detectEye() { - Point eyePosition = null; - float brightness = 255f; - for ( int y = 0; y < height; ++y) { - for ( int x = 0; x < width; ++x) { - final int position = y * width + x; - final int[] color = - new int[] { (pixelBuffer[position] & 0xFF0000) >> 16, - (pixelBuffer[position] & 0x00FF00) >> 8, pixelBuffer[position] & 0x0000FF }; + Point eyePosition = null; + float brightness = 255f; + for (int y = 0; y < height; ++y) { + for (int x = 0; x < width; ++x) { + int position = y * width + x; + int[] color = new int[] { (pixelBuffer[position] & 0xFF0000) >> 16, (pixelBuffer[position] & 0x00FF00) >> 8, pixelBuffer[position] & 0x0000FF }; // System.out.println("("+x+","+y+")="+color[0]+" "+color[1]+" "+color[2]); - final float acBrightness = getBrightness(color); + float acBrightness = getBrightness(color); if (acBrightness < brightness) { eyePosition = new Point(x + (int) percent, y + (int) percent); @@ -80,10 +75,9 @@ class EyeDetector { return eyePosition; } - - private static float getBrightness( int[] color) { - int min = Math.min(Math.min(color[0], color[1]), color[2]); - int max = Math.max(Math.max(color[0], color[1]), color[2]); + private static float getBrightness(int[] color) { + int min = Math.min(Math.min(color[0], color[1]), color[2]); + int max = Math.max(Math.max(color[0], color[1]), color[2]); return 0.5f * (max + min); } diff --git a/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/EyePosition.java b/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/EyePosition.java index 500b0086..be45cee3 100644 --- a/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/EyePosition.java +++ b/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/EyePosition.java @@ -23,13 +23,12 @@ * @author Florian Frankenberger */ - public class EyePosition { - + private int x; - + private int y; - + private Rectangle2D faceRect; public EyePosition(Point p, Rectangle2D faceRect) { diff --git a/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/FaceAndEyePosition.java b/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/FaceAndEyePosition.java index cf24488e..e1d94503 100644 --- a/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/FaceAndEyePosition.java +++ b/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/FaceAndEyePosition.java @@ -23,12 +23,10 @@ * @author Florian Frankenberger */ - public class FaceAndEyePosition { - private Rectangle2D facePosition; - + private EyePosition eyePosition; public FaceAndEyePosition(Rectangle2D facePosition, EyePosition eyePosition) { diff --git a/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/ICaptureDevice.java b/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/ICaptureDevice.java index f050a978..2caa04a9 100644 --- a/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/ICaptureDevice.java +++ b/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/ICaptureDevice.java @@ -17,36 +17,34 @@ * along with LEA. If not, see . */ - import java.awt.image.BufferedImage; /** - * Describes a capture device. For now it is only tested - * with images in `640x480` at `RGB` or `YUV` color space. + * Describes a capture device. For now it is only tested with images in `640x480` at + * `RGB` or `YUV` color space. * * @author Florian Frankenberger */ public interface ICaptureDevice { - /** - * Returns the frame rate of the image source per second - * - * @return the frame rate (e.g. 15 = 15 frames per second) - */ - public int getFrameRate(); + /** + * Returns the frame rate of the image source per second + * + * @return the frame rate (e.g. 15 = 15 frames per second) + */ + public int getFrameRate(); + + /** + * Will be called a maximum of getFrameRate()-times in a second and returns the actual image of + * the capture device + * + * @return the actual image of the capture device + */ + public BufferedImage getImage(); + + /** + * LEA calls this when it cleans up. You should put your own cleanup code in here. + */ + public void close(); - /** - * Will be called a maximum of getFrameRate()-times in a second and returns - * the actual image of the capture device - * - * @return the actual image of the capture device - */ - public BufferedImage getImage(); - - /** - * LEA calls this when it cleans up. You should put your own cleanup code in here. - */ - public void close(); - - } diff --git a/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/Image.java b/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/Image.java index d91a7e4a..52453203 100644 --- a/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/Image.java +++ b/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/Image.java @@ -1,12 +1,10 @@ - public class Image { - int width; - + int height; - + int pixel[][]; public Image(int width, int height) { diff --git a/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/IntegralImageData.java b/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/IntegralImageData.java index d517a373..80d7782b 100644 --- a/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/IntegralImageData.java +++ b/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/IntegralImageData.java @@ -23,14 +23,12 @@ * @author Florian Frankenberger */ - public class IntegralImageData { - private long[][] integral; - + private int width; - + private int hegith; // private Dimension dimension; @@ -51,7 +49,7 @@ public class IntegralImageData { } - public long getIntegralAt( int x, int y) { + public long getIntegralAt(int x, int y) { return this.integral[x][y]; } @@ -63,4 +61,8 @@ public class IntegralImageData { return hegith; } + public String toString() { + super.toString(); + } + } diff --git a/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/LEA.java b/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/LEA.java index 48a15775..b3fda528 100644 --- a/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/LEA.java +++ b/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/LEA.java @@ -20,22 +20,19 @@ /** * This is the main class of LEA. *

- * It uses a face detection algorithm to find an a face within the provided - * image(s). Then it searches for the eye in a region where it most likely - * located and traces its position relative to the face and to the last known - * position. The movements are estimated by comparing more than one movement. If - * a movement is distinctly pointing to a direction it is recognized and all - * listeners get notified. + * It uses a face detection algorithm to find an a face within the provided image(s). Then it + * searches for the eye in a region where it most likely located and traces its position relative to + * the face and to the last known position. The movements are estimated by comparing more than one + * movement. If a movement is distinctly pointing to a direction it is recognized and all listeners + * get notified. *

* The notification is designed as observer pattern. You simply call - * `addEyeMovementListener(IEyeMovementListener)` to add an - * implementation of `IEyeMovementListener` to LEA. When a face is - * recognized/lost or whenever an eye movement is detected LEA will call the - * appropriate methods of the listener + * `addEyeMovementListener(IEyeMovementListener)` to add an implementation of + * `IEyeMovementListener` to LEA. When a face is recognized/lost or whenever an eye + * movement is detected LEA will call the appropriate methods of the listener *

- * LEA also needs an image source implementing the `ICaptureDevice`. - * One image source proxy to the `Java Media Framework` is included ( - * `JMFCaptureDevice`). + * LEA also needs an image source implementing the `ICaptureDevice`. One image source + * proxy to the `Java Media Framework` is included ( `JMFCaptureDevice`). *

* Example (for using LEA with `Java Media Framework`): *

@@ -43,22 +40,19 @@ * LEA lea = new LEA(new JMFCaptureDevice(), true); * *

- * This will start LEA with the first available JMF datasource with an extra - * status window showing if face/eye has been detected successfully. Please note - * that face detection needs about 2 seconds to find a face. After detection the - * following face detection is much faster. + * This will start LEA with the first available JMF datasource with an extra status window showing + * if face/eye has been detected successfully. Please note that face detection needs about 2 seconds + * to find a face. After detection the following face detection is much faster. * * @author Florian Frankenberger */ - public class LEA { - private LEAImplementation implementation; - + private FaceAndEyePosition lastPositions = new FaceAndEyePosition(null, null); - + private DeviationScanner deviationScanner = new DeviationScanner(); public LEA() { @@ -68,18 +62,17 @@ public class LEA { } /** - * Clears the internal movement buffer. If you just capture some of the eye - * movements you should call this every time you start recording the - * movements. Otherwise you may get notified for movements that took place - * BEFORE you started recording. + * Clears the internal movement buffer. If you just capture some of the eye movements you should + * call this every time you start recording the movements. Otherwise you may get notified for + * movements that took place BEFORE you started recording. */ public void clear() { // this.imageProcessor.clearDeviationScanner(); } /** - * @METHOD To test LEA with the first capture device from the - * `Java Media Framework` just start from here. + * @METHOD To test LEA with the first capture device from the `Java Media Framework` + * just start from here. * * @param args * @throws Exception @@ -89,13 +82,12 @@ public class LEA { lea.doRun(); } - public void doRun() { - int i = 0; + int i = 0; SSJAVA: while (true) { - Image image = ImageReader.getImage(); + Image image = ImageReader.getImage(); if (image == null) { break; } @@ -105,14 +97,12 @@ public class LEA { System.out.println("Done."); } - - private void processImage( Image image) { - FaceAndEyePosition positions = implementation.getEyePosition(image); + private void processImage(Image image) { + FaceAndEyePosition positions = implementation.getEyePosition(image); // if (positions.getEyePosition() != null) { deviationScanner.addEyePosition(positions.getEyePosition()); - int deviation = - deviationScanner.scanForDeviation(positions.getFacePosition());// positions.getEyePosition().getDeviation(lastPositions.getEyePosition()); + int deviation = deviationScanner.scanForDeviation(positions.getFacePosition());// positions.getEyePosition().getDeviation(lastPositions.getEyePosition()); if (deviation != DeviationScanner.NONE) { System.out.println("deviation=" + deviationScanner.toStringDeviation(deviation)); // notifyEyeMovementListenerEyeMoved(deviation); diff --git a/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/LEAImplementation.java b/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/LEAImplementation.java index 998cd69b..b9dc7d39 100644 --- a/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/LEAImplementation.java +++ b/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/LEAImplementation.java @@ -23,34 +23,28 @@ * @author Florian Frankenberger */ - public class LEAImplementation { - private ClassifierTree classifierTree; - private Rectangle2D lastRectangle; public LEAImplementation() { this.loadFaceData(); } - - - public FaceAndEyePosition getEyePosition( Image image) { + public FaceAndEyePosition getEyePosition(Image image) { if (image == null) return null; - Rectangle2D faceRect = - classifierTree.locateFaceRadial(image, lastRectangle); + Rectangle2D faceRect = classifierTree.locateFaceRadial(image, lastRectangle); if (faceRect.getWidth() > image.getWidth() || faceRect.getHeight() > image.getHeight()) { return null; } - EyePosition eyePosition = null; + EyePosition eyePosition = null; if (faceRect != null) { lastRectangle = faceRect; faceRect = null; - Point point = readEyes(image, lastRectangle); + Point point = readEyes(image, lastRectangle); if (point != null) { eyePosition = new EyePosition(point, lastRectangle); } @@ -62,10 +56,8 @@ public class LEAImplementation { return new FaceAndEyePosition(lastRectangle, eyePosition); } - - - private Point readEyes( Image image, Rectangle2D rect) { - EyeDetector ed = new EyeDetector(image, rect); + private Point readEyes(Image image, Rectangle2D rect) { + EyeDetector ed = new EyeDetector(image, rect); return ed.detectEye(); } @@ -74,8 +66,8 @@ public class LEAImplementation { } /** - * 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() { diff --git a/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/Point.java b/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/Point.java index beb0545f..a3b6c37c 100644 --- a/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/Point.java +++ b/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/Point.java @@ -1,9 +1,7 @@ - - public class Point { - public int x; - public int y; + public int x; + public int y; public Point(int x, int y) { this.x = x; @@ -12,9 +10,9 @@ public class Point { public Point() { } - - public String toString(){ - return "("+x+","+y+")"; + + public String toString() { + return "(" + x + "," + y + ")"; } } diff --git a/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/Rectangle2D.java b/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/Rectangle2D.java index e765e70c..ae538162 100644 --- a/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/Rectangle2D.java +++ b/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/Rectangle2D.java @@ -1,11 +1,9 @@ - - public class Rectangle2D { - double x; - double y; - double width; - double height; + double x; + double y; + double width; + double height; public Rectangle2D(double x, double y, double w, double h) { this.x = x; diff --git a/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/ScanArea.java b/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/ScanArea.java index abb581b0..62e9b4ae 100644 --- a/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/ScanArea.java +++ b/Robust/src/Benchmarks/SSJava/EyeTrackingInfer/ScanArea.java @@ -22,20 +22,17 @@ * @author Florian */ - public class ScanArea { - private Point fromPoint; - + private Point toPoint; - + private float size; /** - * Imagine you want to classify an image with 100px x 100px what would be the - * scanarea in this kind of image. That size gets automatically scalled to fit - * bigger images + * Imagine you want to classify an image with 100px x 100px what would be the scanarea in this + * kind of image. That size gets automatically scalled to fit bigger images * * @param fromPoint * @param toPoint @@ -57,23 +54,23 @@ public class ScanArea { this(new Point(fromX, fromY), new Point(fromX + width, fromY + height)); } - public int getFromX( float scaleFactor) { + public int getFromX(float scaleFactor) { return (int) (this.fromPoint.x * scaleFactor); } - public int getFromY( float scaleFactor) { + public int getFromY(float scaleFactor) { return (int) (this.fromPoint.y * scaleFactor); } - public int getToX( float scaleFactor) { + public int getToX(float scaleFactor) { return (int) (this.toPoint.x * scaleFactor); } - public int getToY( float scaleFactor) { + public int getToY(float scaleFactor) { return (int) (this.toPoint.y * scaleFactor); } - public int getSize( float scaleFactor) { + public int getSize(float scaleFactor) { return (int) (this.size * Math.pow(scaleFactor, 2)); } @@ -110,7 +107,7 @@ public class ScanArea { // } public String toString() { - String str = ""; + String str = ""; str += "fromPoint=(" + fromPoint.x + "," + fromPoint.y + ")"; str += "toPoint=(" + toPoint.x + "," + toPoint.y + ")"; str += "size=" + size; -- 2.17.1