65
Prof. YingLi Tian Oct. 17, 2018 Department of Electrical Engineering The City College of New York The City University of New York (CUNY) Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to G&W website and Lexing Xie for slide materials

Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

  • Upload
    others

  • View
    3

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Prof. YingLi TianOct. 17, 2018

Department of Electrical EngineeringThe City College of New York

The City University of New York (CUNY)

Lecture 6: Image Restoration

1

I2200: Digital Image processing

Thanks to G&W website and Lexing Xie for slide materials

Page 2: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Announcement: Michael will present HW2 Today. HW3 is out today, due on 11/06. Peter will present HW3 on 11/07. Midterm Exam: Oct. 24, 2018.

Open notes No electronic device is allowed except calculator

Final project: Send me the following info before 10/31, 2018 The project title and a short description if you choose your own

project (must be image processing related). Your partner if you want to team with someone.

2

Page 3: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

We have covered …

3

Page 4: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Outline What is image restoration

Scope, history and applications A model for (linear) image degradation

Restoration from noise Different types of noise Examples of restoration operations

Restoration from linear degradation Inverse and pseudo-inverse filtering Wiener filters Blind de-convolution

Geometric distortion and its corrections

Page 5: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Degraded images

5

Page 6: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Image Restoration Image restoration is to "compensate for" or

"undo" defects which degrade an image. Degradations:

motion blur noise camera defocus distortion …

6http://www.owlnet.rice.edu/~elec539/Projects99/BACH/proj2/intro.html

Page 7: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Image Restoration VS Enhancement

7

Page 8: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Image restoration

8

Page 9: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

A model for image distortion

9

Page 10: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

A model for image distortion

Image restoration Use a priori knowledge of the degradation Modeling the degradation and apply the

inverse process Formulate and evaluate objective criteria of

goodness

10

Page 11: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Usual assumptions for the distortion model

111

Page 12: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Common noise models

12More details, G&W p313-319

(Impulse)

Page 13: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

The visual effects of noise

13

Page 14: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Recovering from noise

14

Page 15: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Example: Gaussian noise & mean filter

15

Page 16: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Example: salt-and-pepper noise & median filter

16

Page 17: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Recovering from Periodic Noise

17

Page 18: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Recovering from Periodic Noise in Frequency domain

18

Page 19: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Example of bandreject filter

19

Page 20: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Example of bandpass filter

20Hbp(u, v) = 1 - Hbr(u, v)

Page 21: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Notch filter

21

Page 22: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Example of notch filter

22

Page 23: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Example of notch filter

23

Page 24: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Outline What is image restoration

Scope, history and applications A model for (linear) image degradation

Restoration from noise Different types of noise Examples of restoration operations

Restoration from linear degradation Inverse and pseudo-inverse filtering Wiener filters Blind de-convolution

Geometric distortion and its corrections

Page 25: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Recover from linear degradation

250

Page 26: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Estimate the degradation Function

26

By Image Observation By Experimentation By modeling

Page 27: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Example of turbulence model

27

Page 28: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

28

Image blur due to motion

G&W Equ. 5.6-11

Page 29: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Image Restoration by Inverse filter

29

Page 30: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Inverse filtering example

30

Page 31: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Inverse filtering example

31

Input image

Page 32: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Inverse filtering under noise

32

Page 33: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Pseudo-inverse filtering

33

Page 34: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Back to the original problem

34

Page 35: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Wiener (mini mean square error) filter

35

Page 36: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Wiener filter

36

Page 37: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

SNR and MSE measurement

37

Signal-to-noise ratio:

Mean square error:

Page 38: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Observations about Wiener filter

38

Page 39: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

39

Page 40: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Wiener Filter example

40

Page 41: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Wiener filter example

41

Page 42: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Wiener filter example

42

Page 43: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Wiener filter: when does it not work

43

Page 44: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Improve Wiener filters

44

Page 45: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

45

Page 46: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Example of improved wiener filter

46

Page 47: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Wavelet Restoration

47

Two step: Fourier-domain inverse filtering Wavelet-domain image denoising.

When the blurring function is not invertible, the algorithm is not applicable.

Page 48: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Wavelet-based deconvolution technique for ill-conditioned systems

48

Two step: modifying the Wiener filter

Wavelet-domain image denoising.

Page 49: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

49

Blurred Lena ImagePSNR = 23.2993, MSE = 304.1938

Restored Lena Image (WaRD) PSNR = 19.5115, MSE = 727.7

Restored lenaImage (Wavelet)PSNR = 16.8552, MSE = 1341.4

Restored Lena Image (Subband) PSNR = 20.1223, MSE = 632.2

Example of Wavelet Restoration

Page 50: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Power Spectrum Equalization (PSE) We assumed that we knew the blurring

function h, what should we do if they were unknown? Wiener Filter

Power Spectrum Equalization -- restore the power spectrum of the degraded image

50

Page 51: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Example of PSE

51

Lenna after Blurring Plus Noise, Mean Squared Error = 1.0660e+05

Lenna restored using Wiener Filter, Mean Squared Error =

123.2

Lenna restored using PSE, Mean Squared Error = 419.5

Page 52: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Blind deconvolution

52

Restore image without knowledge of our blurring function

Estimate H (Jain approach)

Wiener filter

http://www.owlnet.rice.edu/~elec539/Projects99/BACH/proj2/blind/bd.html

Page 53: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Example of Blind deconvolution

53

Lenna after Blurring Plus NoiseMean Squared Error = 1.0660e+05

Lenna restored using Jain ApproachMean Squared Error = 283.1

Page 54: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Outline What is image restoration

Scope, history and applications A model for (linear) image degradation

Restoration from noise Different types of noise Examples of restoration operations

Restoration from linear degradation Inverse and pseudo-inverse filtering Wiener filters Wavelet Restoration Blind de-convolution

Geometric distortion and its corrections

Page 55: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Geometric distortions

55

Page 56: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Geometric/spatial distortion examples

56

Page 57: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Recovery from geometric distortion

57

Page 58: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Recovery from geometric distortion

58

Rahul Swaminathan, Shree K. Nayar: Nonmetric Calibration of Wide-Angle Lenses and Polycameras. IEEE Trans. Pattern Anal. Mach. Intell. 22(10): 1172-1178 (2000)

Page 59: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Omnicamera

59

http://www.columbia.edu/cu/record/23/20a/omnicamera.html

Page 60: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Estimating distortions

60

Page 61: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Summary

61

A image degradation model Restoration from noise Restoration from linear degradation Inverse and pseudo-inverse filters, Wiener filter, constrained

least squares, wavelet restoration, Geometric distortions Readings

G&W Chapter 5.1 – 5.10. M. R. Banham and A. K. Katsaggelos "Digital Image

Restoration“, IEEE Signal Processing Magazine, vol. 14, no. 2, Mar. 1997, pp.24-41

Page 62: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Who said distortion is a bad thing?

62

Page 63: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Suggestions for Final Project -- 1 Each student or team works on different projects Send me by email about the TITLE and a brief

description if you will choose the final project by yourself before 10/31/2018 (must be image processing related).

Two students can work on same project Team work Need to show the contributions for each student Send me by email for the partner you choose before

10/31. Otherwise, I’ll assume you prefer to do the final project by yourself.

63

Page 64: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

Suggestions for Final Project -- 2 For the project:

Code Report Presentation

64

Page 65: Lecture 6: Image Restoration - Media Labmedia-lab.ccny.cuny.edu/wordpress/YLTCCNYHomepage/Courses/I2… · Lecture 6: Image Restoration 1 I2200: Digital Image processing Thanks to

HW2 Presentation

65