0
$\begingroup$

I am using 3 X 3 convolution matrix to obtain an sharpness image.

enter image description here

But the output result obtain from the above matrix is not much sharpen image. How to increase the sharpness of the image ?

Ya i am using same matrix.

common.getPixels(inputPath).then(function () {

sharp(inputPath)
            .png()

.convolve({
           width: 3,
           height: 3, 
           kernel: [0,-1,0,-1,5,-1,0,-1,0]         
          })

But the output generated is different. Need to get more sharpen image than the generated one.

enter image description here

$\endgroup$
1
  • 1
    $\begingroup$ Please include a sample of your image. The effectiveness of these filters depend on how sharp and noisy your original image is. An image sample will help others provide help. $\endgroup$
    – Juancho
    Commented Dec 27, 2018 at 14:33

1 Answer 1

1
$\begingroup$

Probably you are doing something wrong.

Below few lines of matlab code demonstrates the filter kernel you have provided which improves the sharpness of an example image. Note that the kernel is a highpass filter and usually (but not always) highpass filters are used to improve sharpness of typical images...

I  = im2double(imread('Cameraman.tif'));
h2 = [0,-1,0;-1,5,-1;0,-1,0];
I2 = conv2(I,h2);
figure,imshow(I);title('original image')
figure,imshow(I2);title('Sharpened image');

with the result:

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.