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

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

public class Plate
extends java.lang.Object

Finding rectangles around the green plate

Author:
Dale Myers

Constructor Summary
Plate()
           
 
Method Summary
 int dot(java.awt.Point a, java.awt.Point b)
          Dot product?
 java.awt.Point getCentroid(java.util.ArrayList<java.awt.Point> points)
          Get centroid of plate?
 java.awt.Point[] getCorners(java.util.ArrayList<java.awt.Point> points)
          Get the corners of a plate Use Dale's triangle method to get the corners of a plate
 boolean isInRectangle(java.awt.Point p, java.awt.Point[] points)
          Use the triangle stuff to generate rectangle
 boolean isPointInNotShitTriangle(java.awt.Point a, java.awt.Point b, java.awt.Point c, java.awt.Point p)
          Like Dale's but doesn't look too far Used for orientation finding so that we don't look off of green plate
 boolean isPointInTriangle(java.awt.Point a, java.awt.Point b, java.awt.Point c, java.awt.Point p)
          Dale's triangle Looks slightly further than it should to ensure it finds the farthest point
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Plate

public Plate()
Method Detail

getCorners

public java.awt.Point[] getCorners(java.util.ArrayList<java.awt.Point> points)
Get the corners of a plate Use Dale's triangle method to get the corners of a plate

Parameters:
points - The list of points that make up a plate
Returns:
The four corners of the plate

isPointInTriangle

public boolean isPointInTriangle(java.awt.Point a,
                                 java.awt.Point b,
                                 java.awt.Point c,
                                 java.awt.Point p)
Dale's triangle Looks slightly further than it should to ensure it finds the farthest point

Parameters:
a - One of the corners of triangle
b - One of the corners of triangle
c - One of the corners of triangle
p - The point to check if its in the triangle
Returns:
True if the points are in the triangle

isPointInNotShitTriangle

public boolean isPointInNotShitTriangle(java.awt.Point a,
                                        java.awt.Point b,
                                        java.awt.Point c,
                                        java.awt.Point p)
Like Dale's but doesn't look too far Used for orientation finding so that we don't look off of green plate

Parameters:
a - One of the corners of triangle
b - One of the corners of triangle
c - One of the corners of triangle
p - The point to check if its in the triangle
Returns:
True if in triangle

dot

public int dot(java.awt.Point a,
               java.awt.Point b)
Dot product?

Parameters:
a - One Point
b - One Point
Returns:
The value of the dot product

getCentroid

public java.awt.Point getCentroid(java.util.ArrayList<java.awt.Point> points)
Get centroid of plate?

Parameters:
points - The points that make up the plate
Returns:
The position of the centroid (Point)

isInRectangle

public boolean isInRectangle(java.awt.Point p,
                             java.awt.Point[] points)
Use the triangle stuff to generate rectangle

Parameters:
a - point p
array - of four points, forming a rectangle
Returns:
whether p is in the rectangle formed from the four points