Main Page   Class Hierarchy   Alphabetical List   Compound List   Compound Members  

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

#include <OpponentColorLBP.h>

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

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

Detailed Description

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

OpponentColorLBP is an LBP variant for color images.

The difference between OC-LBP and its gray-scale correspondent is that in OC-LBP, the center pixel and the neighborhood can reside on separate color channels, hence the name. There are a total number of nine possible combinations, as both the center and the neighbors can be taken from three color channels (R,G,B). For illustration of the possible neighborhood settings for the case involving eight neighborhood samples, see the illustration below. In the figure, the color channel of the neighborhood center is lower case for clarity.

 RRR RRR RRR GGG GGG GGG BBB BBB BBB
 RrR RgR RbR GrG GgG GbG BrB BgB BbB
 RRR RRR RRR GGG GGG GGG BBB BBB BBB
 


Public Methods

 OpponentColorLBP (int centerChannel=0, int surroundChannel=0)
 Create a new OpponentColorLBP feature extractor/image transform with the given center and neighborhood color channels.

 ~OpponentColorLBP ()
int getValue (RGBColor< T > center, util::List< RGBColor< T > > &surrounding)
 Subclasses must implement this method to return a transformed value for a center pixel given a known circular neighborhood.

util::List< int > getFeatureVector (const util::Matrix< RGBColor< T > > &mat) throw (FeatureExtractionException&)
void setMapping (int *mapping, int maxVal)
 Set mapping.

void setMapping (LBPMapping::MappingType type)
 Set mapping.

void setChannels (int centerChannel, int surroundChannel)
 Set the center and surrounding color channels.

int getCenterChannel ()
 Get the color channel of the center pixel.

int getSurroundChannel ()
 Get the color channel of the neighborhood.


Member Function Documentation

template<class T>
int prapi::texture::OpponentColorLBP< T >::getValue RGBColor< T >    center,
util::List< RGBColor< T > > &    surrounding
[virtual]
 

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.

Parameters:
center  the value of the current center pixel
surrounding  the values of the surrounding pixels starting from horizontal x-axis direction (3 o'clock) and proceeding clockwise. The length of this list is equal to the number of samples set with the setSamples() method.
Returns:
a transformed value for the center pixel.

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


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.