diff --git a/canny_edge_machine.cpp b/canny_edge_machine.cpp index 2cd0506..00cd60f 100644 --- a/canny_edge_machine.cpp +++ b/canny_edge_machine.cpp @@ -81,12 +81,12 @@ class CannyEdgeMachine { } }; - void doGaussBlur(void) { - int filter_width = this->filter_size; - double sigma = this->filter_sigma; - // build the gauss filter + /** + * Do not forget to free the filter generated by this method! + */ + double* generateGaussFilter(int filter_width, double sigma, double& sum_weights) { double* filter = (double*) malloc(sizeof(double) * filter_width * filter_width); - double sum_weights = 0; + sum_weights = 0; std::cout << "Using gauss filter: " << std::endl; for(int x=0; xfilter_size; + // build the gauss filter + double sum_weights = 0.0; + double* filter = this->generateGaussFilter(this->filter_size, this->filter_sigma, sum_weights); + std::cout << sum_weights << std::endl; // apply gauss filter int filter_offset = (filter_width+1)/2; for(int x=(0+filter_offset); x<(this->width-filter_offset); x++) {