From 6f70f129466e8090828d09e826207ea1d15ebd9f Mon Sep 17 00:00:00 2001 From: Jan Philipp Timme Date: Tue, 5 Jan 2016 15:58:58 +0100 Subject: [PATCH] [TASK] Switch around black/white for canny edge result. --- canny_edge_machine.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/canny_edge_machine.cpp b/canny_edge_machine.cpp index c463461..68da4b1 100644 --- a/canny_edge_machine.cpp +++ b/canny_edge_machine.cpp @@ -261,9 +261,9 @@ class CannyEdgeMachine { for(int y=0; yheight; y++) { int pixel = this->binary_edge_pixels[y*this->width + x]; if(pixel > 0) { - this->working_copy->getImage()->setPixel(x, y, white); - } else { this->working_copy->getImage()->setPixel(x, y, black); + } else { + this->working_copy->getImage()->setPixel(x, y, white); } } } @@ -271,11 +271,13 @@ class CannyEdgeMachine { void work() { this->reset(); - this->doGaussBlur(this->filter_size); + this->doGaussBlur(this->filter_size); // uses filter_size this->doGradiants(); this->doGradiantMagnitude(); - this->filterLocalMaxima(); - this->workLocalMaxima(); + // TODO: Checkpoint for 'before t_low changed' + this->filterLocalMaxima(); // uses t_low only + // TODO: Checkpoint for 'before t_high changed' + this->workLocalMaxima(); // uses t_low & t_high this->showEdges(); };