BamBirds 2021
de.uniba.sme.bambirds.vision.VisionSling Class Reference
Collaboration diagram for de.uniba.sme.bambirds.vision.VisionSling:

Public Member Functions

 VisionSling (final BufferedImage img)
 
Rectangle findSlingshot ()
 

Public Attributes

String identifier = "lvl"
 

Private Member Functions

void convertToHSV ()
 
LinkedList< Rectangle > findSlingshot (Rectangle crop, int threshold, int minPoints, float pxPercentage)
 
int rgb2hsv (int rgb)
 

Private Attributes

BufferedImage image
 
boolean convertedToHSV = false
 
int _nHeight
 
int _nWidth
 
Rectangle sling = null
 

Static Private Attributes

static final Logger log = LogManager.getLogger(VisionSling.class)
 
static VisualDebugger DBG = new VisualDebugger("VisionSling")
 
static final boolean IGNORE_SV_VALUES = false
 

Constructor & Destructor Documentation

◆ VisionSling()

de.uniba.sme.bambirds.vision.VisionSling.VisionSling ( final BufferedImage  img)

Custom image processing to convert the RGB color space into HSV color space. Currently this class supports Slingshot extraction findSlingshot()

Parameters
imgScreenshot of the scene

Member Function Documentation

◆ findSlingshot() [1/2]

Rectangle de.uniba.sme.bambirds.vision.VisionSling.findSlingshot ( )

Runs image processing on the image to find the slingshot.

Returns
Bounding box of sling

◆ findSlingshot() [2/2]

LinkedList< Rectangle > de.uniba.sme.bambirds.vision.VisionSling.findSlingshot ( Rectangle  crop,
int  threshold,
int  minPoints,
float  pxPercentage 
)
private

Internal method to apply a two level hue threshold and pixel grouping. This method is called twice (two level). Use public function findSlingshot() instead.

Parameters
cropDon't use complete image but a clipped segment
thresholdHue value threshold (colors darken then threshold)
minPointsNumber of points to be at least in one bounding box
pxPercentagePixel to bounding box fill ration. (Sling has roughly half of it's px set)
Returns
Bounding box of slingshot

◆ rgb2hsv()

int de.uniba.sme.bambirds.vision.VisionSling.rgb2hsv ( int  rgb)
private

Color conversion RGB -> HSV

Parameters
rgbInteger value with last 24 bits containing all three colors
Returns
24 bit integer value with hue, saturation and value

The documentation for this class was generated from the following file: