camshiftKalman
 All Classes Files Functions Variables Enumerations Enumerator Macros
LBP.h
Go to the documentation of this file.
1 #ifndef LBP_H
2 #define LBP_H
3 
4 #include <opencv2/highgui/highgui.hpp>
5 #include <opencv/cv.hpp>
6 #include <opencv2/core/core.hpp>
7 
8 
9 using namespace cv;
10 
15 void getLBP(Mat &img);
16 
22 template <class T> T move(T val, int n)
23 {
24  const int N = sizeof(T)*8;
25  if(n > 0)
26  val = ((val<<n)|(val>>(N-n)));
27  if(n < 0){
28  n *= -1;
29  val = ((val>>n)|(val<<(N-n)));
30  }
31 
32  return val;
33 }
34 
39 template<class T> void printBinary(T val)
40 {
41  const int N = sizeof(T)*8;
42  unsigned char *bits = new unsigned char [N];
43  memset(bits, 0, sizeof(unsigned char)*N);
44  for(int i=0;i<N;i++){
45  bits[i] = val&1;
46  val = val >> 1;
47  }
48 
49  for(int i=N-1;i>=0;i--){
50  printf("%d", bits[i]);
51  if(i%4 == 0)
52  printf(" ");
53  }
54 
55  printf("\n");
56 }
57 
63 uchar minRotation(uchar &val);
64 
69 void getLBPRI(Mat &img);
70 
71 
72 #endif // LBP_H