diff --git a/canny_edge_machine.cpp b/canny_edge_machine.cpp index 58c5e3c..d67de1b 100644 --- a/canny_edge_machine.cpp +++ b/canny_edge_machine.cpp @@ -175,7 +175,8 @@ class CannyEdgeMachine { // // cos(pi/8) -sin(pi/8) // sin(pi/8) cos(pi/8) - double octangle = 3.141592/8; // I know ... + // TODO: Move these somewhere else! + double octangle = M_PI/8; double cosoct = cos(octangle); double sinoct = sin(octangle); double neg_sinoct = -sinoct; @@ -298,10 +299,14 @@ class CannyEdgeMachine { }; void doSecondStep(void) { + // Reset maximum_magnitude since it will be rebuilt here + for(int i=0; ipixels; i++) this->maximum_magnitude[i] = 0; this->filterLocalMaxima(); // uses t_low only }; void doThirdStep(void) { + // Reset binary_edge_pixels since they will be rebuilt here + for(int i=0; ipixels; i++) this->binary_edge_pixels[i] = 0; this->workLocalMaxima(); // uses t_low & t_high this->showEdges(); };