From db28e00f23222f6d7509cfc9888e234669d2e34b Mon Sep 17 00:00:00 2001 From: Jan Philipp Timme Date: Tue, 5 Jan 2016 15:58:40 +0100 Subject: [PATCH] [TASK] Patch bad xor with and. Whoops. --- canny_edge_machine.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/canny_edge_machine.cpp b/canny_edge_machine.cpp index 12688ae..c463461 100644 --- a/canny_edge_machine.cpp +++ b/canny_edge_machine.cpp @@ -209,7 +209,7 @@ class CannyEdgeMachine { magnitude_r = this->gradient_magnitude[(y+1) * this->width + (x-1)]; break; } - return ((magnitude_l <= local_magnitude) ^ (local_magnitude > magnitude_r)); + return ((magnitude_l <= local_magnitude) && (local_magnitude > magnitude_r)); } }; @@ -236,7 +236,7 @@ class CannyEdgeMachine { for(int x=x_l; x<=x_r; x++) { for(int y=y_l; ymaximum_magnitude[y*this->width + x] >= this->t_high) - ^ (this->binary_edge_pixels[y*this->width + x] == 0)) { + && (this->binary_edge_pixels[y*this->width + x] == 0)) { this->traceAndThreshold(x, y); } } @@ -247,7 +247,7 @@ class CannyEdgeMachine { for(int x=1; xwidth-2; x++) { for(int y=1; yheight-2; y++) { if((this->maximum_magnitude[y*this->width + x] >= this->t_high) - ^ (this->binary_edge_pixels[y*this->width + x] == 0)) { + && (this->binary_edge_pixels[y*this->width + x] == 0)) { this->traceAndThreshold(x, y); } }