smoothing techniques in image processing l.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Smoothing Techniques in Image Processing PowerPoint Presentation
Download Presentation
Smoothing Techniques in Image Processing

Loading in 2 Seconds...

play fullscreen
1 / 59

Smoothing Techniques in Image Processing - PowerPoint PPT Presentation


  • 578 Views
  • Uploaded on

Smoothing Techniques in Image Processing. Prof. PhD. Vasile Gui Polytechnic University of Timisoara . Content. Introduction Brief review of linear operators Linear image smoothing techniques Nonlinear image smoothing techniques . Introduction. Why do we need image smoothing?

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Smoothing Techniques in Image Processing' - Ava


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
smoothing techniques in image processing

Smoothing Techniques in Image Processing

Prof. PhD. Vasile Gui

Polytechnic University of Timisoara

content
Content
  • Introduction
  • Brief review of linear operators
  • Linear image smoothing techniques
  • Nonlinear image smoothing techniques
introduction
Introduction

Why do we need image smoothing?

What is “image” and what is “noise”?

  • Frequency spectrum
  • Statistical properties
brief review of linear operators pratt 1991
Brief Review of Linear Operators[Pratt 1991]
  • Generalized 2D linear operator
  • Separable linear operator:
  • Space invariant operator:

Convolution sum

brief review of linear operators

h22

h20

h21

L-1

h12

h11

h10

2

L-1

h02

h01

h00

h22

h20

h21

H

2

h12

h11

h10

h02

h01

h00

L-1

h22

G

h20

h21

2

L-1

h12

h11

h10

2

h02

h01

h00

N-L+1

F

N

N+L-1

h22

h20

h21

h12

h11

h10

h22

h20

h21

h02

h12

h01

h00

h11

h10

h02

h01

h00

Brief Review of Linear Operators
  • Geometrical interpretation of 2D convolution
brief review of linear operators6
Brief Review of Linear Operators
  • Matrix formulation
  • Unitary transform
  • Separable transform
  • Transform is invertible
brief review of linear operators7
Brief Review of Linear Operators
  • Basis vectors are orthogonal
  • Inner product and energy are conserved
  • Unitary transform: a rotation in N-dimensional vector space
brief review of linear operators8

x2

2

1

x1

Brief Review of Linear Operators
  • 2D vector space interpretation

of a unitary transform

brief review of linear operators11
Brief Review of Linear Operators
  • Circular convolution theorem
  • Periodicity of f,h and g with N are assumed
linear image smoothing techniques box filters arithmetic mean l l operator13

m,n

+

L pixels

m,n+1

Linear Image smoothing techniquesBox filters. Arithmetic mean LL operator
  • Separable
  • Can be computed recursively, resulting in roughly 4 operations per pixel
linear image smoothing techniques box filters arithmetic mean l l operator14
Linear Image smoothing techniquesBox filters. Arithmetic mean LL operator

Optimality properties

  • Signal and additive white noise
  • Noise variance is reduced N times
linear image smoothing techniques box filters arithmetic mean l l operator15
Linear Image smoothing techniquesBox filters. Arithmetic mean LL operator
  • Unknown constant signal plus noise
  • Minimize MSE of the estimation g:
linear image smoothing techniques box filters arithmetic mean l l operator16
Linear Image smoothing techniquesBox filters. Arithmetic mean LL operator
  • i.i.d. Gaussian signal with unknown mean.
  • Given the observed samples, maximize
  • Optimal solution: arithmetic mean
linear image smoothing techniques box filters arithmetic mean l l operator17
Linear Image smoothing techniquesBox filters. Arithmetic mean LL operator
  • Frequency response:

Non-monotonically decreasing with frequency

linear image smoothing techniques box filters arithmetic mean l l operator19
Linear Image smoothing techniquesBox filters. Arithmetic mean LL operator
  • Image smoothed with 33, 55, 99

and 11 11 box filters

linear image smoothing techniques box filters arithmetic mean l l operator20
Linear Image smoothing techniquesBox filters. Arithmetic mean LL operator

Lena image filtered with

5x5 box filter

Original Lena image

linear image smoothing techniques binomial filters jahne 1995
Linear Image smoothing techniquesBinomial filters [Jahne 1995]
  • Computes a weighted average of pixels in the window
  • Less blurring, less noise cleaning for the same size
  • The family of binomial filters can be defined recursively
  • The coefficients can be found from (1+x)n
linear image smoothing techniques binomial filters 1d versions
Linear Image smoothing techniquesBinomial filters. 1D versions

As size increases, the shape of the filter is closer to a Gaussian one

linear image smoothing techniques binomial filters frequency response
Linear Image smoothing techniquesBinomial filters. Frequency response

Monotonically decreasing

with frequency

linear image smoothing techniques binomial filters example
Linear Image smoothing techniquesBinomial filters. Example

Original Lena image

Lena image filtered

with binomial 5x5 kernel

Lena image filtered

with box filter 5x5

linear image smoothing techniques binomial and box filters edge blurring comparison

Step edge

Result of size L

box filter

Size L binomial

L

Linear Image smoothing techniquesBinomial and box filters. Edge blurring comparison
  • Linear filters have to compromise smoothing with edge blurring
nonlinear image smoothing the median filter pratt 1991

f(1)

f1

f(2)

f2

.

.

.

f(m)

.

.

.

Order samples

select

f(N)

fN

median

Nonlinear image smoothingThe median filter [Pratt 1991]
  • Block diagram

N is odd

nonlinear image smoothing the median filter

3

7

8

2

3

7

4

6

7

2, 3, 3, 4, 6, 7, 7, 7, 8

6

Nonlinear image smoothingThe median filter
  • Numerical example
nonlinear image smoothing the median filter29
Nonlinear image smoothingThe median filter
  • Nonlinearity

median{f1 + f2}  median{ f1} + median{ f2}.

However:

median{ c f} = c median{ f },

median{ c + f} = c + median{ f}.

  • The filter selects a sample from the window, does not average
  • Edges are better preserved than with liner filters
  • Best suited for “salt and pepper” noise
nonlinear image smoothing the median filter30
Nonlinear image smoothingThe median filter

Noisy image

5x5 median filtered

5x5 box filter

nonlinear image smoothing the median filter31
Nonlinear image smoothingThe median filter
  • Optimality
  • Grey level plateau plus noise. Minimize sum of absolute differences:
  • Result:
  • If 51% of samples are correct and 49% outliers, the median still finds the right level!
nonlinear image smoothing the median filter32

Test images

Results of 33 pixel median filter

Nonlinear image smoothingThe median filter
  • Caution: points, thin lines and corners are erased by the median filter
nonlinear image smoothing the median filter34
Nonlinear image smoothingThe median filter
  • Implementing the median filter
  • Sorting needs O(N2) comparisons
    • Bubble sort
    • Quick sort
    • Huang algorithm (based on histogram)
    • VLSI median
nonlinear image smoothing the median filter35

x1

x(1)

x2

x(2)

x3

x(3)

a

Min(a,b)

x4

x(4)

b

Max(a,b)

x5

x(5)

x6

x(6)

x7

x(7)

Nonlinear image smoothingThe median filter
  • VLSI median block diagram
nonlinear image smoothing the median filter36
Nonlinear image smoothingThe median filter
  • Color median filter
    • There is no natural ordering in 3D (RGB) color space
    • Separate filtering on R,G and B components does not guarantee that the median selects a true sample from the input window
    • Vector median filter, defined as the sample minimizing the sum of absolute deviations from all the samples
    • Computing the vector median is very time consuming, although several fast algorithms exist
nonlinear image smoothing the median filter37
Nonlinear image smoothingThe median filter
  • Example of color median filtering
  • 5x5 pixels window
  • Up: original image
  • Down: filtered image
nonlinear image smoothing the weighted median filter
Nonlinear image smoothingThe weighted median filter
  • The basic idea is to give higher weight to some samples, according to their position with respect to the center of the window
  • Each sample is given a weight according to its spatial position in the window.
  • Weights are defined by a weighting mask
  • Weighted samples are ordered as usually
  • The weighted median is the sample in the ordered array such that neither all smaller samples nor all higher samples can cumulate more than 50% of weights.
  • If weights are integers, they specify how many times a sample is replicated in the ordered array
nonlinear image smoothing the weighted median filter39

1

2

1

2

2

3

1

2

1

3

7

8

2

3

7

6

4

6

7

2, 2, 3, 3, 3, 3, 4, 6, 6, 7, 7, 7, 7, 7, 8

Nonlinear image smoothingThe weighted median filter
  • Numerical example for the weighted median filter
nonlinear image smoothing the multi stage median filter

R3

R2

R4

m5

R1

mi = median( Ri ), i =1,2,3,4.

Result = median( m1,m2,m3,m4,m5 )

Nonlinear image smoothingThe multi-stage median filter
  • Better detail preservation
nonlinear image smoothing rank order filters l filters

weights

f(1)

f1

a1

f(2)

f2

a2

y

.

.

.

.

.

.

ordering

sum

f(N)

fN

aN

y = a1f(1) + a2f(2)+...+ aNf(N)

Nonlinear image smoothingRank-order filters (L filters)
  • Block diagram
nonlinear image smoothing rank order filters l filters42

a1=1

. . .

Min

aN=1

. . .

Max

am=1

. . .

. . .

Median

a1=.5

aN=.5

. . .

Mid range

Nonlinear image smoothingRank-order filters (L filters)
  • Some examples

Percentile

filters (rank selection):

0%,

50%

100%

Particular cases of grey level morphological filters

nonlinear image smoothing rank order filters l filters43
Nonlinear image smoothingRank-order filters (L filters)
  • Optimality

Minkovski distance

Case r = 1: best estimator ismedian.

Caser = 2, best estimator is arithmetic mean.

Caser , best estimator is mid-range.

nonlinear image smoothing rank order filters l filters44
Nonlinear image smoothingRank-order filters (L filters)
  • Alpha-trimmed mean filter
  •  = (2Q + 1) / N, defines de degree of averaging
  • = 1 corresponds to arithmetic mean

 = 1 / N corresponds to the median filter

Properties: in between mean and median

nonlinear image smoothing rank order filters l filters45
Nonlinear image smoothingRank-order filters (L filters)

Median of absolute differences trimmed mean

  • Better smoothing than the median filter and good edge preservation

M2 is a robust estimator of the variance

nonlinear image smoothing rank order filters l filters46
Nonlinear image smoothingRank-order filters (L filters)
  • k nearest neighbour (kNN) median filter
  • Median of the k grey values nearest by rank to the central pixel
  • Aim: same as above
nonlinear image smoothing selected area filtering nagao 1980

reg 2

reg 1

reg 4

reg 3

reg 6

reg 5

reg 8

reg 7

Nonlinear image smoothingSelected area filtering [Nagao 1980]
  • Kuwahara type filtering
  • Form regions Ri
  • Compute mean, mi and variance, Si for each region.
  • Result = mi : mi < mj for all j different from i, i,e. themean of the most homogeneous region
  • Matsujama & Nagao
nonlinear image smoothing conditional mean
Nonlinear image smoothingConditional mean
  • Pixels in a neighbourhood are averaged only if they differ from the central pixel by less than a given threshold:

L is a spacescale parameter and th is a range scale parameter

nonlinear image smoothing bilateral filter tomasi 1998
Nonlinear image smoothingBilateral filter [Tomasi 1998]
  • Space and range are treated in a similar way
  • Space and range similarity is required for the averaged pixels
  • Tomasi and Manduchi [1998] introduced soft weights to penalize the space and range dissimilarity.

s() and r() are space and range similarity functions (Gaussian functions of the Euclidian distance between their arguments).

nonlinear image smoothing bilateral filter
Nonlinear image smoothingBilateral filter
  • The filter can be seen as weighted averaging in the joint space-range space (3D for monochromatic images and 5D – x,y,R,G,B - for colour images)
  • The vector components are supposed to be properly normalized (divide by variance for example)
  • The weights are given by:
nonlinear image smoothing bilateral filter52
Nonlinear image smoothingBilateral filter
  • Example of Bilateral filtering
  • Low contrast texture has been removed
  • Yet edges are well preserved
nonlinear image smoothing mean shift filtering comaniciu 1999 2002
Nonlinear image smoothingMean shift filtering [Comaniciu 1999, 2002]
  • Mean shift filtering replaces each pixel’s value with the most probable local value, found by a nonparametric probability density estimation method.
  • The multivariate kernel density estimate obtained in the point x with the kernel K(x) and window radius r is:
  • For the Epanechnikov kernel, the estimated normalized density gradient is proportional to the mean shift:

S is a sphere of radius r, centered on x and nx is the number of samples inside the sphere

nonlinear image smoothing mean shift filtering
Nonlinear image smoothingMean shift filtering
  • The mean shift procedure is a gradient ascent method to find local modes (maxima) of the probability density and is guaranteed to converge.
  • Step1: computation of the mean shift vector Mr(x).
  • Step2: translation of the window Sr(x) by Mr(x).
  • Iterations start for each pixel (5D point) and tipically converge in 2-3 steps.
nonlinear image smoothing mean shift filtering56
Nonlinear image smoothingMean shift filtering

Detail of a 24x40

window from the

cameraman image

a) Original data

b) Mean shift paths for some points

c) Filtered data

d) Segmented data

nonlinear image smoothing mean shift filtering58
Nonlinear image smoothingMean shift filtering

Comparison to bilateral filtering

  • Both methods based on simultaneous processing of both the spatial and range domains
  • While the bilateral filtering uses a static window, the mean shift window is dynamic, moving in the direction of the maximum increase of the density gradient.
references
REFERENCES
  • D. Comaniciu, P. Meer: Mean shift analysis and applications. 7th International Conference on Computer Vision, Kerkyra, Greece, Sept. 1999, 1197-1203.
  • D. Comaniciu, P. Meer: Mean shift: a robust approach toward feature space analysis. IEEE Trans. on PAMI Vol. 24, No. 5, May 2002, 1-18.
  • M. Elad: On the origin of bilateral filter and ways to improve it. IEEE trans. on Image Processing Vol. 11, No. 10, October 2002, 1141-1151.
  • B. Jahne: Digital image processing. Springer Verlag, Berlin 1995.
  • M. Nagao, T. Matsuiama: A structural analysis of complex aerial photographs. Plenum Press, New York, 1980.
  • W.K. Pratt: Digital image processing. John Wiley and sons, New York 1991
  • C. Tomasi, R. Manduchi: Bilateral filtering for gray and color images. Proc. Sixth Int’l. Conf. Computer Vision , Bombay, 839-846.