Cell class.
More...
#include <Cell.h>
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.
HexagonCells::CCell::CCell |
( |
void |
| ) |
|
Default constuctor.
Definition at line 8 of file Cell.cpp.
Constuctor.
- Parameters
-
imgSize | The image size |
cellIntApp | Cell interpolation approach (Ref. cell_int_app) |
Definition at line 13 of file Cell.cpp.
Constuctor.
- Parameters
-
img | The image |
cellIntApp | Cell interpolation approach (Ref. cell_int_app) |
Definition at line 18 of file Cell.cpp.
HexagonCells::CCell::CCell |
( |
double |
R | ) |
|
Constuctor.
- Parameters
-
Definition at line 25 of file Cell.cpp.
Constuctor.
- Parameters
-
imgSize | The image size |
R | Hexagon outer radius |
cellIntApp | Cell interpolation approach (Ref. cell_int_app) |
Definition at line 30 of file Cell.cpp.
Constuctor.
- Parameters
-
img | The image |
R | Hexagon outer radius |
cellIntApp | Cell interpolation approach (Ref. cell_int_app) |
Definition at line 35 of file Cell.cpp.
HexagonCells::CCell::~CCell |
( |
void |
| ) |
|
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
-
x | x-coordinate of a pixel in the image |
y | y-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.
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 |
int * HexagonCells::CCell::getNeighbourhood |
( |
int |
idx | ) |
|
Returns all 6 neighbouring cell indexs.
- Parameters
-
- 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.
int HexagonCells::CCell::getNeighbourIDX |
( |
int |
idx, |
|
|
int |
i |
|
) |
| |
Returns the neighbouring cell index.
- Parameters
-
idx | Cell index |
i | Cell neighbour index in range from 0 till 5, which corresponds to the neighbours depicted at Fig. 1.
Fig. 1
|
- Return values
-
Index | of the neighbouring cell |
-1 | If the neighbour is beyond the image borders |
Definition at line 112 of file Cell.cpp.
CvScalar HexagonCells::CCell::getVal |
( |
int |
idx | ) |
|
Returns the color of the specified cell.
- Parameters
-
- Returns
- Cell color
Definition at line 153 of file Cell.cpp.
void HexagonCells::CCell::setImage |
( |
Mat & |
img | ) |
|
(Re-) sets the image
- Parameters
-
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
-
Definition at line 89 of file Cell.cpp.
void HexagonCells::CCell::setLUT |
( |
Mat & |
LUT | ) |
|
|
inline |
void HexagonCells::CCell::setRadius |
( |
double |
R | ) |
|
(Re-) sets the hexagon outer radius
- Parameters
-
Definition at line 76 of file Cell.cpp.
The documentation for this class was generated from the following files: