From 09c9390f424d7ba4e6e219601aa7f22e20406e9f Mon Sep 17 00:00:00 2001 From: Jan Philipp Timme Date: Sun, 20 Dec 2015 17:20:42 +0100 Subject: [PATCH] [TASK] Fix up the gauss filter weights. --- canny_edge_machine.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/canny_edge_machine.cpp b/canny_edge_machine.cpp index ccfbd59..464cf21 100644 --- a/canny_edge_machine.cpp +++ b/canny_edge_machine.cpp @@ -72,8 +72,13 @@ class CannyEdgeMachine { // build the gauss filter int* filter = (int*) malloc(sizeof(int) * filter_width* filter_width); int sum_weights = 0; - for(int i=0; i filter_middle) i = filter_middle - (x - filter_middle); + for(int y=0; y filter_middle) j = filter_middle - (y - filter_middle); filter[i*filter_width + j] = pow(2, i) * pow(2, j); sum_weights += filter[i*filter_width + j]; }