Commit 3e61e09c669831724667bf9e2e1ab6ab1683b0af

Authored by Josh Klontz
1 parent 1e81251b

added ebif gabor convolution

Showing 1 changed file with 20 additions and 1 deletions
openbr/plugins/ebif.cpp
@@ -24,10 +24,26 @@ class EBIFTransform : public UntrainableTransform @@ -24,10 +24,26 @@ class EBIFTransform : public UntrainableTransform
24 BR_PROPERTY(int, N, 6) 24 BR_PROPERTY(int, N, 6)
25 BR_PROPERTY(int, M, 9) 25 BR_PROPERTY(int, M, 9)
26 26
  27 + Transform *gaborJet;
  28 +
  29 + void init()
  30 + {
  31 + QStringList thetas; // Orientations between 0 and pi
  32 + for (int m=0; m<M; m++)
  33 + thetas.append(QString::number(CV_PI*m/M));
  34 + gaborJet = make(QString("GaborJet([%1],[%2],[%3],[%4],[%5])").arg(
  35 + QString::number(5), // lambda = 5 (just one wavelength)
  36 + thetas.join(','), // M orientations between 0 and pi
  37 + QString::number(0), // psi = 0 (no offset)
  38 + QString::number(3), // sigma = 3 (just one width)
  39 + QString::number(1) // gamma = 1 (no skew)
  40 + ));
  41 + }
  42 +
27 void project(const Template &src, Template &dst) const 43 void project(const Template &src, Template &dst) const
28 { 44 {
29 // Compute the image pyramid 45 // Compute the image pyramid
30 - QList<Mat> scales; 46 + Template scales;
31 float scaleFactor = 1; 47 float scaleFactor = 1;
32 for (int n=0; n<N; n++) { 48 for (int n=0; n<N; n++) {
33 Mat scale; 49 Mat scale;
@@ -38,6 +54,9 @@ class EBIFTransform : public UntrainableTransform @@ -38,6 +54,9 @@ class EBIFTransform : public UntrainableTransform
38 scaleFactor /= sqrt(2.f); 54 scaleFactor /= sqrt(2.f);
39 } 55 }
40 56
  57 + // Perform gabor wavelet convolution on all scales
  58 + scales >> *gaborJet;
  59 +
41 (void) dst; 60 (void) dst;
42 } 61 }
43 }; 62 };