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); } }