uk.ac.ed.inf.sdp2012.group7.vision
Class OrientationFinder

java.lang.Object
  extended by uk.ac.ed.inf.sdp2012.group7.vision.OrientationFinder

public class OrientationFinder
extends java.lang.Object

Get the robot's orientation

Author:
Dale Myers, Rado

Constructor Summary
OrientationFinder()
          A constructor
OrientationFinder(ThresholdsState thresholdsState)
          A constructor
 
Method Summary
 java.awt.Point findOrientation(java.util.ArrayList<java.awt.Point> pixels, java.awt.Point centroid)
          Terribly named Finds the farthest point on T away from centroid to use when calculating orientation
 double findOrientation(int robotX, int robotY, int greyX, int greyY)
          Fins the orientation Finds the orientation of a robot, given a list of the points contained within it's T-shape (in terms of a list of x coordinates and y coordinates), the mean x and y coordinates, and the image from which it was taken.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OrientationFinder

public OrientationFinder(ThresholdsState thresholdsState)
A constructor

Parameters:
thresholdsState -

OrientationFinder

public OrientationFinder()
A constructor

Method Detail

findOrientation

public double findOrientation(int robotX,
                              int robotY,
                              int greyX,
                              int greyY)
Fins the orientation Finds the orientation of a robot, given a list of the points contained within it's T-shape (in terms of a list of x coordinates and y coordinates), the mean x and y coordinates, and the image from which it was taken.

Parameters:
xpoints - The x-coordinates of the points contained within the T-shape.
ypoints - The y-coordinates of the points contained within the T-shape.
meanX - The mean x-point of the T.
meanY - The mean y-point of the T.
image - The image from which the points were taken.
showImage - A boolean flag - if true a line will be drawn showing the direction of orientation found.
Returns:
An orientation from -Pi to Pi degrees.
Throws:
NoAngleException

findOrientation

public java.awt.Point findOrientation(java.util.ArrayList<java.awt.Point> pixels,
                                      java.awt.Point centroid)
Terribly named Finds the farthest point on T away from centroid to use when calculating orientation

Parameters:
pixels - The points on the T
centroid - The robot centroid
Returns:
The farthest point