1 | #include <duchamp/ATrous/HaarFilter.hh> |
---|
2 | #include <duchamp/ATrous/Filter.hh> |
---|
3 | |
---|
4 | namespace duchamp { |
---|
5 | |
---|
6 | HaarFilter::HaarFilter(): |
---|
7 | Filter() |
---|
8 | { |
---|
9 | const unsigned int filtersize=3; |
---|
10 | double filter[filtersize] = {0., 1./2., 1./2.}; |
---|
11 | this->filter1D = std::vector<double>(filter,filter+filtersize); |
---|
12 | this->name = "B3 spline function"; |
---|
13 | |
---|
14 | const unsigned int size1D=6; |
---|
15 | this->maxNumScales[0] = size1D; |
---|
16 | double sigmaFactors1D[size1D+1] = |
---|
17 | {1.00000000000,7.07167810e-1,5.00000000e-1,3.53553391e-1, |
---|
18 | 2.50000000e-1,1.76776695e-1,1.25000000e-1}; |
---|
19 | |
---|
20 | const unsigned int size2D=6; |
---|
21 | this->maxNumScales[1] = size2D; |
---|
22 | double sigmaFactors2D[size2D+1] = |
---|
23 | {1.00000000000,4.33012702e-1,2.16506351e-1,1.08253175e-1, |
---|
24 | 5.41265877e-2,2.70632939e-2,1.35316469e-2}; |
---|
25 | |
---|
26 | const unsigned int size3D=8; |
---|
27 | this->maxNumScales[2] = size3D; |
---|
28 | double sigmaFactors3D[size3D+1] = |
---|
29 | {1.00000000000,9.35414347e-1,3.30718914e-1,1.16926793e-1, |
---|
30 | 4.13398642e-2,1.46158492e-2,5.16748303e-3,1.82698115e-3, |
---|
31 | 6.45935379e-44}; |
---|
32 | |
---|
33 | this->sigmaFactors[0] = new std::vector<double>(sigmaFactors1D,sigmaFactors1D+this->maxNumScales[0]); |
---|
34 | this->sigmaFactors[1] = new std::vector<double>(sigmaFactors2D,sigmaFactors2D+this->maxNumScales[1]); |
---|
35 | this->sigmaFactors[2] = new std::vector<double>(sigmaFactors3D,sigmaFactors3D+this->maxNumScales[2]); |
---|
36 | |
---|
37 | } |
---|
38 | |
---|
39 | HaarFilter::HaarFilter(const HaarFilter& other): |
---|
40 | Filter(other) |
---|
41 | { |
---|
42 | } |
---|
43 | |
---|
44 | HaarFilter& HaarFilter::operator= (const HaarFilter& other) |
---|
45 | { |
---|
46 | if(this == &other) return *this; |
---|
47 | ((Filter &) *this) = other; |
---|
48 | return *this; |
---|
49 | } |
---|
50 | |
---|
51 | } |
---|