How does image matrix filters work in matlab?

In summary: This means that the sharpening process will increase the contrast and make the image appear sharper and more defined. In summary, the process of sharpening an image involves using a highpass filter to increase contrast and reverse the blurring effect on an image caused by aberrations or other sources. This is achieved by subtracting light from neighboring pixels and adding it to the center pixel, resulting in a sharper and more defined image. However, the specifics of how this process works in MatLab are not provided.
  • #1
Addez123
199
21
I got an image called img and I want to sharpen the vertical spatial lines.

I created this matrix:
hp = [-3 -2 -1 12 -1 -2 -3];
hp= rot90(h_lowp);

Then I do this to get the new image:
newimg = uint8(conv2(single(hp), single(img)));

It SORTA works, but I'm not so sure why it works.
I mean all I do is multiply or substract neighbouring pixels, I don't see how that could do anything else but blur the image.
I understand how a blurring lowpass matrix works, but I don't see how a highpass filter would work.

Any one care to explain it in abit more detail?
 
Physics news on Phys.org
  • #2
I can't give you any details on how MatLab works, but the sharpening process in general attempts to reverse the blurring effect given by aberrations in the optical system or any other source of blurring. Blurring causes light that would be detected by a pixel to instead be detected by other nearby pixels. It essentially reduces the contrast of an image.

Sharpening compares the values of nearby pixels and increases the contrast by subtracting some amount of light from neighboring pixels and adding into the center pixel. Pixels with low values of brightness will only have a small amount of light added to them, while pixels with high values of brightness will have lots of light added to them. This makes sense given that when you blur a bright pixel you remove a lot of light from the pixel (compared to a small amount of light from a dim pixel) and spread it around.
 

Similar threads

Replies
4
Views
3K
Replies
1
Views
2K
Replies
13
Views
2K
Replies
2
Views
1K
Replies
1
Views
3K
Replies
7
Views
3K
Replies
2
Views
2K
Back
Top