Commit 785df5fc authored by Emmanuel Christophe's avatar Emmanuel Christophe
Browse files

BUG: finally fix spline wavelet bug (#380) that has been there forever

parent ee52fbec
......@@ -403,12 +403,17 @@ WaveletGenerator<Wavelet::SPLINE_BIORTHOGONAL_2_4>
{
static const double sqrt2 = ::vcl_sqrt(2.0);
coeff.clear();
coeff.push_back(0.);
coeff.push_back(0.);
coeff.push_back(0.);
coeff.push_back(0.);
coeff.push_back(-1.0 / 4.0 * sqrt2);
coeff.push_back(1.0 / 2.0 * sqrt2);
coeff.push_back(-1.0 / 4.0 * sqrt2);
coeff.push_back(0.);
coeff.push_back(0.);
coeff.resize(5);
coeff.resize(9);
}
/**
......@@ -457,6 +462,8 @@ WaveletGenerator<Wavelet::SPLINE_BIORTHOGONAL_4_4>
{
static const double sqrt2 = ::vcl_sqrt(2.0);
coeff.clear();
coeff.push_back(0.);
coeff.push_back(0.);
coeff.push_back(0.045635881557 * sqrt2);
coeff.push_back(-0.028771763114 * sqrt2);
coeff.push_back(-0.295635881557 * sqrt2);
......@@ -464,8 +471,6 @@ WaveletGenerator<Wavelet::SPLINE_BIORTHOGONAL_4_4>
coeff.push_back(-0.295635881557 * sqrt2);
coeff.push_back(-0.028771763114 * sqrt2);
coeff.push_back(0.045635881557 * sqrt2);
coeff.push_back(0.);
coeff.push_back(0.);
coeff.resize(9);
}
......
......@@ -141,7 +141,7 @@ WaveletOperatorBase<TMotherWaveletOperator, TPixel, VDimension, TAllocator>
coeff = highPassCoeff;
while (coeff[0] == coeff[coeff.size() - 1])
while ((coeff[0] == coeff[coeff.size() - 1]) && (coeff[0] == 0.0))
{
ReduceFilterLength(coeff);
}
......@@ -168,7 +168,7 @@ WaveletOperatorBase<TMotherWaveletOperator, TPixel, VDimension, TAllocator>
coeff = highPassCoeff;
while (coeff[0] == coeff[coeff.size() - 1])
while ((coeff[0] == coeff[coeff.size() - 1]) && (coeff[0] == 0.0))
{
assert(coeff.size() > 1);
ReduceFilterLength(coeff);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment