# Revision history [back]

### Sharpening image

Hi, i want to sharp an image and i am using the laplacian operator. I have the blurred image, compute the laplacian (the grayish image where is easy to see the boarder ) but when i add them i have a weird output. The image get worst. The same by subtraction..d you know why? Thank you

### Sharpening image

Hi, i want to sharp an image and i am using the laplacian operator. I have the blurred image, compute the laplacian (the grayish image where is easy to see the boarder ) but when i add them i have a weird output. The image get worst. The same by subtraction..d you know why? Thank you

this is how i compute the lalpacian..

#include "LaplacianZC.h"

LaplacianZC::LaplacianZC() : aperture(3) {}

void LaplacianZC::setAperture(int a)
{
aperture=a;
}

Mat LaplacianZC::computeLaplacian(const Mat& image)
{
Laplacian(image,laplace,CV_32F);

img=image.clone();

return laplace;
}

Mat LaplacianZC::getLaplacianImage(double scale)
{
if (scale <0)
{
double lapmin,lapmax;
minMaxLoc(laplace,&lapmin,&lapmax);
scale=127/max(-lapmin,lapmax);
}

Mat laplaceImage;
laplace.convertTo(laplaceImage,CV_8U,scale,128);

return laplaceImage;
}


here is my image C:\fakepath\blurred.png

and the laplacian C:\fakepath\laplacian.png

thanks

### Sharpening image

Hi, i want to sharp an image and i am using the laplacian operator. I have the blurred image, compute the laplacian (the grayish image where is easy to see the boarder ) but when i add them i have a weird output. The image get worst. The same by subtraction..d you know why? Thank you

this is how i compute the lalpacian..

#include "LaplacianZC.h"

LaplacianZC::LaplacianZC() : aperture(3) {}

void LaplacianZC::setAperture(int a)
{
aperture=a;
}

Mat LaplacianZC::computeLaplacian(const Mat& image)
{
Laplacian(image,laplace,CV_32F);

img=image.clone();

return laplace;
}

Mat LaplacianZC::getLaplacianImage(double scale)
{
if (scale <0)
{
double lapmin,lapmax;
minMaxLoc(laplace,&lapmin,&lapmax);
scale=127/max(-lapmin,lapmax);
}

Mat laplaceImage;
laplace.convertTo(laplaceImage,CV_8U,scale,128);

return laplaceImage;
}


here is my image C:\fakepath\blurred.png

and the laplacian C:\fakepath\laplacian.png

addWeighted(blurred,1,laplacian,1,0,output,-1);