1
$\begingroup$

I applied the kernel below to the picture for unsharp maskingOriginal picture

k = [-1 -1 -1; -1 8 -1; -1 -1 -1]

I got !enter image description here

Then I changed 8 to 14. And I got enter image description here How does kernel work for unsharp masking the original picture and what does exactly do the number in the middle ?

$\endgroup$
0
$\begingroup$

The first kernel that you gave,

$$ \left[ \begin{array}{ccc} -1 &&-1 &&-1 \\ -1 && 8 && -1 \\ -1 &&-1 &&-1 \end{array} \right] $$

is interpreted as follows: for each pixel in the image, take 8 times its value (hence the 8 in the center of the kernel) and then subtract the values of all the 8 neighboring pixels (hence all of the surrounding -1 values). This is a form of a highpass filter, which tends to accentuate edges.

Think about what you get if you were to run this kernel over a patch of a constant color. If the region has a uniform color, then it doesn't contain any edges. The kernel above would yield a value of zero when applied to a 3-by-3 pixel block that has the same color, which is desirable. Not only is the filter highpass, it also completely attenuates zero frequency, which is also good.

If you change the center value to 14 instead of 8, it no longer has the property where it will output zero when applied to a region of constant color. Essentially, the kernel will have a different spatial frequency response, which leads to the differences in the second output image.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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