#include <Filter2D.h>
Utility class for a two-dimensional filter.
| util::Filter2D::Filter2D |
( |
| ) |
|
Creates a new instance with an identity filter.
| util::Filter2D::Filter2D |
( |
double |
multiplier, |
|
|
std::vector< double > |
mask |
|
) |
| |
Creates a new instance with the given multiplier and mask values. To calculate the value all values are added with their weights from the mask and then the value is multiplied by the multiplier. The multiplier may be used to ensure the overall filter sum is equals one.
- Parameters
-
| multiplier | The multiplier |
| mask | The mask values |
| util::Filter2D::Filter2D |
( |
std::string const & |
mask_string, |
|
|
char |
delimiter |
|
) |
| |
Creates a new instance by parsing the specified mask string. Values are separated by the specified delimiter. Example: 'multiplier, m00, m01, m02, ..., m10, m11, m12, ..., mnn' as the mask string and ',' as the delimiter.
- Parameters
-
| mask_string | The string with the multiplier and the mask values to parse |
| delimiter | The delimiter used for the parsing |
| double util::Filter2D::Get |
( |
int |
x, |
|
|
int |
y |
|
) |
| const |
Gets the value in the mask at the specified position.
- Parameters
-
| x | The horizontal position |
| y | The vertical position |
- Returns
- The value
| double util::Filter2D::Get |
( |
int |
i | ) |
const |
Gets the value in the mask at the specified position.
- Parameters
-
- Returns
- The value
| int util::Filter2D::GetDimension |
( |
| ) |
const |
Gets the dimension of the mask.
- Returns
- The dimension
| double util::Filter2D::GetMultiplier |
( |
| ) |
const |
Gets the multiplier.
- Returns
- The multiplier
| int util::Filter2D::GetVicinity |
( |
| ) |
const |
Gets the vicinity of the mask. The vicinity is the based on the center and describes the maximum range of values around it in manhattan distance.
- Returns
- The vicinity
| void util::Filter2D::Normalize |
( |
| ) |
|
Normalizes the mask values. The multiplier is equals one afterwards.
The documentation for this class was generated from the following files: