Hexagon Cell  v.1.1.1
HexagonCells::CCell Class Reference

Cell class. More...

#include <Cell.h>

Public Member Functions

 CCell (void)
 Default constuctor. More...
 
 CCell (CvSize imgSize, cell_int_app cellIntApp=CELL_AVG)
 Constuctor. More...
 
 CCell (Mat &img, cell_int_app cellIntApp=CELL_AVG)
 Constuctor. More...
 
 CCell (double R)
 Constuctor. More...
 
 CCell (CvSize imgSize, double R, cell_int_app cellIntApp=CELL_AVG)
 Constuctor. More...
 
 CCell (Mat &img, double R, cell_int_app cellIntApp=CELL_AVG)
 Constuctor. More...
 
 ~CCell (void)
 
void clear (void)
 Resets the class by releasing memory and setting the class variable by default. More...
 
void setImage (Mat &img)
 (Re-) sets the image More...
 
void setRadius (double R)
 (Re-) sets the hexagon outer radius More...
 
void setInterpolationApproach (cell_int_app cellIntApp)
 (Re-) sets the interpolation approach for cell color generation More...
 
cell_params getInfo (void)
 Returns the cell parameters. More...
 
int getIDX (int x, int y)
 Returns the cell index. More...
 
int getNeighbourIDX (int idx, int i)
 Returns the neighbouring cell index. More...
 
int * getNeighbourhood (int idx)
 Returns all 6 neighbouring cell indexs. More...
 
CvScalar getVal (int idx)
 Returns the color of the specified cell. More...
 
Mat getLUT (void)
 
void setLUT (Mat &LUT)
 

Friends

class CMarker
 

Detailed Description

Cell class.

Todo:

Optimize the calculate_LUT() function

Add sub-pixel accuracy support

Bug:
Images with resolution 640 x 480 pixels and cell radius R = 3.102 have an uncovered by cells regions at the right image edge.
Author
Sergey G. Kosov, serge.nosp@m.y.ko.nosp@m.sov@p.nosp@m.roje.nosp@m.ct-10.nosp@m..de

Definition at line 39 of file Cell.h.

Constructor & Destructor Documentation

HexagonCells::CCell::CCell ( void  )

Default constuctor.

Definition at line 8 of file Cell.cpp.

HexagonCells::CCell::CCell ( CvSize  imgSize,
cell_int_app  cellIntApp = CELL_AVG 
)

Constuctor.

Parameters
imgSizeThe image size
cellIntAppCell interpolation approach (Ref. cell_int_app)

Definition at line 13 of file Cell.cpp.

HexagonCells::CCell::CCell ( Mat &  img,
cell_int_app  cellIntApp = CELL_AVG 
)

Constuctor.

Parameters
imgThe image
cellIntAppCell interpolation approach (Ref. cell_int_app)

Definition at line 18 of file Cell.cpp.

HexagonCells::CCell::CCell ( double  R)

Constuctor.

Parameters
RHexagon outer radius

Definition at line 25 of file Cell.cpp.

HexagonCells::CCell::CCell ( CvSize  imgSize,
double  R,
cell_int_app  cellIntApp = CELL_AVG 
)

Constuctor.

Parameters
imgSizeThe image size
RHexagon outer radius
cellIntAppCell interpolation approach (Ref. cell_int_app)

Definition at line 30 of file Cell.cpp.

HexagonCells::CCell::CCell ( Mat &  img,
double  R,
cell_int_app  cellIntApp = CELL_AVG 
)

Constuctor.

Parameters
imgThe image
RHexagon outer radius
cellIntAppCell interpolation approach (Ref. cell_int_app)

Definition at line 35 of file Cell.cpp.

HexagonCells::CCell::~CCell ( void  )

Definition at line 42 of file Cell.cpp.

Member Function Documentation

void HexagonCells::CCell::clear ( void  )

Resets the class by releasing memory and setting the class variable by default.

Definition at line 49 of file Cell.cpp.

int HexagonCells::CCell::getIDX ( int  x,
int  y 
)

Returns the cell index.

Parameters
xx-coordinate of a pixel in the image
yy-coordinate of a pixel in the image
Returns
Index of the cell, to which the pixel belongs
Todo:
Maybe switch to the Point structure as an argument

Definition at line 107 of file Cell.cpp.

cell_params HexagonCells::CCell::getInfo ( void  )

Returns the cell parameters.

Returns
cell_params structure (Ref. cell_params)

Definition at line 95 of file Cell.cpp.

Mat HexagonCells::CCell::getLUT ( void  )
inline

Definition at line 140 of file Cell.h.

int * HexagonCells::CCell::getNeighbourhood ( int  idx)

Returns all 6 neighbouring cell indexs.

Parameters
idxCell index
Returns
Array of the neighbouring cell indexes. The length of the array is 6 and each elemet corresponds to neighbour, indexed according to the Fig. 1. from getNeighbourIDX . Neighbouring cell index may be equal to -1 if the neighbour is beyond the image borders.

Definition at line 146 of file Cell.cpp.

Here is the call graph for this function:

int HexagonCells::CCell::getNeighbourIDX ( int  idx,
int  i 
)

Returns the neighbouring cell index.

Parameters
idxCell index
iCell neighbour index in range from 0 till 5, which corresponds to the neighbours depicted at Fig. 1.
cell.jpg
Fig. 1
Return values
Indexof the neighbouring cell
-1If the neighbour is beyond the image borders

Definition at line 112 of file Cell.cpp.

Here is the caller graph for this function:

CvScalar HexagonCells::CCell::getVal ( int  idx)

Returns the color of the specified cell.

Parameters
idxCell index
Returns
Cell color

Definition at line 153 of file Cell.cpp.

void HexagonCells::CCell::setImage ( Mat &  img)

(Re-) sets the image

Parameters
imgThe image

Definition at line 60 of file Cell.cpp.

void HexagonCells::CCell::setInterpolationApproach ( cell_int_app  cellIntApp)

(Re-) sets the interpolation approach for cell color generation

Parameters
cellIntAppCell interpolation approach (Ref. cell_int_app)

Definition at line 89 of file Cell.cpp.

void HexagonCells::CCell::setLUT ( Mat &  LUT)
inline

Definition at line 141 of file Cell.h.

void HexagonCells::CCell::setRadius ( double  R)

(Re-) sets the hexagon outer radius

Parameters
RHexagon outer radius

Definition at line 76 of file Cell.cpp.

Friends And Related Function Documentation

friend class CMarker
friend

Definition at line 41 of file Cell.h.


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