40 std::vector<float> &mask) {
41 int width = src->
width();
42 int height = src->
height();
43 int len = mask.size();
45 for (
int y = 0; y < height; y++) {
46 for (
int x = 0; x < width; x++) {
47 float sum = mask[0] *
imRef(src, x, y);
48 for (
int i = 1; i < len; i++) {
50 (
imRef(src, std::max(x-i,0), y) +
51 imRef(src, std::min(x+i, width-1), y));
53 imRef(dst, y, x) = sum;
60 std::vector<float> &mask) {
61 int width = src->
width();
62 int height = src->
height();
63 int len = mask.size();
65 for (
int y = 0; y < height; y++) {
66 for (
int x = 0; x < width; x++) {
67 float sum = mask[0] *
imRef(src, x, y);
68 for (
int i = 1; i < len; i++) {
70 (
imRef(src, std::max(x-i,0), y) -
71 imRef(src, std::min(x+i, width-1), y));
73 imRef(dst, y, x) = sum;
static void convolve_odd(image< float > *src, image< float > *dst, std::vector< float > &mask)
static void convolve_even(image< float > *src, image< float > *dst, std::vector< float > &mask)
Class and structs in single-thread CPU bp implementation by Pedro Felzenwalb available at https://cs....