465 views

Uploaded by pi194043

Basic concept and computation of Local Binary Pattern

save

- Uniform Local Binary Pattern and Spatial Histogram Computation
- Normalized convolution for image interpolation
- A linear channel filter
- ARM Neon Optimization for image interleaving and deinterleaving
- Fast 2D Separable Symmetric/Anti-Symmmetric Convolution
- Control Limited Adaptive Histogram Equalization for Image Enhancement
- Random Ferns for Patch Description
- Multi Class Logistic Regression Training and Testing
- Modified Canny Edge Detection
- polynomial approximation of a 2D signal
- Polynomial Approximation of 1D signal
- Embedded introduction
- Adaptive Skin Color Detector
- Exercise 1
- Java Programming Examples
- Embedded Controllers Using C and Arduino
- Week 1 - Project 1 - Basic Shapes
- ru,6
- Interface With ZKTeco
- pertemuan_2
- Idea of Project
- CAD
- Implementation of discrete hidden markov model for sequence classification in C++ using Eigen
- Markov chain implementation in C++ using Eigen
- Adaptive Skin Color Detector
- OpenVision Library Gaussian Mixture Model Implementation
- Continuous Emission Hidden Markov Model for sequence classification
- Dense optical flow expansion based on polynomial basis approximation
- Polynomial Approximation of 2D image patch -Part 2
- Multi Class Logistic Regression Training and Testing
- Compiling Native C/C++ library for Android
- Gaussian Multivariate Distribution -Part 1
- Modified Canny Edge Detection
- Tan and Triggs Illumination normalization
- C++ virtual functions and abstract class
- C++ static members and function
- Random Ferns for Patch Description
- Integral Image for Computation of Mean And Variance
- Embedded Systems Programming with ARM on Linux - Blinking LED
- C++ Inheritance
- Mean Shift Algorithm
- polynomial approximation of a 2D signal
- C++ Const,Volatile Type Qualifiers
- Polynomial Approximation of 1D signal
- Tako Mattik- Branes in pp-wave backgrounds
- SIKA-DS Turbine Flow Sensors
- Prisoner’s Dilemma- Program Equilibrium via Provability Logic
- Application of a transversely isotropic brittle rock mass model in roof support design
- Physics EMPA Hints and Tips (2)
- Q & A on Waldram Diagrams
- tp6713
- [Plano de Aula] Agamben, Spinoza e a Teologia-política
- Acta Ophth 2008 HRT Images
- 1-s2.0-S0963869504000271-main
- Las Imágenes Vectoriales
- Ondas y optica.docx
- plantas de tratamientos convencional.docx
- Field Test
- DEFINICIÓN DE ERROR ABSOLUTO Y RELATIVO.docx
- sntesis de las representaciones geogrficas
- Low Temperature Cracking of Asphalt Concrete Pavement
- Esfuerzos en Tornillos de Potencia
- Marching Cubes Doc
- Nanoteknologi
- Apostila.cad
- Mário Ferreira dos Santos - Filosofia e Cosmovisão 2-edicao
- Why Noise Criteria Are Necessary for Proper Siting of Wind Turbines
- BIE291 Lecture 19
- Einstein Mistakes Compressed
- programa de enseñanza para minivoleibol
- 07. Fundamentos I musica
- 2009 - Seiches and Harbor Oscillations (Chapter 9) - Rabinovich
- 016 Capitulo 8 Aparatos de Apoyo
- TEORÍA DE LA COMPACTACIÓN

You are on page 1of 8

Pi19404

January 18, 2014

Contents

Contents

Local Binary Pattern 3

2|8

In this article we will look at concept of Local Binary Pattern and computation of LBP image. 2D surface texture is characterize by spatial pattern and intensity/contrast. Spatial Pattern is affected by rotation,scale changes ,hence for a good texture description we require a rotation and scale invariant descriptor. Local binary pattern binarizes the local neighborhood of each pixel and builds a histogram on these binary neighborhood patterns. Let P be the number of neighborhood pixels and R the distance from the center pixel l and l be neighborhood pixel.

c p

A LBP number characterizes the local texture by assigning the binomial factor 2 for each sign sgn(l l )

P;R P P

LBPP;R

X

p

1

sgn(lp

=0

lc )2

lp

for p = 0 : : : P of radius R.

LBPP;R

P

features has 2 possible values.For P=8 we have a binary feature vector of length 256.

Patterns are classified as uniform and non uniform. Uniform pattern have single contigious regions of 0 and 1 while non uniform patterns do not.For example 01100000 is a uniform pattern while 01010000 is a example of non uniform pattern

3|8

we can see that there are 9 possible uniform pattern values 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 1 1 0 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 1 0 0 0 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 Now consider the effect of rotation on the feature vector. Rotating the image results in circular shift of values of feature vector. To encorporate rotational invariance we need to assign all possible rotation of a feature vector to a single LBP value For example all the below patterns 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 will be assigned to a single value. In the present article however we are not considering rotational invariant features Let us consider the implementation details of LBP If we only consider a 3x3 neighborhood we need to threshold the rectangular region about Another method would be to divide image into square blocks of size BxB.Instead of central pixel value we consider the mean value of pixels in the central block. Similariy instead of considering the single pixel value in the neighborhood we would consider the mean value of pixels in the block. All the pixels in the block are encoded with the same binary value 0 or 1.

4|8

to compute mean value over rectangular regions of image,integral images are used. output of lbp images for block size 1,2 and 8 is showing in figure 1

we can see that as block size increases,quantization effects can be seen and the information in the encoded image cannot be recognized.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

nclude "ImgFeatures/integralImage.h" ass LBPFeatures blic: LBPFeatures(){}; Mat image; vector<uchar> features; Mat mask; IntegralImage ix; //function to compute LBP image with block size 1 void compute(Mat image,Mat &dst) { uchar *ptr=image.data; image.copyTo(dst); uchar *optr=dst.data;

5|8

18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61

int width=image.cols; int height=image.rows; for(int i=1;i<height-1;i++) { for(int j=0;j<width-1;j++) { int center=(int)ptr[j+i*width]; unsigned char code=0; code|=((int)ptr[(j-1)+(i-1)*width] >=center)<<7 ; code|=((int)ptr[j+(i-1)*width] >=center)<<6 ; code|=((int)ptr[(j+1)+(i-1)*width] >=center)<<5 ; code|=((int)ptr[(j+1)+(i)*width] >=center)<<4 ; code|=((int)ptr[(j+1)+(i+1)*width] >=center)<<3 ; code|=((int)ptr[j+(i+1)*width] >=center)<<2 ; code|=((int)ptr[j-1+(i+1)*width] >=center)<<1 ; code|=((int)ptr[j-1+(i)*width] >=center)<<0 ; optr[j+i*width]=code; } } } //computing integral image for block void computeBlock(Mat image,Mat & dst,int block=2) { /computing integral image ix.compute(image); image.copyTo(dst); dst.setTo(cv::Scalar::all(0)); int width=image.cols; int height=image.rows; for(int i=block;i<height-block;i=i+block) { for(int j=block;j<width-block;j=j+block) { int x=i; int y=j; Rect r=Rect(j,i,block,block); //computing mean value of central block int meanv=ix.calcMean(r); int code=0; for(int k=0;k<8;k++) {

6|8

62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105

//offsets of neighbouring values switch(k) { case 0: y=i-block; x=j-block; break; case 1: y=i; x=j-block; break; case 2: y=i+block; x=j-block; break; case 3: y=i+block; x=j; break; case 4: y=i+block; x=j+block; break; case 5: y=i; x=j+block; break; case 6: y=i-block; x=j+block; break; case 7: y=i-block; x=j; break; default: break; } Rect r1=Rect(x,y,block,block); //computing mean value of neighbouring block int val=(int)ix.calcMean(r1); code|=(meanv >= val)<<(7-k); }

7|8

106 107 108 109 110 111 112 113 114 115 116

} }

Mat roi=dst(r); //setting value of all pixel in output //image to the encoded value for visualization roi.setTo(cv::Scalar::all(code));

the code for the same can be found in the git repo for OpenVisionLibrary https://github.com/pi19404/OpenVision/ in following files ImgFeatures/lbpfeatures.hpp and lbpFeatures.cpp files

8|8

- Uniform Local Binary Pattern and Spatial Histogram ComputationUploaded bypi194043
- Normalized convolution for image interpolationUploaded bypi194043
- A linear channel filterUploaded bypi194043
- ARM Neon Optimization for image interleaving and deinterleavingUploaded bypi194043
- Fast 2D Separable Symmetric/Anti-Symmmetric ConvolutionUploaded bypi194043
- Control Limited Adaptive Histogram Equalization for Image EnhancementUploaded bypi194043
- Random Ferns for Patch DescriptionUploaded bypi194043
- Multi Class Logistic Regression Training and TestingUploaded bypi194043
- Modified Canny Edge DetectionUploaded bypi194043
- polynomial approximation of a 2D signalUploaded bypi194043
- Polynomial Approximation of 1D signalUploaded bypi194043
- Embedded introductionUploaded byRaghu Reddy
- Adaptive Skin Color DetectorUploaded bypi194043
- Exercise 1Uploaded bytanmaya1991
- Java Programming ExamplesUploaded byPrince Blissful
- Embedded Controllers Using C and ArduinoUploaded bymihai_agape93
- Week 1 - Project 1 - Basic ShapesUploaded byBryan Brito
- ru,6Uploaded byNearLin
- Interface With ZKTecoUploaded byAnwar Ay
- pertemuan_2Uploaded byHery Nugroho
- Idea of ProjectUploaded byHanan Helal
- CADUploaded byAshwin Mahender

- Implementation of discrete hidden markov model for sequence classification in C++ using EigenUploaded bypi194043
- Markov chain implementation in C++ using EigenUploaded bypi194043
- Adaptive Skin Color DetectorUploaded bypi194043
- OpenVision Library Gaussian Mixture Model ImplementationUploaded bypi194043
- Continuous Emission Hidden Markov Model for sequence classificationUploaded bypi194043
- Dense optical flow expansion based on polynomial basis approximationUploaded bypi194043
- Polynomial Approximation of 2D image patch -Part 2Uploaded bypi194043
- Multi Class Logistic Regression Training and TestingUploaded bypi194043
- Compiling Native C/C++ library for AndroidUploaded bypi194043
- Gaussian Multivariate Distribution -Part 1Uploaded bypi194043
- Modified Canny Edge DetectionUploaded bypi194043
- Tan and Triggs Illumination normalizationUploaded bypi194043
- C++ virtual functions and abstract classUploaded bypi194043
- C++ static members and functionUploaded bypi194043
- Random Ferns for Patch DescriptionUploaded bypi194043
- Integral Image for Computation of Mean And VarianceUploaded bypi194043
- Embedded Systems Programming with ARM on Linux - Blinking LEDUploaded bypi194043
- C++ InheritanceUploaded bypi194043
- Mean Shift AlgorithmUploaded bypi194043
- polynomial approximation of a 2D signalUploaded bypi194043
- C++ Const,Volatile Type QualifiersUploaded bypi194043
- Polynomial Approximation of 1D signalUploaded bypi194043

- Tako Mattik- Branes in pp-wave backgroundsUploaded byJuazmant
- SIKA-DS Turbine Flow SensorsUploaded byFelipe Lessa
- Prisoner’s Dilemma- Program Equilibrium via Provability LogicUploaded bysuwailem
- Application of a transversely isotropic brittle rock mass model in roof support designUploaded bydafo407
- Physics EMPA Hints and Tips (2)Uploaded byblade995
- Q & A on Waldram DiagramsUploaded bycrainsnewyork
- tp6713Uploaded byRoberto Sanchez Zapata
- [Plano de Aula] Agamben, Spinoza e a Teologia-políticaUploaded byCarmel Ramos
- Acta Ophth 2008 HRT ImagesUploaded byPhilip McNelson
- 1-s2.0-S0963869504000271-mainUploaded byFelipe Arce
- Las Imágenes VectorialesUploaded byAnonymous cQr3uk
- Ondas y optica.docxUploaded byRose
- plantas de tratamientos convencional.docxUploaded bypirringui
- Field TestUploaded bykudupudinagesh
- DEFINICIÓN DE ERROR ABSOLUTO Y RELATIVO.docxUploaded byMax Santiago
- sntesis de las representaciones geogrficasUploaded byapi-254049815
- Low Temperature Cracking of Asphalt Concrete PavementUploaded byJorge Mauricio de Souza
- Esfuerzos en Tornillos de PotenciaUploaded byJohel Cl
- Marching Cubes DocUploaded bybonkieto1
- NanoteknologiUploaded bypradipta
- Apostila.cadUploaded byLuana Perpétuo
- Mário Ferreira dos Santos - Filosofia e Cosmovisão 2-edicaoUploaded byDaniel Laudari
- Why Noise Criteria Are Necessary for Proper Siting of Wind TurbinesUploaded bymoe146
- BIE291 Lecture 19Uploaded byLinas Vaitkus
- Einstein Mistakes CompressedUploaded bySergey Larin
- programa de enseñanza para minivoleibolUploaded byElvaPineda
- 07. Fundamentos I musicaUploaded byLoran Gutan
- 2009 - Seiches and Harbor Oscillations (Chapter 9) - RabinovichUploaded byflpbravo
- 016 Capitulo 8 Aparatos de ApoyoUploaded byLongino Montaño Rea
- TEORÍA DE LA COMPACTACIÓNUploaded byJuan Carlos Alvarado