#include <CircularLocalSampler.h>
Inheritance diagram for prapi::texture::CircularLocalSampler< T, U >:

"Circular neighborhood" is used to denote a situation where, instead of the traditional rectangular one, neighborhood pixels are defined to be the ones that lie at a certain distance from the center. The distance is also called "predicate". The number of samples at this distance and the predicate itself can be dynamically changed. In digital images, all pixels in a circular neighborhood do not necessarily match the pixel grid. Pixel values at these positions are obtained with bilinear interpolation or, if the interpolation flag is set to false, from the pixel nearest to the exact position.
Public Methods | |
| CircularLocalSampler (unsigned int samples, double predicate) | |
| Create a new CircularLocalSampler instance. | |
| CircularLocalSampler (unsigned int samples=8, unsigned int predicate=1, bool interpolated=true) | |
| Create a new CircularLocalSampler instance. | |
| virtual | ~CircularLocalSampler () |
| void | setPredicate (double p) |
| Set the predicate value. | |
| void | setPredicate (unsigned int p) |
| Set the predicate value, i.e. | |
| void | setPredicate (int p) |
| Set the predicate value. | |
| double | getPredicate (void) |
| Get the radius of the circular neighborhood. | |
| void | setInterpolated (bool intp) |
| Set the interpolation flag. | |
| bool | isInterpolated (void) |
| Get the interpolation flag. | |
| void | setSamples (unsigned int samples) |
| Set the number of samples in the circular neighborhood. | |
| unsigned int | getSamples () |
| Get the number of samples in the circular neighborhood. | |
| void | setNeighborhood (unsigned int samples, double predicate) |
| Set the parameters of the circular neighborhood. | |
| void | setNeighborhood (unsigned int samples, unsigned int predicate) |
| Set the parameters of the circular neighborhood. | |
| virtual T | getValue (U center, util::List< U > &surrounding) |
| Subclasses must implement this method to return a transformed value for a center pixel given a known circular neighborhood. | |
| virtual util::Matrix< T > | getTransformedImage (const util::Matrix< U > &mat) throw (ImageTransformException&) |
| Goes through each matrix pixel, calculates the neighborhood values using the defined sample count and predicate, either with or without interpolation. | |
| double | getStartAngle () const |
| Get the angle at which the first neighbor is located. | |
| void | setStartAngle (double angle) |
| Set the angle of the first neighbor point. | |
Protected Methods | |
| void | updatePoints (void) |
| Update the precalculated point value tables. | |
Protected Attributes | |
| double | _dPredicate |
| The current predicate (radius), i.e. | |
| unsigned int | _uiPredicate |
| The predicate rounded to the closest integer larger than _dPredicate. | |
| bool | _bInterpolated |
| The interpolation flag. | |
| unsigned int | _uiSamples |
| The number of samples in the local neighborhood. | |
| double | _dStartAngle |
| The angle of the first neighbor. | |
| prapi::graphics::Point< int > * | _pPoints |
| A precalculated table of interpolation points. | |
| prapi::graphics::Point< double > * | _pOffsets |
| A precalculated table of interpolation offsets. | |
| double * | _dpMultipliers |
| Precalculated values for interpolation multiplication. | |
|
||||||||||||||||
|
Create a new CircularLocalSampler instance. Make sure the compiler understands you are giving the predicate as a floating point value. Otherwise, it may have difficulties in detecting whether this or the other constructor should be used. Example: new CircularLocalSampler<int,int>(8,1.0);
|
|
||||||||||||||||||||
|
Create a new CircularLocalSampler instance. Make sure the compiler understands you are giving the predicate as an unsigned integer Otherwise, it may have difficulties in detecting whether this or the other constructor should be used. Example: new CircularLocalSampler<int,int>(8,1u);
|
|
|||||||||
|
Get the angle at which the first neighbor is located. Angle is represented as radians in counter-clockwise direction. The direction of the positive x axis is 0. This value defaults to 0. |
|
||||||||||
|
Goes through each matrix pixel, calculates the neighborhood values using the defined sample count and predicate, either with or without interpolation. For each neighborhood, calls getValue(U, List<U>&) and stores the returned value into the transformed matrix. The size of the resulting matrix is smaller than the input due to border effects. If you set the radius of the neighborhood to 3, the width and height of the result matrix will be 4 (=(3-1)*2) pixels smaller than those of the input.
Implements prapi::ImageTransform< T, U >. Reimplemented in prapi::texture::GeneralLBP< T >, and prapi::texture::LBP8. |
|
||||||||||||||||
|
Subclasses must implement this method to return a transformed value for a center pixel given a known circular neighborhood. The default implementation returns 0. This method is called for each pixel in an matrix from getTransformedImage(Matrix<U>&). For example, the local variance operator returns the variance of the values in surrounding. LBP, in turn, compares each value in surrounding to the value of the center pixel, and builds up a binary code that it then returns.
Reimplemented in prapi::texture::Contrast, prapi::texture::OpponentColorLBP< T >, and prapi::texture::Variance. |
|
||||||||||
|
Set the interpolation flag.
|
|
||||||||||||||||
|
Set the parameters of the circular neighborhood.
|
|
||||||||||||||||
|
Set the parameters of the circular neighborhood.
|
|
||||||||||
|
Set the predicate value. This will update the precalculated point table.
|
|
||||||||||
|
Set the predicate value, i.e. the radius of the neighborhood. This will update the precalculated point table. Example: sampler.setPredicate(3u);
|
|
||||||||||
|
Set the predicate value. This will update the precalculated point table. Example: sampler.setPredicate(3u);
|
|
||||||||||
|
Set the number of samples in the circular neighborhood. The precalculated point table will be updated. Reimplemented in prapi::texture::LBP8. |
|
|||||
|
The current predicate (radius), i.e. the distance of the neighborhood from its center. |