ADVANCED TOPICS ON VIDEO PROCESSING Image Spatial Processing Image - - PowerPoint PPT Presentation

advanced topics on video processing
SMART_READER_LITE
LIVE PREVIEW

ADVANCED TOPICS ON VIDEO PROCESSING Image Spatial Processing Image - - PowerPoint PPT Presentation

ADVANCED TOPICS ON VIDEO PROCESSING Image Spatial Processing Image Spatial Processing FILTERING EXAMPLES FILTERING EXAMPLES FOURIER INTERPRETATION FOURIER INTERPRETATION FILTERING EXAMPLES FILTERING EXAMPLES FOURIER INTERPRETATION FOURIER


slide-1
SLIDE 1

ADVANCED TOPICS ON VIDEO PROCESSING

Image Spatial Processing Image Spatial Processing

slide-2
SLIDE 2

FILTERING EXAMPLES FILTERING EXAMPLES

slide-3
SLIDE 3

FOURIER INTERPRETATION FOURIER INTERPRETATION

slide-4
SLIDE 4

FILTERING EXAMPLES FILTERING EXAMPLES

slide-5
SLIDE 5

FOURIER INTERPRETATION FOURIER INTERPRETATION

slide-6
SLIDE 6

FILTERING EXAMPLES FILTERING EXAMPLES

slide-7
SLIDE 7

FILTERING EXAMPLES FILTERING EXAMPLES

slide-8
SLIDE 8

FOURIER INTERPRETATION FOURIER INTERPRETATION

slide-9
SLIDE 9

FILTERING EXAMPLES FILTERING EXAMPLES

slide-10
SLIDE 10

FOURIER INTERPRETATION FOURIER INTERPRETATION

slide-11
SLIDE 11

LINEAR AND NON LINEAR OPERATIONS LINEAR AND NON LINEAR OPERATIONS

Median Filter: (6 8 9 9 10 11 12 13 15) = 10 Average of nearest neighbours: Minimum = 6; Maximum: 15 Median Filter: (6, 8, 9, 9,10, 11, 12, 13, 15) 10 Average of nearest neighbours:

slide-12
SLIDE 12

LOW PASS GAUSSIAN FILTER LOW PASS GAUSSIAN FILTER

slide-13
SLIDE 13

MEDIAN FILTERING MEDIAN FILTERING

slide-14
SLIDE 14

HI PASS FILTERING FOR HIGH FREQUENCIES

slide-15
SLIDE 15

EXAMPLE EXAMPLE

slide-16
SLIDE 16

1D DERIVATIVES 1D DERIVATIVES

slide-17
SLIDE 17

GRADIENT METHODS GRADIENT METHODS

 1D example

Si

 1D example

ye s

Yes Yes

>Thres-

No No

Thres hold?

No edge No edge

slide-18
SLIDE 18

2D CASE 2D CASE

Th fi d i i i b i d b h di

  • The first derivative is substituted by the gradient

     

   f x y f x y x i f x y y i

x y

, ,  ,     

  • Omnidirectional detector

B d |ƒ( )| i t i b h i

 Based on|ƒ(x,y)|: isotropic behaviour

  • Directional detector

 Based on an oriented derivative:

 ex.: a possible horizontal edge detector is |y|

slide-19
SLIDE 19

2D APPROACH 2D APPROACH

slide-20
SLIDE 20

EDGE THINNING EDGE THINNING

1) if f has a local horizontal max but not a vertical one in ( ) then that point is an edge point if (x0,y0), then, that point is an edge point if

2( value) f f K K typical    

 

0, 0

( ) ( , )

2( value)

x y x y

K K typical x y   

2) if f has a local vertical max but not a horizontal one in (x0,y0), then, that point is an edge point if

2(typical value) f f K K y x      

0, 0 0,

( ) ( )

  • x y

x y

y x  

slide-21
SLIDE 21

DIRECTIONAL CASE DIRECTIONAL CASE

.

slide-22
SLIDE 22

EXAMPLE: ISOTROPIC CASE EXAMPLE: ISOTROPIC CASE

.

slide-23
SLIDE 23

DISCRETIZATION DISCRETIZATION

The gradient operator can be discretized as: The gradient operator can be discretized as:

 

2 2

, ) , ( ) (            y x f y x f f  

 

, ) , ( ) , (                y y f x y f y x f  

2 2 1 2 2 1 2 1

) , ( ) , ( ) , ( n n f n n f n n f

y x

  

Which is based on a discretization of directional derivatives: derivatives:

) , ( ) , ( ) , (

2 1 2 1 2 1

n n f n n f n n f

y x

  

slide-24
SLIDE 24

FINITE IMPULSE RESPONSE MODEL

Discrete operators for derivative estimation can be estimated as

FINITE IMPULSE RESPONSE MODEL

sc ete ope ato s o de at e est at o ca be est ated as FIR filters. ) ( * ) ( ) ( n n h n n f n n f  ) , ( * ) , ( ) , (

2 1 2 1 2 1

n n h n n f n n f

y y

 ) , ( ) , ( ) , (

2 1 2 1 2 1

n n h n n f n n f

x x

 ) ( n n f ) ( n n f ) , (

2 1 n

n hx ) , (

2 1 n

n f ) , (

2 1 n

n f x

slide-25
SLIDE 25

DISCRETE DIFFERENTIAL OPERATORS DISCRETE DIFFERENTIAL OPERATORS

  • Pixel difference: luminance difference between to

neighbour pixels along orthogonal directions. neighbour pixels along orthogonal directions.

) 1 , ( ) , ( ) , (    k j f k j f k j f x

Separable filters

) , 1 ( ) , ( ) , ( k j f k j f k j f y   

Separable filters

     1           1 1

x

h          1 1

y

h            

slide-26
SLIDE 26

EXAMPLE: PIXEL DIFFERENCE C

slide-27
SLIDE 27

SEPARATED PIXEL DIFFERENCE SEPARATED PIXEL DIFFERENCE

  • If farther pixels are chosen there is a higher noise

rejection, and there is no phase translation in edge definition.

) 1 , ( ) 1 , ( ) , (     k j f k j f k j fx

) 1 ( ) 1 ( ) ( k j f k j f k j f     ) , 1 ( ) , 1 ( ) , ( k j f k j f k j f y 

         1           1 1

x

h          1

y

h         1

slide-28
SLIDE 28

EX.: SEPARATED PIXEL DIFFERENCE S C

slide-29
SLIDE 29

ROBERTS EDGE EXTRACTION ROBERTS EDGE EXTRACTION

) 1 , 1 ( ) , ( ) , (     k j f k j f k j f x ) , 1 ( ) 1 , ( ) , ( k j f k j f k j f y    

        1 1 h        1 1 h        1

x

h        1

y

h

slide-30
SLIDE 30

EX.: ROBERTS METHOD O S O

slide-31
SLIDE 31

PREWITT METHOD PREWITT METHOD

Estimation can be improved involving more samples for te Estimation can be improved involving more samples for te gradient operator 3x3

     

    f 

                 

1 1 1 1 1 1 1 , 1 1 , 1 *

2 1 2 1

                   f f f f n n f n n f x f K   = vertical low pass* horizontal high pass

           

1 , 1 1 , 1 , 1 , 1

2 1 2 1 2 1 2 1

          n n f n n f n n f n n f vertical low pass horizontal high pass

     

1 , 1 1 , 1 *

2 1 2 1

               n n f n n f f K  

                 

1 , 1 1 , 1 1 , 1 ,

2 1 2 1 2 1 2 1

              n n f n n f n n f n n f y  = vertical high pass* horizontal low pass

slide-32
SLIDE 32

GRADIENT ESTIMATION

  • Gradient modulus = the value of the higher directional derivative

GRADIENT ESTIMATION

g

  • Gradient phase = orientation of the higher directional derivative

Squared lattice =eight possible directions     1 1     1 1

 

          1 1 1 1 ,

2 1 n

n h

 

            1 1 1 1 ,

2 1 n

n h E NE       1 1 1   1 1

 

              1 1 1 ,

2 1 n

n h

 

              1 1 1 1 ,

2 1 n

n h N NW     1 1 1     1 1

slide-33
SLIDE 33

GRADIENT ESTIMATION

    1 1

GRADIENT ESTIMATION

 

         1 1 1 1 ,

2 1 n

n h

 

            1 1 1 1 ,

2 1 n

n h W SW       1 1     1 1      1 1 1     1 1

 

           1 1 1 1 1 1 ,

2 1 n

n h

 

            1 1 1 1 ,

2 1 n

n h S SE     1 1 1     1 1

slide-34
SLIDE 34

EX.: PREWITT METHOD 3X3 O 3 3

slide-35
SLIDE 35

SOBEL METHOD SOBEL METHOD

S di i f P i fil

 Same dimensions of Prewitt filter  Different weight for central point in different

directions.

  1 1        1 2 1              1 1 2 2

r

h          1 2 1

c

h

 Sobel for exagonal grids.

    1 1            2 2 1 1 h        1 1

slide-36
SLIDE 36

EX.: SOBEL METHOD SO O

slide-37
SLIDE 37

COMPARISON COMPARISON

Roberts Sobel Prewitt Sobel Prewitt

slide-38
SLIDE 38

FREI CHEN OPERATOR FREI-CHEN OPERATOR

I t i t i il t P itt

 Isotropic operator similar to Prewitt  different weight for the central point in the 4

directions.

 The gradient has the same value for horizontal,

vertical and diagonal edges.          2 2 1 1 h           1 2 1 h       1 1 2 2

r

h        1 2 1

c

h

slide-39
SLIDE 39

EX.: METODO DI FREI-CHEN O O C

slide-40
SLIDE 40

EXTENDED OPERATORS EXTENDED OPERATORS

A li it f th f ti d th d i th i k i

 A limit for the aforementioned methods is their weakness in

accurate edge detection when SNR is very low.

 A possible solution in to extend their size: the result will be a  A possible solution in to extend their size: the result will be a

less accurate edge positioning but noise rejection will be higher. higher.

PREWITT METHOD 7X7 PREWITT METHOD 7X7

 Extension of Prewitt 3X3

       1 1 1 1 1 1 1 1 1 1 1 1

 Extension of Prewitt 3X3  Normalized impulse response:

                    1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

r

h                   1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

r

       1 1 1 1 1 1

slide-41
SLIDE 41

EX.: PREWITT 7X7 METHOD O

slide-42
SLIDE 42

ABDOU 7X7 METHOD ABDOU 7X7 METHOD

I filt k th t i li d i l i ht

 Is a filter mask that gives a linear decreasing sample weight as

they are farther from the edge. Its behaviour is close to a truncated pyramid truncated pyramid.

 The normalized impulse response is:

            1 2 2 2 2 1 1 1 1 1 1 1                1 2 3 3 2 1 1 2 3 3 2 1 1 2 2 2 2 1

r

h               1 2 2 2 2 1 1 2 3 3 2 1

r

         1 1 1 1 1 1

slide-43
SLIDE 43

EX.: ABDOU 7X7 METHOD OU O

slide-44
SLIDE 44

FURTHER EXTENDED OPERATORS FURTHER EXTENDED OPERATORS

 It is possible to obtain extended gradient filters for low SNR

t s poss b e to obta e te ded g ad e t te s o

  • S

conditions convolving a 3x3 operator with a low-pass filter.

) , ( * ) , ( ) , ( k j h k j h k j h

PG G

 HG (j,k) is one of the previously considered filters, HPB (j,k) is

the impulse response for a low-pass filter.

slide-45
SLIDE 45

EXAMPLE

 

EXAMPLE

Prewitt 3X3 convoled with:

h        1 9 1 1 1 1 1 1 *       9 1 1 1

...and we get the Smoothed Prewitt 5X5

  1 1 1 1           1 1 1 1 2 2 2 2 h              3 3 3 3 2 2 2 2         1 1 1 1

slide-46
SLIDE 46

LAPLACIAN BASED METHODS LAPLACIAN BASED METHODS

 1D Case

1D Case

Fi d i g f th d d i ti di g t

 Find zero-crossing of the second derivative, corresponding to

inflection points.

slide-47
SLIDE 47

LAPLACIAN LAPLACIAN

 For the 2D case the 2nd order differential operator

is the Laplacian

2 2 2 2 2

) , ( ) , ( )) , ( ( ) , ( y x f y x f y x f y x f           

Isotropic operator

2 2

y x  

Isotropic operator More sensible to noise with respect to gradient

 False edges can be generated due to noise  False edges can be generated due to noise.

Thinner edges are produced.

slide-48
SLIDE 48

ALGORITHM: CASE 2D ALGORITHM: CASE 2D

G di t

O x y ( , )

Gradient estimation

Yes Yes

2

O x y ( , ) 

) , (

2

y x f  edge N N

= 0 ?

2

threshold

f x y ( , )

No No

slide-49
SLIDE 49

ZERO-CROSSING WITHOUT THRESHOLD Sobel vs. Laplacian Sobel vs. Laplacian

slide-50
SLIDE 50

LAPLACIAN DISCRETIZATION LAPLACIAN DISCRETIZATION

Can be seen as the convolution of f(n1,n2) with the impulse h( ) f li t response h(n1,n2) of a linear system.

slide-51
SLIDE 51

4 NEIGHBOURS METHOD 4 NEIGHBOURS METHOD

S bl li d filt

 Separable normalized filter

 Unit gain for continuous component  The sign of h(n

h(n n ) can be changed itho t changes in

 The sign of h(n

h(n1,n2) can be changed without changes in the final result (since we are looking for zeros of laplacian)

    1                      2 1 4 1 1 2 1 4 1 ) , (

2 1 n

n h               1 1 1 4 4             1 1 4 1 4 1  

slide-52
SLIDE 52

EX.: 4 NEIGHBOURS METHOD G OU S O

slide-53
SLIDE 53

LAPLACIAN DISCRETIZATION LAPLACIAN DISCRETIZATION

 The laplacian can be approximated with finite

differences

) , ( ) , 1 ( ) , ( ) , ( k j f k j f y x f y x f     

differences

) , ( ) , 1 ( ) , ( k j f k j f y x f x

x

   ) (

2 f

 ) 1 ( ) ( 2 ) 1 ( ) , 1 ( ) , ( ) , ( ) , (

2 2

k f k f k f k j f k j f k j f x y x f

x x xx

       ) , 1 ( ) , ( 2 ) , 1 ( k j f k j f k j f     

slide-54
SLIDE 54

DISCRETIZATION EXAMPLES DISCRETIZATION EXAMPLES Prewitt method

 Not separable filter

h n n ( , )

1 2

1 8 1 1 1 1 8 1            

8 Neighbours method

( )

1 2

8 1 1 1         

8 Neighbours method

 Similar to Prewitt but with a separable formulation

                              1 4 1 2 1 2 1 2 2 2 1 1 1 1 1 2 1 1 2 1 1 ) ( n n h                             2 1 2 1 4 1 8 1 1 1 2 2 2 8 1 2 1 1 2 1 8 ) , (

2 1 n

n h

slide-55
SLIDE 55

EX.: 8 NEIGHBOURS METHOD 8 G OU S O

slide-56
SLIDE 56

EX.: PREWITT NOT SEPARABLE O S

slide-57
SLIDE 57

NOISE PRESENCE NOISE PRESENCE

 When noise is significant these filters could not be accurate for

diagonal edges. The Prewitt filter can work even in regions with high density of edges.           2 4 2 1 2 1 8 1 ) , (

2 1 n

n h

 Since ege are directional and noise can generate luminance

variations zero crossing for laplacian could find non correct         1 2 1 8 variations, zero-crossing for laplacian could find non-correct edges.

slide-58
SLIDE 58

EX.: LAPLACIAN FOR DIAGONAL EDGES C O GO G S

slide-59
SLIDE 59

SUPER RESOLUTION (LAPLACIAN) SUPER-RESOLUTION (LAPLACIAN)

First method.

 Given two neighbour pixels, mark as possible edge point

the intrapixels points if the laplacian values in the two i l h diff t i pixels have different signs.

 Assume as effective edge the point, among them, with the

largest gradient largest gradient.

 Apply this analysis to all the pixels couples. LAPLACIAN Sign analysis Magnitude comparison

     

2 3 4

I I I I I I                  

8 7 6 1 5

I I I I I I          

slide-60
SLIDE 60

SUPERRESOLUTION SUPERRESOLUTION

Second method: analytical approach

Approximate the continuous form of function f(n1,n2) with a

2D polynomial in order to describe the laplacian in an analytical way. analytical way.

Polynomial example:

2 2 2 2 2 2

ˆ

 where Ki are the weights obtained from the discrete image. 2 2 9 2 8 2 7 2 6 5 2 4 3 2 1

) , ( c r K rc K c r K c K rc K r K c K r K K c r F         

 r and c then become continuous variables

r and c then become continuous variables associtated to a discrete image matrix.

     ( ) , ( ) W r c W 1 2 1 2

 Polynomial formulation can be found with small efforts.

slide-61
SLIDE 61

SUPERRESOLUTION SUPERRESOLUTION

M th d 3 dg fitti g

 Method 3: edge fitting

Based on the comparison with an edge model based on

th i g l ti the image correlation.

 < s x ( )      a per x < x a + h per x x

 

L x0 2

 Exemple: comparison with a step function

 

 

L x

dx x s x f E

2

) ( ) (

the edge is accepted if the MSE is below a threshold.

slide-62
SLIDE 62

SUPERRESOLUTION SUPERRESOLUTION

f ( i )    a for (x cos +y sin )< ( , ) a+h for (x cos +y sin ) s x y           

 Case 2D

Compare f(x,y) with a 2D step, where  and

Compare f(x,y) with a 2D step, where  and  specify the distance and the angle, in polar coordinates of the edge point from the center of the considered circular the center of the considered circular region.

The edge is accepted if the MSE is below a

The edge is accepted if the MSE is below a Threshold

 

2

( , ) ( , ) MSE f x y s x y dxdy  

circle

slide-63
SLIDE 63

GAUSSIAN FILTERING GAUSSIAN FILTERING

Why we should use a gaussian function?

  • Since the Fourier transform of a Gaussian is still e gaussian,

g ,

  • The cut-off frequency can be expressed as a function of the width of the

impulse response

  • It has a low aliasing

It has a low aliasing

  • The filter is separable and isotropic at the same time

2 /

) ( ) ( ) ( ) , (

2 2

    x

e h y h x h y x h The noise sensitivity (numerous zero crossing) decrease as the

2

2 ) (  

 x

h y ( g) filter strength (width) increase.

slide-64
SLIDE 64

“LOG” OPERATOR LOG OPERATOR

Th l i fil h i bl ff

 The low pass gaussian filter has a variable cut-off

frequency.   

2 2

y x          

2

2 exp ) , ( y x y x h                   2 ) ( exp 2 ) , (

2 2 2 2 2 y x y x

H     2

 It follows that the standard deviation  is inversely

ti l t th filt idth proportional to the filter width.

slide-65
SLIDE 65

“LOG” operator “LOG” operator

 

) , ( * ) , ( ) , (

2

y x h y x f y x g  

LOG operator LOG operator

  • Laplacian and filtering are interchangeable since both of them

are linear

 

) , ( * ) , ( ) , (

2

y x h y x f y x g    

2 2 2 2 2

                

2 2 2 4 2 2 2 2 2

2 exp 2 ) , ( y x y x y x h

 

 

2 2 2 2 2 2

2 2 exp 2 ) , (

y x y x

y x h                     2    

slide-66
SLIDE 66

DIFFERENCE OF GAUSSIANS

The LOG, Laplacian of a Gaussian corresponds to the

DIFFERENCE OF GAUSSIANS

e OG, ap ac a o a Gauss a co espo ds o e derivative of a gaussian with respect to 22 The laplacian can be approximated with the difference of two gaussian filters with different .

slide-67
SLIDE 67

DOG APPLICATION DOG APPLICATION