|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object uk.ac.ed.inf.sdp2012.group7.vision.Thresholding
public class Thresholding
Does fucking everything. Needs to be broken up
Constructor Summary | |
---|---|
Thresholding(ThresholdsState ts)
The constructor for the class |
Method Summary | |
---|---|
java.awt.Point |
fixParallax(java.awt.Point p,
MovingObject m)
Correct for parallax Take in a point and what object it belongs to and unparallax it |
java.awt.Point[] |
getBlueGreenPlate4Points()
Get the points that make of the green plate of the blue T |
java.awt.image.BufferedImage |
getThresh(java.awt.image.BufferedImage img,
int left,
int right,
int top,
int bottom)
Our do everything method Goes through every pixel, working out which object it should belong to, calculates positions etc |
java.awt.Point[] |
getYellowGreenPlate4Points()
Get the points that make of the green plate of the yellow T |
boolean |
isBlue(java.awt.Color c)
Check if a pixel is blue robot blue |
boolean |
isGreen(java.awt.Color c,
int GB,
int RG)
Check if part of green plate |
boolean |
isRed(java.awt.Color c,
int GB)
Check if a pixel is ball red |
boolean |
isYellow(java.awt.Color c)
Check if pixel is yellow robot |
void |
setCs(int x,
int y,
int right,
int left,
int top,
int bottom,
java.awt.image.BufferedImage img)
Does the connected component stuff Use a bastardised 8 connected component method, is supposed to have clustering tacked on to the end, but I just use it for reducing noise. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Thresholding(ThresholdsState ts)
ts
- A thresholdsstate object so we can initialise the thresholdsMethod Detail |
---|
public java.awt.image.BufferedImage getThresh(java.awt.image.BufferedImage img, int left, int right, int top, int bottom)
img
- The frame of videoleft
- Left boundary of pitchright
- Right boundary of pitchtop
- Top boundary of pitchbottom
- Bottom boundary of pitch
public java.awt.Point fixParallax(java.awt.Point p, MovingObject m)
p
- The point to correctm
- The object it belongs to, i.e. robot centroid, necessary so we can get height
public void setCs(int x, int y, int right, int left, int top, int bottom, java.awt.image.BufferedImage img)
x
- - x coordinate of pointy
- - y coordinate of pointright
- To check if we go out of bounds of pitchleft
- To check if we go out of bounds of pitchtop
- To check if we go out of bounds of pitchbottom
- To check if we go out of bounds of pitchimg
- To get the colour of the neighbouring pixelspublic boolean isBlue(java.awt.Color c)
c
- Colour to check
public boolean isRed(java.awt.Color c, int GB)
c
- - Colour to checkGB
- - Difference between green and blue channel
public boolean isGreen(java.awt.Color c, int GB, int RG)
c
- Colour to checkGB
- Difference in green and blue channelRG
- Difference in red and green channel
public boolean isYellow(java.awt.Color c)
c
- Colour to check
public java.awt.Point[] getBlueGreenPlate4Points()
public java.awt.Point[] getYellowGreenPlate4Points()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |