Main Page   Class Hierarchy   Alphabetical List   Compound List   Compound Members  

prapi::texture::GeneralLBP< T > Class Template Reference

#include <LBP.h>

Inheritance diagram for prapi::texture::GeneralLBP< T >:

prapi::texture::LBPExtractor< T > prapi::texture::CircularLocalSampler< int, T > prapi::FeatureExtractor< int, util::Matrix< T > > prapi::ImageTransform< int, T > Object List of all members.

Detailed Description

template<class T = int>
class prapi::texture::GeneralLBP< T >

A general implementation of the LBP texture operator.

The template can be used with any bit count and predicate.


Public Types

enum  MappingType { MAP_UNIFORM, MAP_ROTMIN, MAP_UNIFORM_ROTMIN }
 Predefined mapping types. More...


Public Methods

 GeneralLBP (unsigned int samples=8u, unsigned int predicate=1u, bool interpolate=true)
 Create a new GeneralLBP instance.

 GeneralLBP (unsigned int samples, double predicate)
 Create a new GeneralLBP instance.

virtual ~GeneralLBP ()
util::List< int > getFeatureVector (const util::Matrix< T > &mat) throw (FeatureExtractionException&)
util::Matrix< int > getTransformedImage (const util::Matrix< T > &mat) throw (ImageTransformException&)
 Goes through each matrix pixel, calculates the neighborhood values using the defined sample count and predicate, either with or without interpolation.

void setMapping (int *mapping, int maxVal)
 Set the look-up table for pattern value mapping.

void setMapping (LBPMapping::MappingType type)
 Set the mapping to one of the predefined types.

void setMapping (MappingType type)
int getMaxValue () const
 Get the maximum value (+1) this LBP extractor will produce as a feature.

const int * getMapping () const
 Get the currently active mapping.

int * getMapping ()
 Get the currently active mapping.


Member Enumeration Documentation

template<class T = int>
enum prapi::texture::GeneralLBP::MappingType
 

Predefined mapping types.

Deprecated:
Use LBPMapping::MappingType instead


Constructor & Destructor Documentation

template<class T>
prapi::texture::GeneralLBP< T >::GeneralLBP unsigned int    samples = 8u,
unsigned int    predicate = 1u,
bool    interpolate = true
 

Create a new GeneralLBP instance.

Example:

 new GeneralLBP<>(16u,2u);
 
Parameters:
samples  the number of samples in the circular neighborhood
predicate  the sampling radius
interpolated  if true, bilinear interpolation is in use. Otherwise, nearest neighbor is used.

template<class T>
prapi::texture::GeneralLBP< T >::GeneralLBP unsigned int    samples,
double    predicate
 

Create a new GeneralLBP instance.

Example:

 new GeneralLBP<>(24u, 5.3);
 
Parameters:
samples  the number of samples in the circular neighborhood
predicate  the sampling radius


Member Function Documentation

template<class T = int>
int* prapi::texture::GeneralLBP< T >::getMapping   [inline]
 

Get the currently active mapping.

Returns:
the currently active mapping (2bits values) or NULL, if there is no mapping defined

template<class T = int>
const int* prapi::texture::GeneralLBP< T >::getMapping   const [inline]
 

Get the currently active mapping.

Returns:
the currently active mapping (2bits values) or NULL, if there is no mapping defined

template<class T = int>
int prapi::texture::GeneralLBP< T >::getMaxValue   const [inline]
 

Get the maximum value (+1) this LBP extractor will produce as a feature.

This value is determined either by the mapping or by the number of bits. The length of a feature vector produced by getFeatureVector(const Matrix&) equals to the returned value.

Returns:
the maximum value for a feature +1.

template<class T>
util::Matrix< int > prapi::texture::GeneralLBP< T >::getTransformedImage const util::Matrix< T > &    mat throw (ImageTransformException&) [virtual]
 

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.

Parameters:
mat  the input matrix
Returns:
the transformed matrix

Reimplemented from prapi::texture::CircularLocalSampler< int, T >.

template<class T>
void prapi::texture::GeneralLBP< T >::setMapping LBPMapping::MappingType    type
 

Set the mapping to one of the predefined types.

Parameters:
type  the mapping type

template<class T>
void prapi::texture::GeneralLBP< T >::setMapping int *    mapping,
int    maxVal
 

Set the look-up table for pattern value mapping.

Use setMapping(NULL,-1) to disable the mapping.

Parameters:
mapping  the look-up table. The size of this table must be equal to 2^samples integers. GeneralLBP takes up the ownership of the pointer, and deletes it upon destruction. If you want to keep a copy, make it explicitly.
maxVal  the maximum value this mapping will produce plus one


The documentation for this class was generated from the following file:
Documentation generated on 11.09.2003 with Doxygen.
The documentation is copyrighted material.
Copyright © Topi Mäenpää 2003. All rights reserved.