IDL 图像处理第8讲

发布时间:2024-11-18

IDL 图像处理第8讲

Lecture 8: Image Enhancement and Spatial Filtering IIHarvey Rhody Chester F. Carlson Center for Imaging Science Rochester Institute of Technology rhody@cis.rit.edu October 4, 2005 Abstract Both linear and nonlinear spatial ltering techniques are employed for important processing tasks. The design and performance of various techniques are compared by examples.

DIP Lecture 8

IDL 图像处理第8讲

Median FiltersMedian lters may be used when the objective is to achieve noise reduction with a minimum amount of blurring. A median lter replaces the pixel at the center of a mask with the median of the set of pixels under the mask. Median lters are in the class of order lters. These are nonlinear lters. The eect of a median lter on a noisy step edge (right) is compared with the eect of a smoothing lter (left). Note that the smoothing lter tends to distort the edge transition.

DIP Lecture 8

1

IDL 图像处理第8讲

Median FiltersMedian lters are most eective against impulse (salt& pepper) noise. Shown below is an impulse doublet on a background of small random values. The smoothing lters tend to smear and lower the pulses. The median lter with N=3 is ineective on doublets. The median lter with N=5 removes doublets.

DIP Lecture 8

2

IDL 图像处理第8讲

Median FiltersA comparison of the performance of median lters on salt and pepper noise is illustrated in the images below.

Original

Original with Noise

N=3 Median Filter

N=5 Median Filter

DIP Lecture 8

3

IDL 图像处理第8讲

Sharpening FiltersSharpening is used to highlight ne detail or enhance detail that has been blurred. A sharpening lter seeks to emphasize changes. The classic mask for a sharpening lter is the mask shown below. -1 1 W= -1 9 -1 -1 8 -1 -1 -1 -1

When the mask is over a region of uniform brightness it has zero output. It has maximum output when the center pixel diers signicantly from the surrounding pixels.

DIP Lecture 8

4

IDL 图像处理第8讲

Sharpening FilterThe eect on the logging camp image is shown below. Note that uniform regions, whether dark or light, have minimum response.

Original

After sharpening lter

After rectication

DIP Lecture 8

5

IDL 图像处理第8讲

Frequency Response of Sharpening FiltersThe frequency response of a sharpening lter depends upon the size of the lter. A larger lter will generally have a sharper response. -1 -1 -1 1 49× -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 48 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1

-1 1 9× -1 -1

-1 8 -1

-1 -1 -1

-1 -1 1 25× -1 -1 -1

-1 -1 -1 -1 -1

-1 -1 24 -1 -1

DIP Lecture 8

6

IDL 图像处理第8讲

Frequency Response of Sharpening Filters

M=3

M=5

M=7

M=9

DIP Lecture 8

7

IDL 图像处理第8讲

Frequency Response of Sharpening FiltersThe frequency response along a slice through the origin in the frequency plane is shown below for several values of M.

DIP Lecture 8

8

IDL 图像处理第8讲

High-Boost FiltersA highpass ltered image can be computed as the dierence between the original and a lowpass ltered version.

Highpass= Original LowpassIf the original is amplied the result is an

image with enhanced high-frequency detail.

Highboost

===

(A)(Original) Lowpass (A 1) (Original)+ Original Lowpass (A 1) (Original)+ Highpass

When A> 1 part of the original is added back to the highpass output. This technique is called unsharp masking. It has been used for many years in the printing and publishing industry.

DIP Lecture 8

9

IDL 图像处理第8讲

Unsharp Masking FiltersThe lter masks can be modied to directly produce unsharp masking. In the following use A≥ 1 -1 -1 -1 1 49× -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 49A-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1

-1 1 9× -1 -1

-1 9A-1 -1

-1 -1 -1

-1 -1 1 25× -1 -1 -1

-1 -1 -1 -1 -1

-1 -1 25A-1 -1 -1

DIP Lecture 8

10

IDL 图像处理第8讲

Unsharp Masking ExampleWith A= 1 the unsharp mask is a HP lter. More of the original image is included as A is increased. The eect is to sharpen the edges.

Original

A= 1.0

A= 1.3

A= 1.5

DIP Lecture 8

11

IDL 图像处理第8讲

Feature DetectionSpatial ltering can be used to detect a feature, which is a pattern of pixel values. Consider a pattern given by the 3× 3 array

f1 f4 f7A spatial lter of the same size is given by

f2 f5 f8

f3 f6 f9

w1 w4 w7

w2 w5 w8

w3 w6 w9

We want to choose the weights so that the lter response is signicantly greater when it is over a feature compared with the value when it is not.

DIP Lecture 8

12

IDL 图像处理第8讲

Feature DetectionLet the response to a feature be9 X i=1

Rf=and the response to another region be

w i fi

R=

9 X i=1

wizi

We can treat R as a random variable. The power of the lter in distinguishing between a feature pattern and a random background pattern can be analyzed by assuming that the 2 background is random white noise with mean value z and varianceσz . While this is not always the case in reality, the analysis provides guidance in lter selection.

DIP Lecture 8

13

IDL 图像处理第8讲

Feature DetectionIn a region of random background the lter output has mean and variance9 X i=1 9 X i=1 9 X i=1 9 X i=1

R

=

wiz= z

wi

2σR

=

2 wi (zi

z )=

2

2σz

wi

2

Dene a quality measure for the lter design as the ratio

(Rf R )2 Q= 2σRThe quality measure can be maximized by the correct weight selection.

DIP Lecture 8

14

IDL 图像处理第8讲

Selecting the Filter WeightsMaximize Q by weight selection by setting

Q= 0 for i= 1, . . ., 9 wiAfter simplication, this leads to the system of equations9 X j=1 9 X j=1

(fi z )

2 wj

= wi

(fj z )wj for i= 1 . . ., 9

The equations are satised by selecting wi=α(fi z ), whereα is a constant that determines the lter gain. A lter whose weights match the pattern is called a matched lter. Matched lters are used in classical signal detection applications such as radar and communication systems.

DIP Lecture 8

15

IDL 图像处理第8讲.doc 将本文的Word文档下载到电脑

    精彩图片

    热门精选

    大家正在看

    × 游客快捷下载通道(下载后可以自由复制和排版)

    限时特价:7 元/份 原价:20元

    支付方式:

    开通VIP包月会员 特价:29元/月

    注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
    微信:fanwen365 QQ:370150219