今日看点程序员

Image Filtering

2017-02-05  本文已影响0人  Kulbear

You can find this article and source code at my GitHub

Three views of filtering


Example

Box filter

Given a 3-by-3 box filter in the graph below

We will be able to find the filtered image, and the result looks like below (right one).

We also have some other popular and useful filters.

Sobel filter

Vertical Sobel filter Horizontal Sobel filter

Now you may think that a Sobel filter can be used to find the edge in an image. And you are right. I have tried to merge two result images from the vertical and horizontal


Properties of linear filters

Linearity:

filter(f1 + f2) = filter(f1) + filter(f2)

Shift invariance: same behavior regardless of
pixel location

filter(shift(f)) = shift(filter(f))

Any linear, shift-invariant operator can be
represented as a convolution


Important filter: Gaussian

Weight contributions of neighboring pixels by nearness

Smoothing with Gaussian filter


Smoothing with Gaussian filter

Smoothing with box filter


Smoothing with box filter

A Gaussian filter can do this better since it keeps "more information" than a box filter by weighting contributions from neighbors.


Practical matters

How big should the filter be?

What about near the edge?

What is the size of the output?


Median filter

Comparison: salt and pepper noise

Have you seen the superior advantage of applying a mean filter?


Reference:

Computer Vision: Algorithms and Applications by Richard Szeliski.
CSCI 1430: Introduction to Computer Vision

Thanks for reading. If you find any mistake / typo in this blog, please don't hesitate to let me know, you can reach me by email: jyang7[at]ualberta.ca

上一篇下一篇

猜你喜欢

热点阅读