[TASK] Fix gauss filter not being centered.
This commit is contained in:
parent
e7b745c19a
commit
66e2ae8d30
|
@ -89,8 +89,10 @@ class CannyEdgeMachine {
|
||||||
double sum_weights = 0;
|
double sum_weights = 0;
|
||||||
std::cout << "Using gauss filter: " << std::endl;
|
std::cout << "Using gauss filter: " << std::endl;
|
||||||
for(int x=0; x<filter_width; x++) {
|
for(int x=0; x<filter_width; x++) {
|
||||||
|
int i = x - (filter_width/2);
|
||||||
for(int y=0; y<filter_width; y++) {
|
for(int y=0; y<filter_width; y++) {
|
||||||
filter[x*filter_width + y] = this->gauss(x, y, sigma);
|
int j = y - (filter_width/2);
|
||||||
|
filter[x*filter_width + y] = this->gauss(i, j, sigma);
|
||||||
sum_weights += filter[x*filter_width + y];
|
sum_weights += filter[x*filter_width + y];
|
||||||
std::cout << "(" << x << ", " << y << ") " << filter[x*filter_width + y] << " | ";
|
std::cout << "(" << x << ", " << y << ") " << filter[x*filter_width + y] << " | ";
|
||||||
}
|
}
|
||||||
|
|
|
@ -726,6 +726,9 @@ void ImageViewer::doUnsharpMasking(void) {
|
||||||
int gauss_width = usm_gauss_width->value();
|
int gauss_width = usm_gauss_width->value();
|
||||||
logFile << "Doing USM using gauss width of " << gauss_width << " and alpha of " << alpha << std::endl;
|
logFile << "Doing USM using gauss width of " << gauss_width << " and alpha of " << alpha << std::endl;
|
||||||
renewLogging();
|
renewLogging();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
updateImageDisplay();
|
updateImageDisplay();
|
||||||
}
|
}
|
||||||
/****************************************************************************************
|
/****************************************************************************************
|
||||||
|
|
Loading…
Reference in New Issue