[TASK] Finalize canny edge partials.

This commit is contained in:
Jan Philipp Timme 2016-01-05 17:40:14 +01:00
parent 3194a084e6
commit 998fbe3d2e
1 changed files with 6 additions and 1 deletions

View File

@ -175,7 +175,8 @@ class CannyEdgeMachine {
// //
// cos(pi/8) -sin(pi/8) // cos(pi/8) -sin(pi/8)
// sin(pi/8) cos(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 cosoct = cos(octangle);
double sinoct = sin(octangle); double sinoct = sin(octangle);
double neg_sinoct = -sinoct; double neg_sinoct = -sinoct;
@ -298,10 +299,14 @@ class CannyEdgeMachine {
}; };
void doSecondStep(void) { void doSecondStep(void) {
// Reset maximum_magnitude since it will be rebuilt here
for(int i=0; i<this->pixels; i++) this->maximum_magnitude[i] = 0;
this->filterLocalMaxima(); // uses t_low only this->filterLocalMaxima(); // uses t_low only
}; };
void doThirdStep(void) { void doThirdStep(void) {
// Reset binary_edge_pixels since they will be rebuilt here
for(int i=0; i<this->pixels; i++) this->binary_edge_pixels[i] = 0;
this->workLocalMaxima(); // uses t_low & t_high this->workLocalMaxima(); // uses t_low & t_high
this->showEdges(); this->showEdges();
}; };