501 views

Uploaded by pi194043

This article describes use of random ferns for path description,classification and detection
by using a ensemble of random fern classifiers

save

- Normalized convolution for image interpolation
- Adaptive Skin Color Detector
- 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
- Distributions Binomial
- Multi Class Logistic Regression Training and Testing
- Local Binary Pattern
- Modified Canny Edge Detection
- polynomial approximation of a 2D signal
- Polynomial Approximation of 1D signal
- Quiz Bank-1
- MEX.pdf
- Mindtree Papers
- Simulation
- ALL UNITS
- Syllabus WQU603 Statistics
- Sumita Arora Classes and Objects Long Answer Questions
- Art_class.pdf
- MATLAB_Basics_3.pdf
- 2014_pdesoft_pymor
- 111 Math midterm.pdf
- Implementation of discrete hidden markov model for sequence classification in C++ using Eigen
- Markov chain implementation in C++ using Eigen
- 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
- Uniform Local Binary Pattern and Spatial Histogram Computation
- Tan and Triggs Illumination normalization
- C++ virtual functions and abstract class
- C++ static members and function
- Integral Image for Computation of Mean And Variance
- Embedded Systems Programming with ARM on Linux - Blinking LED
- C++ Inheritance
- Mean Shift Algorithm
- Local Binary Pattern
- polynomial approximation of a 2D signal
- C++ Const,Volatile Type Qualifiers
- Polynomial Approximation of 1D signal
- 3D0EDAD6d01
- Administración Del Tiempo Apuntes PDF
- 125ROW User Guide.pdf
- Graduacion de Presostato
- isearch
- Matematicas III
- PC-EE-003 Procedimiento de Montaje e Instalación de Tubería Conduit. Rev(2)
- Âncoras
- Partes Nicole
- Transistor de Union Bipolar
- Kx Clean Plus
- [Plano de Aula] Agamben, Spinoza e a Teologia-política
- Stabilization of Clay by using Wood Ash and Fly Ash
- 1-s2.0-S0963869504000271-main
- OPI28
- 1º Simulacro Tipo Admision Okkkkk
- IEEE paper
- Assignment motion in straight line
- CreatingStrongScreensforWaterBaseDischargeandPlastisolInksSpanish
- On the Contribution of the Scales of Mixing to the Oxygen
- Neyra, G. Tres casos rest. metales arqueológicos. 2010
- Origen y Evolucion Geologica de La Tierra
- Cuestionario 3a y 3b
- Network Topology, Cut Set and Loop Equation
- EDC Manual
- ece307
- PDF DS No1bis - Production d Un Son
- Informe Dinamica de Rotacion
- abbcvsvj
- CAP2_Faltas_simétricas

You are on page 1of 10

Pi19404

January 20, 2014

Contents

Contents

Random Ferns for patch description

0.1 Introduction . . 0.2 Implementation 0.3 Code . . . . . . . . References . . . . . . . . . . . . Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3

3 5 6 9

2 | 10

0.1 Introduction

Let us consider the problem of object recognition in which we have to decide if a given patch of image contains the desired object or not. One way to achieve this to characterize the texture about a key-points across images acquired under widely varying poses and lightning conditions. Due to its robustness to partial occlusions and computational efnAciency, recognition of image patches extracted around detected key-points is crucial for many vision problems. One way to achieve this is to compute a statistical model for the object/patch and then estimate if a given patch has a good probability of being sampled from the object model. Let us consider a mathematical representation of the patch to be classified by representing it in terms of a feature vector. Let

f

i = argmaxP (C = ci jf ) P (f jC = ci )P (C = ci ) = ci jf ) = P (f ) c i = argmaxP (f jC = ci )

c

P C

For real time application we require features that can be easily computed and encoded.The concept of Local Binary patterns has become popular for texture analysis and patch description due to it small memory and computational requirement.

In case of Local binary features each patch is described by a bit string. The value of each bit is derived by performing some binary test on the image patch

3 | 10

The tests can in principle be in any binary test that can effectively encode the information present in the patch as 0 or 1. Typically each binary feature is determined by performing intensity comparisons . The intensity comparisons can be between two different pixel locations or between image and transformed image at specified pixel location. A set of binary test constitutes the feature vector. However these features are very simple and hence a large number of such features may be required to accurately describe a patch. If we consider a joint probability distribution we would require to store 2N entries for each class.However if we assume independence between features using Naive Bayes assumption we are required to store N feature ,however this completely ignores any correlation between features. We consider a randomized fern algorithm,which consists of randomly selecting S features out of total pool of N features into single group. All the features with a group are considered to be dependent and a joint distribution is constructed over these features. Each group is called a fern and for each fern fk we can compute P (fk jC = ci ), Thus we have K random classifier that provide us the probability that feature vector fk belong to class P (fk jC = ci ). Here each fern is constructed from a random subset of S features.

Since each group contains S features and we are required to maintain a joint PDF we require 2S entries.And since there are M groups total entires required are M 2S .

F

The feature points used in binary tests are selected randomly from a normal distribution. The grouping of features points is also performed randomly. We will approximate the joint PDF using histogram.Each fern consists of S binary features

4 | 10

Since features are binary ,total number of bins the joint histogram are 2S For example for a fern with 2 features the histogram bins are indexed as 00,01,10,11.Each bin can be indexed by a integral value. During the training phase we need estimate the class conditional probabilities that require the estimation of 2S M parameters.

c

i = argmax

1

K

= 1K P (fk jC = ci )

(5) (6)

A important feature of this scheme of modelling does not require us to store the training data. Also we can perform incremental learning since we have to update only the counts in the statistical model.

The points where the features are computed are stored in 2D vector of length n umF erns 2 n umF eatures, this is stored in a vector where each element is of type P oint2f . As mentioned above to maintain a Joint PDF we have to maintain a joint histogram of 2n umF eatures and there are n umF erns groups.The data is stored in a single data structure of type std::vector. 3 such vectors are maintained positive,negative and posterior probability distribution. Each of the locations in the joint PDF can be addressed using a integer data type ie The feature vector extracted for each Fern/group is a integer data type. Whenever we learn a positive/negative sample,we increment the count corresponding to the bins indexed by the integer valued feature.Since feature vector is of length n umF erns the vectors are indexed as i n umI ndices + f eatures[i] where n umI ndices = 2n umF eatures i represents the fern and f eatures[i] represents integer feature value.

5 | 10

Thus to maintain histogram ,the bin indices corresponding to decimal equivalent to binary features are incremented. Positive vector is updated upon learning positive sample ,Negative vector is updated upon learning negative sample and Posteriors probability vector is updated after updating positive or negative samples and contains the confidence/probability that binary feature belongs to positive patch. Give a binary vector to compute probability that it represents a positive sample we just look at the posterior probabilities of each group P (Fk jC = ci ) and compute the average over all groups k = 1 : : :n umF erns.

0.3 Code

The code for the same can be found at git repo https://github. com/pi19404/OpenVision/ in I mgF eatures=randomf erns:cpp and I mgF eatures=randomf files Some important functions are also provided below class

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

RandomF erns

nclude "randomferms.h" give a feature vector of size M(number of ferms) we compute the output of ensemble classifier as average of individual classifiers oat RandomFerns::calcConfidence(vector<int> features) float conf=0.0; for(int i=0;i<features.size();i++) { //posterioir is a vector consisting of posterior probabilities of PDF //i*numIndices marks the start point of joint PDF of each fern conf=conf+posteriors[i*_numIndices+features[i]]; } return conf/(features.size());

while updating the posterior probabilities after updating the class histograms id RandomFerns::updatePosterior(vector<int> features,bool class1,int ammount)

6 | 10

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 62 63 64

for(int i=0;i<features.size();i++) { int arrayIndex=(i*_numIndices)+features[i]; class1?positive[arrayIndex]+=ammount:negatives[arrayIndex]+=ammount; //update the posterior posteriors[arrayIndex]=(((float)positive[arrayIndex]))/((float)positive[ } / writeToFile("/home/pi19404/config_oc.txt");

compute the location points for the binary tests for locations of ferns we select the points such that they lie at random locat in a rectangular ROI of size 1,the points are selected such that adjacent points will most likely not lie in the same quadrant random location of points as well as random selection of quadrant are used id RandomFerns::init() points.resize(_numFerns); int toggle=0; for(int i=0;i<_numFerns;i++) { vector<Point2f> px=points[i]; for(int j=0;j<2*_numFeatures;j++) { Point2f p; p.x=((float)std::rand())/(float)RAND_MAX; p.y=((float)std::rand())/(float)RAND_MAX; p.x=p.x/2; p.y=p.y/2; toggle=((float)std::rand())/(float)RAND_MAX; if(toggle<0.25) { p.x=0.5-p.x; p.y=0.5-p.y; } else if(toggle<0.5) { p.x=0.5+p.x;

7 | 10

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 106 107 108

p.y=0.5+p.y; } else if(toggle < 0.75) { p.x=0.5-p.x; p.y=0.5+p.y; } else if(toggle <1) { p.x=0.5+p.x; p.y=0.5-p.y; } px.push_back(p); toggle=!toggle; } points[i]=px;

function to compute fern feature for a rectangular region in the image ctor<int> RandomFerns::computeFeatures(const Rect r,const Mat image)

vector<int> features; features.resize(0); Mat roi=image(r); for(int i=0;i<points.size();i++) { int index=0; vector<Point2f> pp=points[i]; for(int j=0;j<pp.size();j=j+2) { index <<=1;

8 | 10

109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124

Point2f p=pp[j]*r.width; Point2f p1=pp[j+1]*r.height; uchar val1=roi.at<uchar>(p.x,p.y); uchar val2=roi.at<uchar>(p1.x,p1.y); if((int)val1 >(int)val2) { index|=1; } } } return features; features.push_back(index);

9 | 10

Bibliography

Bibliography

[1] Martin Godec et al. On-Line Random Naive Bayes for Tracking. In: ICPR. IEEE, 2010, pp. 35453548.

icpr2010.html#GodecLSB10.

[2]

Zdenek Kalal, Krystian Mikolajczyk, and Jiri Matas. Tracking-Learning-Detection. In: IEEE Transactions on Pattern Analysis and Machine Intelligence 34.7 (2012), pp. 14091422.

org/10.1109/TPAMI.2011.239.

[3]

issn:

0162-8828.

doi: http://doi.ieeecomputersociety.

Mustafa zuysal, Pascal Fua, and Vincent Lepetit. Fast keypoint recognition in ten lines of code. In: In Proc. IEEE Conference on Computing Vision and Pattern

Recognition.

2007.

10 | 10

- Normalized convolution for image interpolationUploaded bypi194043
- Adaptive Skin Color DetectorUploaded 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
- Distributions BinomialUploaded byboostoberoi
- Multi Class Logistic Regression Training and TestingUploaded bypi194043
- Local Binary PatternUploaded bypi194043
- Modified Canny Edge DetectionUploaded bypi194043
- polynomial approximation of a 2D signalUploaded bypi194043
- Polynomial Approximation of 1D signalUploaded bypi194043
- Quiz Bank-1Uploaded byRajvardhan Jain
- MEX.pdfUploaded byReza Vosoughi
- Mindtree PapersUploaded byChintha Venu
- SimulationUploaded byDarshit Jaju
- ALL UNITSUploaded byThangaselviGovindaraj
- Syllabus WQU603 StatisticsUploaded byganeshah1711
- Sumita Arora Classes and Objects Long Answer QuestionsUploaded byvaibhavmaan
- Art_class.pdfUploaded byPhạm Hữu Thạnh Đạt
- MATLAB_Basics_3.pdfUploaded byShweta Sridhar
- 2014_pdesoft_pymorUploaded bybrky
- 111 Math midterm.pdfUploaded byalamin018

- Implementation of discrete hidden markov model for sequence classification in C++ using EigenUploaded bypi194043
- Markov chain implementation in C++ using EigenUploaded 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
- Uniform Local Binary Pattern and Spatial Histogram ComputationUploaded bypi194043
- Tan and Triggs Illumination normalizationUploaded bypi194043
- C++ virtual functions and abstract classUploaded bypi194043
- C++ static members and functionUploaded 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
- Local Binary PatternUploaded bypi194043
- polynomial approximation of a 2D signalUploaded bypi194043
- C++ Const,Volatile Type QualifiersUploaded bypi194043
- Polynomial Approximation of 1D signalUploaded bypi194043

- 3D0EDAD6d01Uploaded byTamas Sovany
- Administración Del Tiempo Apuntes PDFUploaded byJOHN SMITH
- 125ROW User Guide.pdfUploaded byMi Lemus
- Graduacion de PresostatoUploaded byfriolarca
- isearchUploaded byapi-288622381
- Matematicas IIIUploaded byCristina Fernandez Vasquez
- PC-EE-003 Procedimiento de Montaje e Instalación de Tubería Conduit. Rev(2)Uploaded byChristian Alexander Almirón Alegre
- ÂncorasUploaded byEvandro Machado
- Partes NicoleUploaded byP.r. JHuber
- Transistor de Union BipolarUploaded byjahcastillo87
- Kx Clean PlusUploaded bynazeve
- [Plano de Aula] Agamben, Spinoza e a Teologia-políticaUploaded byCarmel Ramos
- Stabilization of Clay by using Wood Ash and Fly AshUploaded byInternational Journal for Scientific Research and Development - IJSRD
- 1-s2.0-S0963869504000271-mainUploaded byFelipe Arce
- OPI28Uploaded byLaura Garcia Couto
- 1º Simulacro Tipo Admision OkkkkkUploaded byElvis Jhoel Sosa Lozano
- IEEE paperUploaded byBhargav Bikkani
- Assignment motion in straight lineUploaded byPrateek Kapoor
- CreatingStrongScreensforWaterBaseDischargeandPlastisolInksSpanishUploaded byPepabu
- On the Contribution of the Scales of Mixing to the OxygenUploaded bylili100
- Neyra, G. Tres casos rest. metales arqueológicos. 2010Uploaded byTrinidad Pasíes Arqueología-Conservación
- Origen y Evolucion Geologica de La TierraUploaded byDiego Matus Vicente
- Cuestionario 3a y 3bUploaded byPedro Wilmar Guerrero Mahecha
- Network Topology, Cut Set and Loop EquationUploaded bySharanya Srinivasan
- EDC ManualUploaded byRahul Mahar
- ece307Uploaded byipuneetagg
- PDF DS No1bis - Production d Un SonUploaded byChhay Mab Mab Kousoum
- Informe Dinamica de RotacionUploaded bylucila saenz
- abbcvsvjUploaded byNitinSingh
- CAP2_Faltas_simétricasUploaded byLuis Eduardo