From 998fbe3d2e13b0c8c8dd9e2c5300f6151328355b Mon Sep 17 00:00:00 2001 From: Jan Philipp Timme Date: Tue, 5 Jan 2016 17:40:14 +0100 Subject: [PATCH] [TASK] Finalize canny edge partials. --- canny_edge_machine.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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(); };