4
$\begingroup$

In order to sharpen an image using Laplacian kernel, it should be convolved with the original image.

It is evident that the result might have negative values. I am not sure what to do with these values:

  1. Subtract the minimum from laplacian then map to [0, 255]
  2. Clip negative values to zero and map to [0, 255]
  3. Just clip negative values to zero

I know the next step is to add/subtract the laplacian to/from the original image and map to [0, 255] but I have doubts about the laplacian.

Indeed, I tested all three methods and 2, 3 got me to the right results but according to my Image Processing textbook, Laplacian should be scaled but it is not mentioned clearly that which version of laplacian is used to derive the sharpened image.

Thank you!

$\endgroup$

1 Answer 1

0
$\begingroup$

@SOFUser, Welcome to our community.

Since the High Pass Filter, such as the Laplacian Kernel, output has zero mean (As the DC Component is removed) it indeed can (Should) have negative values as the output oscillates around zero.

What to do with it depends on the objective:

  1. Display Purpose
    In case on wants to display the output of the Sharpening / HPF Filter process it is very common to add 50% gray to it. In case of 8 [Bit] image it means adding 127 / 128. This is what's don in Adobe Photoshop.
  2. Processing Purpose
    Usually we keep the negative values as they might be important in the next steps. For instance in Laplacian Pyramid if one won't keep the negative values the reconstruction won't be accurate. Another example would be sharpening where we add the output of the Laplacian Filter scaled by the sharpening factor to the image to have sharpened image.
  3. Generating Image
    If one wants to generate image and archive it in one of the UINT based formats (JPEG, PNG, etc...) usually one would clip data into the compatible range.
$\endgroup$
2
  • 1
    $\begingroup$ Thanks for your answer! So, in conclusion, if I'm trying a general-purpose, basic Laplacian sharpening algorithm in the spatial domain, I should clip the Laplacian filter result and then add it to the original image and scale to [0, 255] interval (8-bit grayscale image) ? $\endgroup$
    – SOFUser
    Commented Nov 4, 2019 at 19:13
  • $\begingroup$ Yep. Do the Laplacian, add it to the image (As is) and then clip the image into the valid range. $\endgroup$
    – Royi
    Commented Nov 5, 2019 at 5:42

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.