
#include <Beobot/ImageSpring.H>
Inheritance diagram for ImageSpring< T >:


All the pixels are linked by springs whose stiffness depends on the difference between them
Definition at line 53 of file ImageSpring.H.
Public Member Functions | |
| ImageSpring (const int width, const int height, const int nbNeighbors) | |
| Constructor that only allocates memory for given size. | |
| ImageSpring () | |
| Constructor for uninitialized image (useful for arrays of Images). | |
| ImageSpring (const ImageSpring< T > &A) | |
| Copy constructor. | |
| void | init (const int width, const int height, const int nbNeighbors) |
| init function | |
| void | init (const T *a, const float *posX, const float *posY, const float **stiff, const int width, const int height, const int nbNeighbors) |
| init function, to copy another ImageSpring | |
| ~ImageSpring () | |
| Destructor. | |
| void | freeMem () |
| Free memory and switch to uninitialized state. | |
| void | initClustering (bool initPosMasses) |
| initialize 'stiff' and 'pos' | |
| void | computeStiff (void) |
| compute the stiffness of the spring between the masses | |
| void | computePos (const float dt) |
| updates the positions of the masses | |
| void | getStats (void) |
| computes mean and stdev (**heuristic**) | |
| void | getStatsDist (void) |
| computes meanDist and stdevDist (**heuristic**) | |
| void | getXY (const int index, Point2D< int > &pt) const |
| returns (X,Y) given an index=X+w*Y (see posX) | |
| void | getIndex (const Point2D< int > point, int &index) const |
| returns the index=X+w*Y (see posX) | |
| int | getNbNeighbors (void) const |
| returns the number of neighbors | |
| float | getDistanceMasses (const int index1, const int index2) const |
| distance between the 2 masses | |
| bool | getNeighbor (const int index, const int n, int &indexNeighbor) const |
| computes the index of the nth neighbor of "index" | |
| void | getPositions (Image< PixRGB< byte > > &img, const int zoom=16) |
| Get position of masses and strength of springs (for debug). | |
| void | getClusteredImage (const Image< PixRGB< byte > > &scene, Image< PixRGB< byte > > &clusteredImage, Point2D< int > &supposedTrackCentroid, const Point2D< int > &previousTrackCentroid) |
| get clustered image and track centroid position | |
|
||||||||||||||||||||
|
Constructor that only allocates memory for given size.
Definition at line 197 of file ImageSpring.H. References ImageSpring< T >::init(). |
|
|||||||||
|
Constructor for uninitialized image (useful for arrays of Images). Use init() later to initialize Definition at line 206 of file ImageSpring.H. |
|
||||||||||
|
Copy constructor.
Definition at line 211 of file ImageSpring.H. References ASSERT, Image< T >::getArrayPtr(), Image< T >::getHeight(), Image< T >::getWidth(), ImageSpring< T >::init(), Image< T >::initialized(), ImageSpring< T >::nbNeighbors, and ImageSpring< T >::stiff. |
|
|||||||||
|
Destructor.
Definition at line 222 of file ImageSpring.H. References ImageSpring< T >::freeMem(). |
|
||||||||||
|
updates the positions of the masses based on simple mechanics Definition at line 172 of file ImageSpring.C. References gamma(), Image< T >::getHeight(), ImageSpring< T >::getIndex(), ImageSpring< T >::getNeighbor(), Image< T >::getSize(), Image< T >::getWidth(), n, x, Y, and y. Referenced by BeobotVisualCortex::iterateSprings(). |
|
||||||||||
|
compute the stiffness of the spring between the masses based on the color-distance between pixels Definition at line 139 of file ImageSpring.C. References distance(), ImageSpring< T >::getNeighbor(), Image< T >::getSize(), Image< T >::getVal(), ImageSpring< T >::getXY(), and n. Referenced by ImageSpring< T >::initClustering(). |
|
|||||||||
|
Free memory and switch to uninitialized state.
Reimplemented from Image< T >. Definition at line 227 of file ImageSpring.H. References Image< T >::freeMem(), Image< T >::getSize(), and Dlist::index(). Referenced by ImageSpring< T >::init(), and ImageSpring< T >::~ImageSpring(). |
|
||||||||||||||||||||||||
|
get clustered image and track centroid position
Definition at line 289 of file ImageSpring.C. References drawCross(), Image< T >::getHeight(), Image< T >::getVal(), Image< T >::getWidth(), Point2D< T >::i, Point2D< T >::j, rutz::max(), NO_INIT, PixRGB< T >::set(), Image< T >::setVal(), sqrt(), squareOf(), x, y, and ZEROS. Referenced by BeobotVisualCortex::getClusteredImage(). |
|
||||||||||||||||
|
distance between the 2 masses
Definition at line 220 of file ImageSpring.C. References sqrt(), and squareOf(). |
|
||||||||||||||||
|
returns the index=X+w*Y (see posX)
Definition at line 293 of file ImageSpring.H. References Image< T >::getWidth(), Point2D< T >::i, and Point2D< T >::j. Referenced by ImageSpring< T >::computePos(), and ImageSpring< T >::getNeighbor(). |
|
||||||||||
|
returns the number of neighbors
Definition at line 351 of file ImageSpring.H. |
|
||||||||||||||||||||
|
computes the index of the nth neighbor of "index" returns true iif the neighbor is in the image Definition at line 298 of file ImageSpring.H. References ASSERT, Image< T >::coordsOk(), ImageSpring< T >::getIndex(), ImageSpring< T >::getXY(), Point2D< T >::i, Point2D< T >::j, and LFATAL. Referenced by ImageSpring< T >::computePos(), ImageSpring< T >::computeStiff(), ImageSpring< T >::getPositions(), and ImageSpring< T >::getStatsDist(). |
|
||||||||||||||||
|
Get position of masses and strength of springs (for debug).
Definition at line 225 of file ImageSpring.C. References drawDisk(), drawLine(), Image< T >::getHeight(), ImageSpring< T >::getNeighbor(), Image< T >::getSize(), i, n, and pp. Referenced by BeobotVisualCortex::getPositions(). |
|
||||||||||
|
computes mean and stdev (**heuristic**) this function is a heuristic because it will only consider nbHeuristic pixels at random Definition at line 57 of file ImageSpring.C. References ASSERT, Image< T >::getVal(), inplaceRectify(), inplaceSquare(), inverse(), n, randomUpToNotIncluding(), and sqrt(). Referenced by ImageSpring< T >::initClustering(). |
|
||||||||||
|
computes meanDist and stdevDist (**heuristic**) weight must be defined this function is an heuristic because it will only consider nbHeuristic pairs of pixels at random Definition at line 88 of file ImageSpring.C. References ASSERT, distance(), ImageSpring< T >::getNeighbor(), Image< T >::getVal(), n, randomUpToNotIncluding(), sqrt(), and squareOf(). Referenced by ImageSpring< T >::initClustering(). |
|
||||||||||||||||
|
returns (X,Y) given an index=X+w*Y (see posX)
Definition at line 288 of file ImageSpring.H. References Image< T >::getWidth(), Point2D< T >::i, and Point2D< T >::j. Referenced by ImageSpring< T >::computeStiff(), and ImageSpring< T >::getNeighbor(). |
|
||||||||||||||||||||||||||||||||||||
|
init function, to copy another ImageSpring
Definition at line 242 of file ImageSpring.H. References ImageSpring< T >::freeMem(), Image< T >::getSize(), Dlist::index(), Image< T >::resize(), and Image< T >::size(). |
|
||||||||||||||||||||
|
init function
Definition at line 270 of file ImageSpring.H. References ImageSpring< T >::freeMem(), Image< T >::getSize(), Dlist::index(), Image< T >::resize(), and Image< T >::size(). Referenced by ImageSpring< T >::ImageSpring(), and BeobotVisualCortex::init(). |
|
||||||||||
|
initialize 'stiff' and 'pos'
Definition at line 121 of file ImageSpring.C. References ImageSpring< T >::computeStiff(), Image< T >::getHeight(), ImageSpring< T >::getStats(), ImageSpring< T >::getStatsDist(), Image< T >::getWidth(), x, and y. Referenced by BeobotVisualCortex::initSprings(). |
1.4.4