STIRA  0.1
Public Member Functions | Static Public Member Functions | List of all members
stira::filter::LocalBinaryPattern Class Reference

computes the Local Binary Pattern operation for each pixel in the image. More...

#include <LocalBinaryPattern.h>

Public Member Functions

 LocalBinaryPattern ()
 constructor
 
 ~LocalBinaryPattern ()
 destructor
 
 LocalBinaryPattern (ArrayGrid< double > *pGrid, double initAngle, double radius, int nrPoints)
 
 LocalBinaryPattern (ArrayGrid< double > *pGrid, double initAngle, double radius, int nrPoints, std::vector< common::Point< int > > vPointsOfInterest)
 
std::vector< bool > RunVector (int x, int y)
 computes LBP for circle around given central pixel More...
 
int RunCode (int x, int y)
 run method, gives a code number from vector with a sequence of true's and false's This number is computes as follows: sum_i ( 2^i * vectorElement[i] ) More...
 
histogram::FloatHistogramRunHistogram (int ID=0)
 computes a normalized histogram of the LBP pattern codes over the considered points
 
std::vector< common::Point< double > > GetSamplePoints ()
 Gets a vector with delta x anfd delta y's of the points around the central point on which the LBP is computed.
 
int SignComparison (double a, double b, double threshold, bool myType)
 compares two values and assigns a 0/1 or 0/1/2 depending on the type More...
 
int ComputePointGLDP (ArrayGrid< double > *pGridIn, int x, int y, double threshold, bool myType)
 
int ComputePointGLTP (ArrayGrid< double > *pGridIn, int x, int y, double threshold, bool myType)
 computes label for Geometric Textural Pattern with 36 neighborhood points in three rings around the central point More...
 
double ComputeJensenShannonDivergenceBetweenImagePatches (ArrayGrid< double > *pGridIn, int frameNr, int xTop1, int yTop1, int xBottom1, int yBottom1, int xTop2, int yTop2, int xBottom2, int yBottom2)
 computes Jensen-Shannon divergence between histograms of labels between two image patches The labels are computed using symmetric Locally Binary Pattern with 12 neighborhood points More...
 
histogram::FloatHistogram ComputePointLBPSymHistogram (ArrayGrid< double > *pGridIn, int frameNr, int topX, int topY, int bottomX, int bottomY, double threshold, bool myType)
 computes histogram of labels for symmetric Locally Binary Pattern with 12 neighborhood points for an image patche More...
 
ArrayGrid< int > * ComputeLBPSymImage (ArrayGrid< double > *pGridIn, double threshold, bool myType)
 computes image where each pixel shows the label for symmetric Locally Binary Pattern with 12 neighborhood points More...
 
int ComputePointLBPSym (ArrayGrid< double > *pGridIn, int x, int y, double threshold, bool myType)
 computes label for symmetric Locally Binary Pattern with 12 neighborhood points assigns a label to each image pixel depending on the pixel's environment
 

Static Public Member Functions

static ImageRunClassic (Image *pImageIn)
 computes classic Locally Binary Pattern filter for a whole image assigns a code to each image pixel depending on the pixel's environment More...
 

Detailed Description

computes the Local Binary Pattern operation for each pixel in the image.

The Local Binary Pattern is a pixel-wise value that encodes the local spatial neighborhood of a pixel into a single value; histograms of these values over the image provide information about the frequency of occurance of certain pixel configurations. Reference http://www.scholarpedia.org/article/Local_Binary_Patterns

Bibtex reference: article{ Ojala96LBP, author = {Ojala, T. and Pietik"{a}inen, M. and Harwood, D.}, title = {A comparative study of texture measures with classification based on featured distributions}, journal = {Pattern Recognition}, volume = {29}, number = {1}, pages = {51–59} year = {1996} } { OrjuelaDSP2011, author = {Orjuela-Vargas, S. and Quinones, R. and Ortiz-Jaramillo, B. and Rooms, F. and de Keyser, R. and Philips, W.}, title = {Improving Texture Discrimination in the Local Binary Patterns Technique by Using Symmetry and Group theory}, booktitle = {17th International Conference on Digital Signal Processing DSP 2011}, year = {2011} }

Two variants were proposed by Sergio Alejando Orjuela Vargas**

Member Function Documentation

double stira::filter::LocalBinaryPattern::ComputeJensenShannonDivergenceBetweenImagePatches ( ArrayGrid< double > *  pGridIn,
int  frameNr,
int  xTop1,
int  yTop1,
int  xBottom1,
int  yBottom1,
int  xTop2,
int  yTop2,
int  xBottom2,
int  yBottom2 
)

computes Jensen-Shannon divergence between histograms of labels between two image patches The labels are computed using symmetric Locally Binary Pattern with 12 neighborhood points

Parameters
pGridIninput image
frameNrframe ID of image being processed
xTop1x coordinate of the top left corner of image patch 1
yTop1y coordinate of the top left corner of image patch 1
xBottom1x coordinate of the bottom right corner of image patch 1
yBottom1y coordinate of the bottom right corner of image patch 1
xTop2x coordinate of the top left corner of image patch 2
yTop2y coordinate of the top left corner of image patch 2
xBottom2x coordinate of the bottom right corner of image patch 2
yBottom2y coordinate of the bottom right corner of image patch 2

References stira::histogram::FloatHistogram::ComputeJensenShannonMetric(), stira::imagedata::ArrayGrid< T >::GetHeight(), stira::imagedata::ArrayGrid< T >::GetWidth(), stira::imagedata::Image::SetColor(), stira::histogram::FloatHistogram::Write(), and stira::imagetools::ImageIO::WriteOpenCV().

ArrayGrid< int > * stira::filter::LocalBinaryPattern::ComputeLBPSymImage ( ArrayGrid< double > *  pGridIn,
double  threshold,
bool  myType 
)

computes image where each pixel shows the label for symmetric Locally Binary Pattern with 12 neighborhood points

Parameters
pGridIninput image
thresholdcomparison threshold
myTypewhether a binary or ternary comparison should be performed

References stira::imagedata::ArrayGrid< T >::GetHeight(), stira::imagedata::ArrayGrid< T >::GetWidth(), and stira::imagedata::ArrayGrid< T >::SetValue().

int stira::filter::LocalBinaryPattern::ComputePointGLTP ( ArrayGrid< double > *  pGridIn,
int  x,
int  y,
double  threshold,
bool  myType 
)

computes label for Geometric Textural Pattern with 36 neighborhood points in three rings around the central point

Parameters
pGridIninput image
xx coordinate of central point for which to compute label
yy coordinate of central point for which to compute label
thresholdcomparison threshold
myTypewhether a binary or ternary comparison should be performed

References stira::imagedata::ArrayGrid< T >::GetValue().

FloatHistogram stira::filter::LocalBinaryPattern::ComputePointLBPSymHistogram ( ArrayGrid< double > *  pGridIn,
int  frameNr,
int  topX,
int  topY,
int  bottomX,
int  bottomY,
double  threshold,
bool  myType 
)

computes histogram of labels for symmetric Locally Binary Pattern with 12 neighborhood points for an image patche

Parameters
pGridIninput image
frameNrframe ID of image being processed
topXx coordinate of the top left corner of image patch
topYy coordinate of the top left corner of image patch
bottomXx coordinate of the bottom right corner of image patch
bottomYy coordinate of the bottom right corner of image patch
thresholdcomparison threshold
myTypewhether a binary or ternary comparison should be performed

References stira::histogram::HistogramMaster< T >::AddDataPoint(), stira::common::MathUtils::ClipValue(), stira::imagedata::ArrayGrid< T >::GetHeight(), stira::imagedata::ArrayGrid< T >::GetWidth(), stira::histogram::FloatHistogram::Normalize(), and stira::imagetools::ImageIO::WriteOpenCV().

Image * stira::filter::LocalBinaryPattern::RunClassic ( Image pImageIn)
static
int stira::filter::LocalBinaryPattern::RunCode ( int  x,
int  y 
)

run method, gives a code number from vector with a sequence of true's and false's This number is computes as follows: sum_i ( 2^i * vectorElement[i] )

Parameters
xx coordinate of central pixel to compute LBP for
yy coordinate of central pixel to compute LBP for
Returns
number encoding the vector
std::vector< bool > stira::filter::LocalBinaryPattern::RunVector ( int  x,
int  y 
)

computes LBP for circle around given central pixel

Parameters
xx coordinate of central pixel to compute LBP for
yy coordinate of central pixel to compute LBP for
Returns
a vector with a sequence of true's (pixel value was larger than value of central pixel) and false's (pixel value was smaller)
int stira::filter::LocalBinaryPattern::SignComparison ( double  a,
double  b,
double  threshold,
bool  myType 
)

compares two values and assigns a 0/1 or 0/1/2 depending on the type

Parameters
afirst value in comparison
bsecond value in comparison
thresholdcomparison threshold
myTypewhether a binary or ternary comparison should be performed

References stira::common::MathUtils::ComputeIntegerPower(), and stira::imagedata::ArrayGrid< T >::GetValue().


The documentation for this class was generated from the following files: