This commit is contained in:
toni
2018-01-17 10:26:16 +01:00
67 changed files with 16100 additions and 2117 deletions

View File

@@ -3,6 +3,7 @@
#include <cmath>
#include <vector>
#include "Image2D.h"
#include "BoxSizes.h"
template <class T>
@@ -28,7 +29,7 @@ struct BoxGaus
{
BoxSizes<T> bsX(sigmaX, nFilt);
BoxSizes<T> bsY(sigmaY, nFilt);
std::vector<T> buffer(input.size());
std::vector<T> buffer(input.size());
assertMsg((2 * bsX.wl + 1 < w) && (2 * bsX.wl + 1 < h), "Box-Filter size in X direction is too big");
assertMsg((2 * bsX.wu + 1 < w) && (2 * bsX.wu + 1 < h), "Box-Filter size in X direction is too big");
@@ -89,7 +90,7 @@ private:
for (size_t j = 0; j <= r; j++)
{
val += src[ri] - fv;
dst[j + i*w] = val * iarr;
dst[i + j*w] = val * iarr;
ri += w;
ti += w;
@@ -99,7 +100,7 @@ private:
for (size_t j = r + 1; j < h - r; j++)
{
val += src[ri] - src[li];
dst[j + i*w] = val * iarr;
dst[i + j*w] = val * iarr;
li += w;
ri += w;
@@ -110,12 +111,14 @@ private:
for (size_t j = h - r; j < h; j++)
{
val += lv - src[li];
dst[j + i*w] = val * iarr;
dst[i + j*w] = val * iarr;
li += w;
ti += w;
}
}
int test = 0;
}
};

View File

@@ -174,7 +174,6 @@ struct Image2D : public ImageView2D<TValue>
assertMsg(data.size() == width*height, "Sizes must be the same");
this->values = values_vec.data();
}
std::vector<TValue>& data() { return values_vec; }
const std::vector<TValue>& data() const { return values_vec; }

View File

@@ -2,6 +2,9 @@
#include <chrono>
#include <string>
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
template <typename F>
static void benchmark(std::string name, size_t count, F&& lambda)
@@ -102,4 +105,4 @@ public:
lapTime = clock::now();
}
};
};