Digital Image Processing R.Gonzales R.Woods.

25
Tutorial 1 Basic Image Processing Concepts Alexandre Kassel troduction to Medical Imaging 046831

Transcript of Digital Image Processing R.Gonzales R.Woods.

Page 1: Digital Image Processing R.Gonzales R.Woods.

Tutorial 1Basic Image Processing Concepts

Alexandre Kassel

Introduction to Medical Imaging

046831

Page 2: Digital Image Processing R.Gonzales R.Woods.

Tutorial Overview 2D Fourier Transform Some Basic Filters Some Matlab functions and definitions Introduction to Image Reconstruction

Page 3: Digital Image Processing R.Gonzales R.Woods.

2D Fourier Transforms: Definition Continuous

Discrete

Inverse

𝐹 (𝑢 ,𝑣)=∬𝛺

𝑓 (𝑥 , 𝑦 )⋅𝑒¿ ¿¿

𝐹 (𝑢 ,𝑣)=∑𝑥=0

𝑀 −1

.∑𝑦=0

𝑁−1

𝑓 (𝑥 , 𝑦 )⋅ 𝑒− 2𝜋 𝑗 (𝑢𝑥𝑀 + 𝑣𝑦

𝑁 )𝑑𝑥𝑑𝑦

𝑓 (𝑥 , 𝑦)=1

𝑀𝑁 ∑𝑢=0

𝑀 −1

⋅∑𝑣=0

𝑁−1

𝐹 (𝑢 ,𝑣 )⋅𝑒2 𝑗 𝜋 (𝑢𝑥𝑀 +𝑣𝑦

𝑁 )

Page 4: Digital Image Processing R.Gonzales R.Woods.

DFT Properties Summary

Digital Image ProcessingR.GonzalesR.Woods

Page 5: Digital Image Processing R.Gonzales R.Woods.

Convolution and Correlation Convolution

Correlation

Digital Image ProcessingR.GonzalesR.Woods

Page 6: Digital Image Processing R.Gonzales R.Woods.

DFT

DFT is insensitive to rotation

The sinc function main direction in Frequency space is orthogonal to the rectangle main direction.

Page 7: Digital Image Processing R.Gonzales R.Woods.

Basic Filters : LPF

1/16 2/16 1/16

2/16 4/16 2/16

1/16 2/16 1/16

1/9 1/9 1/9

1/9 1/9 1/9

1/9 1/9 1/9

Average

Gaussian

Page 8: Digital Image Processing R.Gonzales R.Woods.

Basic Filters : Mean vs Median

Average [3x3]

Median [3x3]

Page 9: Digital Image Processing R.Gonzales R.Woods.

Basic Filters : Laplacian (HPF)

-1 -1 -1

-1 8 -1

-1 -1 -1

(Laplacian)

0 -1 0

-1 4 -1

0 -1 0

Another conventional form of Laplacian operator :

Page 10: Digital Image Processing R.Gonzales R.Woods.

Basic Filters : Laplacian of Gaussian (BPF)

Laplacian Operator :

Laplacian of Gaussian :

0

5

10

15

20

02468101214161820-4

-3.5

-3

-2.5

-2

-1.5

-1

-0.5

0

0.5

1

x 10-3

Laplacian of Gaussian

Page 11: Digital Image Processing R.Gonzales R.Woods.

Basic Filters : Laplacian of GaussianFiltered with Laplacian of Gaussian (absolute value)

Filtered with Laplacian of Gaussian (absolute value)

Page 12: Digital Image Processing R.Gonzales R.Woods.

Basic Filters : Difference of Gaussians (DoG)

Very good approximation of LoG

Why is it a Band Pass Filter ?

Page 13: Digital Image Processing R.Gonzales R.Woods.

Basic Filters : Gradient operators(Horizontal)

-1

1

-1 -1 -1

0 0 0

1 1 1

-1 -2 -1

0 0 0

1 2 1

Gradient Pewitt Sobel

Page 14: Digital Image Processing R.Gonzales R.Woods.

Basic Filters : Gradient operators Similarly, there are vertical

operators We can (and should)

combine both Horizontal and Vertical operators

Beware the noise !Vetical and Horizontal absolute response to

Sobel Filter , threshold and combined

> threshold

Author
Author
Page 15: Digital Image Processing R.Gonzales R.Woods.

Matlab : DICOM files Digital Imaging and Communications in Medicine

Universal standard file for medical images.dcm filedicominfo( ) : load the

DICOM structuredicomread( ) : load the

DICOM file imagedicomwrite ( ) : create a

DICOM file

Page 16: Digital Image Processing R.Gonzales R.Woods.

Matlab : Shepp-Logan phantom

Human head model Standard test image Widely used in Image

Reconstruction testing Matlab function : phantom( )

Page 17: Digital Image Processing R.Gonzales R.Woods.

Matlab : Data classes

Most used data classes in Image Processing double : Double-precision floating-point numbers

uint8 : Unsigned 8-bit integers [0,255]

logical : Black and White image [0,1]

Attention Be careful when using ‘==‘ with double data

Be careful with mathematical operation and filtering on uint8 data.

To show ‘double’ images use : imshow(I,[])

Page 18: Digital Image Processing R.Gonzales R.Woods.

Matlab : Some Useful basic IP Functionsfft2 ( ), ifft2 : 2D Fourier transform , and inverse 2D Fourier transform

fspecial ( ) : Create a linear filter (convolution kernel) , includes some “built-in” basic filters (Average, Laplacian, LoG, Sobel …..)

imfilter ( ) : Image filtering with a kernel.

imadjust ( ) : Gamma correction

histeq( ) : Histogram equalization

medfilt2 ( ) : median filtering

imrotate ( ) : Image rotation

Imresize ( ) : Image resizing

imnoise ( ) : add different type of noise (Gaussian, uniform “Salt & Pepper”, Poisson)

interp2 ( ) : 2D interpolation

Page 19: Digital Image Processing R.Gonzales R.Woods.

Next weeks in

Introduction to Medical Imaging Tutorials

Image Reconstruction

Page 20: Digital Image Processing R.Gonzales R.Woods.

Teaser : Image Reconstruction

Regular Image :

Object LensReceptors Object

Image

Processing

Page 21: Digital Image Processing R.Gonzales R.Woods.

photograph a slice of the human body !

But one does not simply…

We need to “build” the image

Page 22: Digital Image Processing R.Gonzales R.Woods.

Teaser : Image ReconstructionIn X-Ray CT recomstruction , all we have is X-Ray absorption.

Unknown

Our goal is to “reconstruct”

an image from this raw data(We do many more

than 2 angles)

Page 23: Digital Image Processing R.Gonzales R.Woods.

Teaser : Image Reconstruction

In MRI reconstruction, we reconstruct the image from 1D Radio-Frequence signal.

`

MRI devicePatient

Magnetic field generator

RFRF

Reconstruction

Page 24: Digital Image Processing R.Gonzales R.Woods.

See you next week!

Page 25: Digital Image Processing R.Gonzales R.Woods.