STIRA
0.1
|
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::FloatHistogram * | RunHistogram (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 Image * | RunClassic (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... | |
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**
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
pGridIn | input image |
frameNr | frame ID of image being processed |
xTop1 | x coordinate of the top left corner of image patch 1 |
yTop1 | y coordinate of the top left corner of image patch 1 |
xBottom1 | x coordinate of the bottom right corner of image patch 1 |
yBottom1 | y coordinate of the bottom right corner of image patch 1 |
xTop2 | x coordinate of the top left corner of image patch 2 |
yTop2 | y coordinate of the top left corner of image patch 2 |
xBottom2 | x coordinate of the bottom right corner of image patch 2 |
yBottom2 | y 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
pGridIn | input image |
threshold | comparison threshold |
myType | whether 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
pGridIn | input image |
x | x coordinate of central point for which to compute label |
y | y coordinate of central point for which to compute label |
threshold | comparison threshold |
myType | whether 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
pGridIn | input image |
frameNr | frame ID of image being processed |
topX | x coordinate of the top left corner of image patch |
topY | y coordinate of the top left corner of image patch |
bottomX | x coordinate of the bottom right corner of image patch |
bottomY | y coordinate of the bottom right corner of image patch |
threshold | comparison threshold |
myType | whether 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().
computes classic Locally Binary Pattern filter for a whole image assigns a code to each image pixel depending on the pixel's environment
pImageIn | input image |
References stira::imagedata::Image::Clone(), stira::imagetools::ImageTools::CropBorder(), stira::imagedata::Image::GetBands(), stira::imagedata::Image::GetHeight(), stira::imagedata::Image::GetImageName(), stira::imagedata::Image::GetNumberOfBands(), stira::imagedata::ArrayGrid< T >::GetValue(), stira::imagedata::Image::GetWidth(), stira::imagetools::ImageTools::MirrorBorder(), stira::imagedata::Image::SetImageName(), and stira::imagedata::ArrayGrid< T >::SetValue().
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] )
x | x coordinate of central pixel to compute LBP for |
y | y coordinate of central pixel to compute LBP for |
std::vector< bool > stira::filter::LocalBinaryPattern::RunVector | ( | int | x, |
int | y | ||
) |
computes LBP for circle around given central pixel
x | x coordinate of central pixel to compute LBP for |
y | y coordinate of central pixel to compute LBP for |
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
a | first value in comparison |
b | second value in comparison |
threshold | comparison threshold |
myType | whether a binary or ternary comparison should be performed |
References stira::common::MathUtils::ComputeIntegerPower(), and stira::imagedata::ArrayGrid< T >::GetValue().