Fawkes API  Fawkes Development Version
firevision::Shrinker Class Reference

Shrinker class to shrink ROIs. More...

#include <>>

Inheritance diagram for firevision::Shrinker:

Public Member Functions

 Shrinker ()
 Constructor. More...
 
virtual ~Shrinker ()
 Destructor. More...
 
virtual void setFilteredBuffer (unsigned char *yuv422planar_buffer)
 Set the filtered buffer. More...
 
virtual void shrink (ROI *roi)
 Shrink! Do the actual shrinking. More...
 

Protected Attributes

unsigned char * src
 Source image buffer. More...
 

Detailed Description

Shrinker class to shrink ROIs.

This shrinker shrinks a given ROI. This is done to cope with several special problems that arise in different setups. For example if playing downstairs in the lobby without a carpet we always have a problem with reflections on the floor.

This shrinker works like this:

  • if ROI is vertically rectangular, we cut off the bottom part because it is likely to contain reflection
  • if ball is not close (roi->width <= 100), we tighten the ROI, such that it only contains the ball. This helps against reflection. (If ball is close, this does not work, because it takes away too many edge pixels.)

Definition at line 34 of file shrinker.h.

Constructor & Destructor Documentation

◆ Shrinker()

firevision::Shrinker::Shrinker ( )

Constructor.

Definition at line 51 of file shrinker.cpp.

References src.

◆ ~Shrinker()

firevision::Shrinker::~Shrinker ( )
virtual

Destructor.

Definition at line 58 of file shrinker.cpp.

Member Function Documentation

◆ setFilteredBuffer()

void firevision::Shrinker::setFilteredBuffer ( unsigned char *  yuv422planar_buffer)
virtual

Set the filtered buffer.

The buffer is assumed to being YUV422_PLANAR mode and the desired filter combination has been run.

Parameters
yuv422planar_bufferYUV422 planar buffer

Definition at line 69 of file shrinker.cpp.

References src.

◆ shrink()

void firevision::Shrinker::shrink ( ROI roi)
virtual

Shrink! Do the actual shrinking.

See above for used method.

Parameters
roiROI to srhink

Reimplemented in firevision::BorderShrinker, and firevision::SquareShrinker.

Definition at line 79 of file shrinker.cpp.

References firevision::ROI::get_roi_buffer_start(), firevision::ROI::height, firevision::ROI::line_step, src, firevision::ROI::width, fawkes::upoint_t::x, and fawkes::upoint_t::y.

Member Data Documentation

◆ src

unsigned char* firevision::Shrinker::src
protected

Source image buffer.

Definition at line 46 of file shrinker.h.

Referenced by firevision::BorderShrinker::BorderShrinker(), setFilteredBuffer(), shrink(), and Shrinker().


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