[TASK] Switch around black/white for canny edge result.
This commit is contained in:
parent
db28e00f23
commit
6f70f12946
|
@ -261,9 +261,9 @@ class CannyEdgeMachine {
|
||||||
for(int y=0; y<this->height; y++) {
|
for(int y=0; y<this->height; y++) {
|
||||||
int pixel = this->binary_edge_pixels[y*this->width + x];
|
int pixel = this->binary_edge_pixels[y*this->width + x];
|
||||||
if(pixel > 0) {
|
if(pixel > 0) {
|
||||||
this->working_copy->getImage()->setPixel(x, y, white);
|
|
||||||
} else {
|
|
||||||
this->working_copy->getImage()->setPixel(x, y, black);
|
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() {
|
void work() {
|
||||||
this->reset();
|
this->reset();
|
||||||
this->doGaussBlur(this->filter_size);
|
this->doGaussBlur(this->filter_size); // uses filter_size
|
||||||
this->doGradiants();
|
this->doGradiants();
|
||||||
this->doGradiantMagnitude();
|
this->doGradiantMagnitude();
|
||||||
this->filterLocalMaxima();
|
// TODO: Checkpoint for 'before t_low changed'
|
||||||
this->workLocalMaxima();
|
this->filterLocalMaxima(); // uses t_low only
|
||||||
|
// TODO: Checkpoint for 'before t_high changed'
|
||||||
|
this->workLocalMaxima(); // uses t_low & t_high
|
||||||
this->showEdges();
|
this->showEdges();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue