Вы находитесь на странице: 1из 51

EECE\CS 253 Image Processing

Lecture Notes Lecture Notes: Reduction of Correlated Noise

Richard Alan Peters II


Department of Electrical Engineering and Computer Science
Fall Semester 2011

. 1

.... . .

This work is licensed under the Creative Commons Attribution-Noncommercial 2.5 License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc/2.5/ or send a letter to Creative Commons, 543 Howard Street, 5th Floor, San Francisco, California, 94105, USA.

Pratt Pratt& &Whitney WhitneyRocketdyne RocketdyneJ-2 J-2rocket rocketengines engines on Apollo 18s Saturn V second stage. on Apollo 18s Saturn V second stage.

Periodic Noise

original image
15 November 2011

image + noise
2

1999-2011 by Richard Alan Peters II

Pratt Pratt& &Whitney WhitneyRocketdyne RocketdyneJ-2 J-2rocket rocketengines engines on Apollo 18s Saturn V second stage. on Apollo 18s Saturn V second stage.

Noise Reduction through Directional Blurring

diagonal convolution mask

image + noise
15 November 2011 1999-2011 by Richard Alan Peters II

blurred image
3

Power Spectrum of Image with Periodic Noise

original image
15 November 2011

image + noise
4

1999-2011 by Richard Alan Peters II

Low Frequency Region

original image
15 November 2011

image + noise
5

1999-2011 by Richard Alan Peters II

Noise Reduction through Notch Filtering

noise mask
15 November 2011

masked power spectrum


1999-2011 by Richard Alan Peters II 6

Pratt Pratt& &Whitney WhitneyRocketdyne RocketdyneJ-2 J-2rocket rocketengines engines on Apollo 18s Saturn V second stage. on Apollo 18s Saturn V second stage.

Inverse of Masked Fourier Transform

original image
15 November 2011

noise reduced image


7

1999-2011 by Richard Alan Peters II

Notch filter reduction of periodic noise


1. 2. 3. 4. 5. 6. 7. 8. 9.

Take the FFT of the input image. F = fft2(I). Display the log power spectrum of the fftshift-ed F. Find the locations, xi, of the spikes that correspond to the periodic distortion. Create a 1-band image, M, of class double the same size as I. Set all Ms pixels to 1.0. Let N(xi) be a neighborhood of xi with area sufficient to cover the spike at xi. For each xi do: for each yj N(xi), set M(yj) = 0. Blur M with a Gaussian whose is smaller than the radius of N(xi). Take the ifftshift of M.

10. For

each band, k, of the image let Gk = Fk .*M. 11. Then the noise-reduced image is: J = real(ifft2(G)).
15 November 2011 1999-2011 by Richard Alan Peters II 8

How to determine the frequency and period of a point in the log power spectrum of an image (ex.):
C
(0,0)

C/2 + 1

C/2 - 1 R/2 + 1

C/2 + 1

R R/2 - 1
original image
15 November 2011

R/2 + 1

quadrant partition of PS
1999-2011 by Richard Alan Peters II

loc of (0,0) in fftshift(PS)


9

How to determine the frequency and period of a point in the log power spectrum of an image (ex.):
339
(0,0)

170

169

170

241

480

original image
15 November 2011

239

241
quadrant partition of PS loc of (0,0) in fftshift(PS)
10

1999-2011 by Richard Alan Peters II

How to determine the frequency and period of a point in the log power spectrum of an image:
c1 r1 c2 -u
R/2 + 1

r2

-v

C/2 + 1
15 November 2011 1999-2011 by Richard Alan Peters II

u
11

How to determine the frequency and period of a point in the log power spectrum of an image:
-u
v = r2 R / 2 1 v = R / 2 + 1 r1 u = c2 C / 2 1

-v

u = C / 2 + 1 c1
wf =

( ) +( )
C u R v

wf =

1 wf

u
15 November 2011 1999-2011 by Richard Alan Peters II

vC wf = tan1 uR
12

Points on the Fourier Plane (of a Digital Image)


In the Fourier transform of an RC digital image the wavelengths, u and v represent a fraction of the R and C values. That is,
-v direction

u = C and v = u

R v

pixels.

The wavefront direction is given by

of a digital image

wf = tan1 ( vC , uR )
and the wavelength is - direction

wf =

( ) +( )
C u R v
v R

.
(0,0)
cycles.
1999-2011 by Richard Alan Peters II

u direction

The frequencies represent fractions of R & C,


u u = C , v =

, and

wf = 1
15 November 2011

( ) ( )

C 2 R 2 + u v

13

How to to determine determine the the frequency frequency How plane location location of of a a sinusoid: sinusoid: plane
c

257
r

512
r = / cos( )

-64

c = / sin( ) -32

257
A cos 2 ( r sin + c cos ) +

32

64

512
15 November 2011 1999-2011 by Richard Alan Peters II

Orientation, Orientation, ,is ismeasured measured , -CCWfrom fromcc CCW ..

cosine grating = 322, = -/4 r = 64 = 512/v, c = 64 = 512/v


14

How to to determine determine the the frequency frequency How plane location location of of a a sinusoid: sinusoid: plane
=1 u=-256 u=-256 rr=1

u = R / r v = C / c

=1 v=-256 v=-256 cc=1

=512 v=255 v=255 cc=512

-8 8
u = 512/64 u= 512/64 = = 512/64 v v 512/64

v
(0,0) (257,257) (257,257) (0,0)

=512 u=255 u=255 rr=512

u u cosine grating = 82, orientation = 3/4 u = 8, v = 8


1999-2011 by Richard Alan Peters II 15

15 November 2011

Sinusoidal grating image with an even number or rows and an odd number of columns.
c r
c= 40 r -23

512767 sine grating = 20, orient. = 5/6 r= 20/cos(5/6) -23 , c= 20/sin(5/6) = 40


15 November 2011 1999-2011 by Richard Alan Peters II 16

FT of Sinusoidal Grating Image


-22

u = R / r v = C / c
(0,0) v

-19 19 22

752937 sine grating = 20, orient. = 5/6 u = 512/r 22 , v = 767/ c 19


17

15 November 2011

1999-2011 by Richard Alan Peters II

Processing Scanned Press-Printed Images


4-color printing:
1. 1. A Aphotograph photographor orother othercolor colorimage imageis isseparated separatedinto intofour four intensity intensityband bandimages: images:cyan, cyan,magenta, magenta,yellow, yellow,and andblack. black. 1 2. 2. Each Eachof ofthese theseis ismultiplied multipliedby byaahalftone halftonescreen screen1aadot dotmask mask with withaaunique uniqueorientation. orientation. 3. 3. Each Eachof ofthe theresulting resultingfour fourimages imagesshows showsaapattern patternof ofdots dots whose whoseindividual individualsizes sizesindicate indicatethe theamount amountof ofink inkto tobe be applied appliedat ateach eachpoint. point. 4. 4. The Thefour fourimages imagesare areprinted, printed,one oneatop atopthe theother, other,in inthe the corresponding correspondingcolor. color.
1

Merriam-Webster Dictionary: halftone 2 (1): a photoengraving made from an image photographed through a screen and then etched so that the details of the image are reproduced in dots.

15 November 2011

1999-2011 by Richard Alan Peters II

18

Halftone Screen (45)


space

isthe thepointwise pointwiseproduct productof of is 2sinusoidal sinusoidalgratings gratingswith with 2 perpendicularorientations. orientations. perpendicular

15 November 2011

frequency

1999-2011 by Richard Alan Peters II

19

Halftone Screens (90)


space

Theorientation orientationof ofthe the The screenis isthe theaverage averageof of screen thegrating gratingorientations. orientations. the

15 November 2011

frequency

1999-2011 by Richard Alan Peters II

20

Standard Halftone Screen Angles


Cyan: 105 Yellow: 90 Magenta: 75 Black: 45

Image from Adobe Photoshop CS2 documentation. 15 November 2011 1999-2011 by Richard Alan Peters II 21

Each Eachband bandhas has2 2perpendicular perpendicular sinusoids + a DC component sinusoids + a DC component

CMYK Standard Halftone Screens

Power Spectra
15 November 2011 1999-2011 by Richard Alan Peters II 22

which whichcreates createsrectangular rectangular grids at 4 different grids at 4 differentangles. angles.

CMYK Standard Halftone Screens


cyan magenta

105

75

yellow

black

90

45

space domain images


15 November 2011 1999-2011 by Richard Alan Peters II 23

When Whenthe the4 4are aresummed, summed,the the result is a rosette image. result is a rosette image.

CMYK Standard Halftone Screens


cyan magenta

105

75

yellow

black

90

45

space domain images


15 November 2011 1999-2011 by Richard Alan Peters II 24

To Toprint printan animage, image,it itis is separated into 4 color separated into 4 colorbands bands

Example: Color Separation / Halftoning

That Thatis, is,an anintensity intensityimage imageis is created for each of the four created for each of the four color colorbands. bands.

15 November 2011

1999-2011 by Richard Alan Peters II

25

each eachof ofwhich whichis ismultiplied multipliedby by aacorresponding screen. corresponding screen.

Color Separation / Halftoning


Each Eachintensity intensityimage imageis ismultiplied multiplied by a corresponding screen, by a corresponding screen,then then Cyan Magenta

Yellow

Black

each eachscreened screenedimage imageis isprinted printedin in its own color on the same page. its own color on the same page.

15 November 2011

1999-2011 by Richard Alan Peters II

26

To Toprint printan animage, image,it itis is separated into 4 color separated into 4 colorbands bands

Example: Color Separation / Halftoning

Here Herethe thebands bandstinted tintedin intheir their corresponding colors. corresponding colors.

15 November 2011

1999-2011 by Richard Alan Peters II

27

each eachof ofwhich whichis ismultiplied multipliedby by aacorresponding screen corresponding screen

Example: Color Separation / Halftoning

Here Herethe thescreens screenstinted tintedin in their corresponding colors. their corresponding colors.

15 November 2011

1999-2011 by Richard Alan Peters II

28

to toget getdot dotpatterns patternsfor forprinting. printing. The 4 are printed over each The 4 are printed over eachother other to get the final result. to get the final result.

Example: Color Separation / Halftoning

15 November 2011

1999-2011 by Richard Alan Peters II

29

Halftone Dots

Image scanned (600 dpi) from a magazine


15 November 2011

Detail: Circular patterns, the rosettes, are the result of the halftone dots.
30

1999-2011 by Richard Alan Peters II

Filtering Out Halftone Dot Distortion

original

log power spectrum

15 November 2011

1999-2011 by Richard Alan Peters II

31

Filtering Out Halftone Dot Distortion

Eachpair pairof ofpeaks peaks Each correspondsto toaa corresponds sinusoidalsub-pattern sub-pattern sinusoidal inthe theHTD HTDpattern. pattern. in

original

log power spectrum

15 November 2011

1999-2011 by Richard Alan Peters II

32

Blurring with a Gaussian ( = 1)

blurred image =1

log power spectrum =1

15 November 2011

1999-2011 by Richard Alan Peters II

33

Blurring with a Gaussian ( = 2)

blurred image =2

log power spectrum =2

15 November 2011

1999-2011 by Richard Alan Peters II

34

Blurring with a Gaussian ( = 4)

blurred image =4

log power spectrum =4

15 November 2011

1999-2011 by Richard Alan Peters II

35

Blurring with a Gaussian ( = 8)

blurred image =8

log power spectrum =8

15 November 2011

1999-2011 by Richard Alan Peters II

36

Blurring with a Gaussian ( = 1)

original

difference
middle gray = 0, normalized

blurred = 1

15 November 2011

1999-2011 by Richard Alan Peters II

37

Blurring with a Gaussian ( = 2)

blurred = 2

difference
middle gray = 0, normalized

original

15 November 2011

1999-2011 by Richard Alan Peters II

38

Blurring with a Gaussian ( = 4)

original

difference
middle gray = 0, normalized

blurred = 4

15 November 2011

1999-2011 by Richard Alan Peters II

39

Blurring with a Gaussian ( = 8)

blurred = 8

difference
middle gray = 0, normalized

original

15 November 2011

1999-2011 by Richard Alan Peters II

40

Problem with Blurring to Reduce HTD Distortion


It blurs everything. Better to remove the HTD frequency components selectively: 1. 1. 2. 2. 3. 3. 4. 4. 5. 5. 6. 6. 7. 7. 8. 8. Read Readin inthe theimage. image. Compute Computethe thelog logpower powerspectrum spectrumof ofthe theimage. image. Find Findthe thelocations locationsof ofthe theHTD HTDspectrum spectrumpeaks. peaks. Mark Markthese theseon onaamask. mask. Enlarge Enlargethe thepoints pointsto toregions regionsthat thatcover covermost mostof ofthe theenergy. energy. Blur Blurthe themask maskfor forused usedas asaanotch notchfilter. filter. Multiply Multiplythe theFourier Fouriertransform transformof ofthe theimage imageby bythe themask. mask. Take Takethe theinverse inverseFourier Fouriertransform transformof ofthe theresult. result.
1999-2011 by Richard Alan Peters II 41

15 November 2011

Remove HTD Distortion Selectively

through throughnotch notch filtering. filtering.

1. Read in image; 2. Compute power spectrum; 3. Locate HTD frequency components; 4. Mark locs on a mask; 5. Enlarge points to regions; 6. Blur the mask; 7. Multiply FT of image by mask; 8. Take inverse FT of result; 15 November 2011 1999-2011 by Richard Alan Peters II 42

Notch Filtering of Halftone Dot Distortion

original

log power spectrum

15 November 2011

1999-2011 by Richard Alan Peters II

43

Notch Filtering

Sincenot notmuch muchdistortion distortionwas was Since removed,these thesemust mustbe besubharmonics subharmonics removed, ofthe thetrue truedot dotfrequencies frequencies of

frequency masked 1

log power spectrum

15 November 2011

1999-2011 by Richard Alan Peters II

44

Notch Filtering

Theouter outerring ringare arethe theactual actualHTD HTD The frequencies. Can Canwe wedo doany anybetter? better? frequencies.

frequency masked 2

log power spectrum

15 November 2011

1999-2011 by Richard Alan Peters II

45

Notch Filtering

Notmuch. much.The Theharmonics harmonicscontribute contribute Not littleenergy energyto tothe theimage. image. little

frequency masked 3

log power spectrum

15 November 2011

1999-2011 by Richard Alan Peters II

46

Notch Filter Difference Images

original

difference
middle gray = 0, normalized

frequency masked 1

15 November 2011

1999-2011 by Richard Alan Peters II

47

Notch Filter Difference Images

frequency masked 2

difference
middle gray = 0, normalized

original

15 November 2011

1999-2011 by Richard Alan Peters II

48

Notch Filter Difference Images

original

difference
middle gray = 0, normalized

frequency masked 3

15 November 2011

1999-2011 by Richard Alan Peters II

49

Notch Filter Difference Images

frequency masked 1

difference
middle gray = 0, normalized

frequency masked 2

15 November 2011

1999-2011 by Richard Alan Peters II

50

Notch Filter Difference Images

frequency masked 2

difference
middle gray = 0, normalized

frequency masked 3

15 November 2011

1999-2011 by Richard Alan Peters II

51

Вам также может понравиться