zadanie-5

This commit is contained in:
Patrycjusz Mania 2021-05-16 12:01:25 +02:00
parent c6daa832b7
commit 6bd761d4f1
2 changed files with 3 additions and 4 deletions

View File

@ -23,7 +23,7 @@ math::matrix<float> EdgeLaplaceOfGauss::getMask(int size, float sigma, Mode)
for (int i=0;i<size;++i) { for (int i=0;i<size;++i) {
for (int j=0;j<size;++j) { for (int j=0;j<size;++j) {
mask[i][j] = getLoG(i - (size/2.0), j - (size/2.0), sigma); mask(i,j) = getLoG(i - (size/2.0), j - (size/2.0), sigma);
} }
} }
@ -32,8 +32,7 @@ math::matrix<float> EdgeLaplaceOfGauss::getMask(int size, float sigma, Mode)
float EdgeLaplaceOfGauss::getLoG(int x, int y, float s) float EdgeLaplaceOfGauss::getLoG(int x, int y, float s)
{ {
float gauss = BlurGaussian::getGauss(x,y,s); return ((pow(x, 2) + pow(y, 2) - 2) * BlurGaussian::getGauss(x, y, s)) / pow(s, 2);
return ((pow(x,2.0) + pow(y,2.0) - 2) * gauss) / pow(s,2.0);
} }
int EdgeLaplaceOfGauss::getSize() int EdgeLaplaceOfGauss::getSize()

View File

@ -22,7 +22,7 @@ PNM* EdgeZeroCrossing::transform()
int t = getParameter("threshold").toInt(); int t = getParameter("threshold").toInt();
PNM* newImage = new PNM(width, height, image->format()); PNM* newImage = new PNM(width, height, image->format());
EdgeLaplaceOfGauss log(newImage); EdgeLaplaceOfGauss log(image);
log.setParameter("size", getParameter("size")); log.setParameter("size", getParameter("size"));
log.setParameter("sigma", getParameter("sigma")); log.setParameter("sigma", getParameter("sigma"));