4

Image Enhancement in the Spatial Domaindepts.washington.edu/bicg/documents/BE244_Image_Enhancement... · Lecture 1: Image Enhancement ... Colin Studholme UCSF 2 Image Enhancement

  • Upload
    hadat

  • View
    231

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Image Enhancement in the Spatial Domaindepts.washington.edu/bicg/documents/BE244_Image_Enhancement... · Lecture 1: Image Enhancement ... Colin Studholme UCSF 2 Image Enhancement

1

Lecture 1: Image Enhancement -

Spatial Domain

BioE 244

Medical Image Processing and Analysis

T.R. McKnight, .R. McKnight,

Colin Studholme Colin Studholme

UCSF UCSF 22

Image Enhancement in the Spatial Domain

o Image Intensity/Contrast Transforms

o Image Histogram Analysis

o Arithmetic/Logical Image Operations

o Spatial Filtering (Klifa)

T.R. McKnight, .R. McKnight,

Colin Studholme Colin Studholme

UCSF UCSF 33

Spatial Domain Image Operations

o Spatial operators act directly on the pixels comprising

the image, unlike frequency domain operators which act

on the frequency representation of the image.

o g(x,y) = T[ f(x,y) ]

� f(x,y) - input image

� g(x,y) - output image

� T - spatial operator

T=

g(x,y) f(x,y)

T.R. McKnight, .R. McKnight,

Colin Studholme Colin Studholme

UCSF UCSF 44

Intensity/Contrast Transformations

o Point Pixel/Voxel Processing

� 1 x 1 neighborhood: s = T(r)

� �Intensity or graylevel transformation�, �pixel mapping�

� Typically implemented with a lookup table

r

S = T(r)

Dark Light

Dark

Lig

ht

r

S = T(r)

Dark Light

Dark

Lig

ht

Contrast StretchThreshold

r

S = T(r)

Input Image Value

Outp

ut Im

age V

alu

e

T.R. McKnight, .R. McKnight,

Colin Studholme Colin Studholme

UCSF UCSF 55

Contrast Stretching

r

S = T(r)

Dark Light

Dark

Lig

ht

J = imadjust(I) maps the values in intensity image I to new values in J such that 1% of data is

saturated at low and high intensities of I. This increases the contrast of the output image J. This

syntax is equivalent to imadjust(I,stretchlim(I)).

T.R. McKnight, .R. McKnight,

Colin Studholme Colin Studholme

UCSF UCSF 66

Thresholding

r

S = T(r)

r

S = T(r)

Dark Light

Dark

Lig

ht

r

S = T(r)

thr1 = im2bw(byt,.35);

thr1 = im2bw(byt,.50);

thr1 = im2bw(byt,.75);

Page 2: Image Enhancement in the Spatial Domaindepts.washington.edu/bicg/documents/BE244_Image_Enhancement... · Lecture 1: Image Enhancement ... Colin Studholme UCSF 2 Image Enhancement

T.R. McKnight, .R. McKnight,

Colin Studholme Colin Studholme

UCSF UCSF 77

CT intensity Range and Intensity

Windowing

-1000HU to 1000 HU mapped to 128 gray levels

-0HU to 100 HU mapped to 128 gray levels

T.R. McKnight, .R. McKnight,

Colin Studholme Colin Studholme

UCSF UCSF 88

Gray Level Transforms

L - 1

L - 1

3L/4

L/4

L/2

0

3L/4L/4 L/20

o Image Negative, Inverse Transform

o s = L - 1 - r

S

r

imadjust(I, [0 ; 1], [1 ; 0]);

or

imcomplement(I)

T.R. McKnight, .R. McKnight,

Colin Studholme Colin Studholme

UCSF UCSF 99

Gray Level Transforms

o Log Transform

o s = c log(1+r)

o Compresses dynamic range of images that have large

variation in intensities

o Most common display for FFTs L - 1

L - 1

3L/4

L/4

L/2

0

3L/4L/4 L/20

S

r

T.R. McKnight, .R. McKnight,

Colin Studholme Colin Studholme

UCSF UCSF 1010

Gray Level Transforms

o Gamma Correction, Power-Law Transform

o s = c r �

� � = 1 => identity image

� � < 1: maps narrow I range (dark) to a wider

dynamic range

� � > 1: maps wide range of I to narrow range

o Predominantly used for image capture, display,

and printing

L - 1

L - 1

3L/4

L/4

L/2

0

3L/4L/4 L/20

S

r

� = 0.4

� = 1

� = 2.5

� = 0.4 � = 2.5� = 1

imadjust(I, [ ], [ ], 0.4); imadjust(I, [ ], [ ], 2.5);

T.R. McKnight, .R. McKnight,

Colin Studholme Colin Studholme

UCSF UCSF 1111

Histogram Analysis

o The histogram (h) of an image with L graylevels is defined as h(rk) = nk, where

rk is the k-th gray level and nk is the number of pixels with intensity rk

o Histogram normalization: p(rk ) = nk /ntotal, for k = 0, 1, 2, �, L-1

o Useful for image enhancement, obtaining image statistics, segmentation, and

compression

T.R. McKnight, .R. McKnight,

Colin Studholme Colin Studholme

UCSF UCSF 1212

Histogram Equalization

o Image Transformations (T): s = T(r) 0 � r 1 � (normalized intensities)

o Histogram equalization: for k = 0, 1, 2, �, L-1

o Spreads the histogram of the input image over a larger range of intensities

sk=� j=0

k n j

n

Histogram

transformation function

(T)

Page 3: Image Enhancement in the Spatial Domaindepts.washington.edu/bicg/documents/BE244_Image_Enhancement... · Lecture 1: Image Enhancement ... Colin Studholme UCSF 2 Image Enhancement

T.R. McKnight, .R. McKnight,

Colin Studholme Colin Studholme

UCSF UCSF 1414

Histogram Matching

o Histogram matching, Histogram specification

o Histogram mapping of Image 1: for k = 0,1,2,�,L-1

o Histogram of Image 1: for k = 0,1,2,�,L-1

o Histogram matching to Image 2: for k = 0,1,2,�,L-1

sk=� j=0

k n j

n

z k=G�1 �s k �

G � z k �=�i=0

k

pz � zi �

T.R. McKnight, .R. McKnight,

Colin Studholme Colin Studholme

UCSF UCSF 1515

Arithmetic & Logic Image Operations

o Pixel-by-pixel mathematical operations

o Arithmetic (eg addition, subtraction, division, etc)

o Logic (eg AND, OR, NOT) => used in masking operations

T.R. McKnight, .R. McKnight,

Colin Studholme Colin Studholme

UCSF UCSF 1616

Image subtraction in medical Imaging:

DSA: digital Subtraction Angiography

T.R. McKnight, .R. McKnight,

Colin Studholme Colin Studholme

UCSF UCSF 1717

Subtraction SPECT imaging (after

registration)

T.R. McKnight, .R. McKnight,

Colin Studholme Colin Studholme

UCSF UCSF 1818

Image Subtraction

Problem: We have used physiologic MRI data to simulate (predict) the distribution of gadolinium-labeled liposomes infused into pig brain by convection-enhanced delivery (CED). How do we evaluate the accuracy of our simulation?

Simulated CEDActual CED

Difference (Actual - Sim)

- =

Page 4: Image Enhancement in the Spatial Domaindepts.washington.edu/bicg/documents/BE244_Image_Enhancement... · Lecture 1: Image Enhancement ... Colin Studholme UCSF 2 Image Enhancement

T.R. McKnight, .R. McKnight,

Colin Studholme Colin Studholme

UCSF UCSF 1919

Image Subtraction: Masking

- =

Difference |RealMask- SimMask|

Actual CED

Actual CED mask Simulated CED mask

Simulated CED

Quantify Volume of Difference or Standard Error

T.R. McKnight, .R. McKnight,

Colin Studholme Colin Studholme

UCSF UCSF 2020

Image Logic: Masking

Actual CED

& =

Simulated CED mask

T.R. McKnight, .R. McKnight,

Colin Studholme Colin Studholme

UCSF UCSF 2121

Spatial Filters

o Kernal

� Small 2D array eg 3x3 neighborhood

� �filter�, �kernal�, �template�, �window�

y

x

y

x

y

x

y

x

y

x

. . .

y

x

y

x

y

x

y

x

y

x

. . .

y

x