+ All Categories
Home > Documents > Template Matching Using f Ncc

Template Matching Using f Ncc

Date post: 03-Jun-2018
Category:
Upload: karthik-sheshadri
View: 226 times
Download: 0 times
Share this document with a friend

of 8

Transcript
  • 8/12/2019 Template Matching Using f Ncc

    1/8

    T e m p l a t e M a t c h i n g u s i n g F a s t N o r m a l i z e d C r o s s C o r r e l a t i o n

    K a i B r i e c h l e a n d U w e D . H a n e b e c k

    I n s t i t u t e o f A u t o m a t i c C o n t r o l E n g i n e e r i n g , T e c h n i s c h e U n i v e r s i t a t M u n c h e n ,

    8 0 2 9 0 M u n c h e n , G e r m a n y

    A B S T R A C T

    I n t h i s p a p e r , w e p r e s e n t a n a l g o r i t h m f o r f a s t c a l c u l a t i o n o f t h e n o r m a l i z e d c r o s s c o r r e l a t i o n ( N C C ) a n d i t s a p p l i c a -

    t i o n t o t h e p r o b l e m o f t e m p l a t e m a t c h i n g . G i v e n a t e m p l a t e t , w h o s e p o s i t i o n i s t o b e d e t e r m i n e d i n a n i m a g e f , t h e

    b a s i c i d e a o f t h e a l g o r i t h m i s t o r e p r e s e n t t h e t e m p l a t e , f o r w h i c h t h e n o r m a l i z e d c r o s s c o r r e l a t i o n i s c a l c u l a t e d , a s

    a s u m o f r e c t a n g u l a r b a s i s f u n c t i o n s . T h e n t h e c o r r e l a t i o n i s c a l c u l a t e d f o r e a c h b a s i s f u n c t i o n i n s t e a d o f t h e w h o l e

    t e m p l a t e . T h e r e s u l t o f t h e c o r r e l a t i o n o f t h e t e m p l a t e t a n d t h e i m a g e f i s o b t a i n e d a s t h e w e i g h t e d s u m o f t h e

    c o r r e l a t i o n f u n c t i o n s o f t h e b a s i s f u n c t i o n s .

    D e p e n d i n g o n t h e a p p r o x i m a t i o n , t h e a l g o r i t h m c a n b y f a r o u t p e r f o r m F o u r i e r { t r a n s f o r m b a s e d i m p l e m e n t a t i o n s

    o f t h e n o r m a l i z e d c r o s s c o r r e l a t i o n a l g o r i t h m a n d i t i s e s p e c i a l l y s u i t e d t o p r o b l e m s , w h e r e m a n y d i e r e n t t e m p l a t e s

    a r e t o b e f o u n d i n t h e s a m e i m a g e f .

    K e y w o r d s : N o r m a l i z e d c r o s s c o r r e l a t i o n , i m a g e p r o c e s s i n g , t e m p l a t e m a t c h i n g , b a s i s f u n c t i o n s

    1 . I N T R O D U C T I O N

    A b a s i c p r o b l e m t h a t o f t e n o c c u r s i m a g e p r o c e s s i n g i s t o d e t e r m i n e t h e p o s i t i o n o f a g i v e n p a t t e r n i n a n i m a g e , o r

    p a r t o f a n i m a g e , t h e s o { c a l l e d r e g i o n o f i n t e r e s t . T h i s p r o b l e m i s c l o s e l y r e l a t e d t o t h e d e t e r m i n a t i o n o f a r e c e i v e d

    d i g i t a l s i g n a l i n s i g n a l p r o c e s s i n g u s i n g e . g . a m a t c h e d l t e r .

    T w o b a s i c c a s e s c a n b e d i e r e n t i a t e d :

    T h e p o s i t i o n o f t h e p a t t e r n i s u n k n o w n

    A n e s t i m a t e f o r t h e p o s i t i o n o f t h e p a t t e r n i s g i v e n

    U s u a l l y , b o t h c a s e s h a v e t o b e t r e a t e d t o s o l v e t h e p r o b l e m o f d e t e r m i n i n g t h e p o s i t i o n o f a g i v e n p a t t e r n i n a n

    i m a g e . I n t h e l a t t e r c a s e , t h e i n f o r m a t i o n a b o u t t h e p o s i t i o n o f t h e p a t t e r n c a n b e u s e d t o r e d u c e t h e c o m p u t a t i o n a l

    e o r t s i g n i c a n t l y . I t i s a l s o k n o w n a s f e a t u r e t r a c k i n g i n a s e q u e n c e o f i m a g e s .

    1 , 2

    F o r b o t h f e a t u r e t r a c k i n g a n d t h e i n i t i a l e s t i m a t i o n o f t h e p o s i t i o n o f t h e g i v e n p a t t e r n , a l o t o f d i e r e n t , w e l l {

    k n o w n a l g o r i t h m s h a v e b e e n d e v e l o p p e d .

    3 , 4

    O n e b a s i c a p p r o a c h t h a t c a n b e u s e d i n b o t h c a s e s m e n t i o n e d a b o v e ,

    i s t e m p l a t e m a t c h i n g . T h i s m e a n s t h a t t h e p o s i t i o n o f t h e g i v e n p a t t e r n i s d e t e r m i n e d b y a p i x e l - w i s e c o m p a r i s i o n

    o f t h e i m a g e w i t h a g i v e n t e m p l a t e , t h a t c o n t a i n s t h e d e s i r e d p a t t e r n . F o r t h i s , t h e t e m p l a t e i s s h i f t e d u d i s c r e t e

    s t e p s i n t h e x d i r e c t i o n a n d v s t e p s i n t h e y d i r e c t i o n o f t h e i m a g e , a n d t h e n t h e c o m p a r i s o n i s c a l c u l a t e d o v e r t h e

    t e m p l a t e a r e a f o r e a c h p o s i t i o n ( u v ) . T o c a l c u l a t e t h i s c o m p a r i s o n , n o r m a l i z e d c r o s s c o r r e l a t i o n i s a r e a s o n a b l e

    c h o i c e i n m a n y c a s e s .

    5

    N e v e r t h e l e s s , i t i s c o m p u t a t i o n a l l y e x p e n s i v e a n d t h e r e f o r e a f a s t c o r r e l a t i o n a l g o r i t h m t h a t

    r e q u i r e s l e s s c a l c u l a t i o n s t h a n t h e b a s i c v e r s i o n i s o f i n t e r e s t .

    I n s e c t i o n 2 , t h e p r o b l e m t r e a t e d i n t h i s p a p e r i s d e n e d a n d a b r i e f s u m m a r y o f t h e n o r m a l i z e d c r o s s c o r r e l a t i o n

    a l g o r i t h m i s g i v e n . S e c t i o n 3 i n t r o d u c e s a n e w , f a s t a l g o r i t h m t h a t c o m p u t e s t h e n o r m a l i z e d c r o s s c o r r e l a t i o n i n

    a n e c i e n t m a n n e r f o r a n a p p r o x i m a t i o n o f t h e t e m p l a t e . T h e p e r f o r m a n c e o f t h e n e w a l g o r i t h m i s c o m p a r e d t o

    s t a n d a r d n a i v e i m p l e m e n t a t i o n o f t h e n o r m a l i z e d c r o s s c o r r e l a t i o n a n d t o t h e w e l l { k n o w n F o u r i e r { t r a n s f o r m . S e c t i o n

    4 b r i e y d e s c r i b e s , h o w t h e a l g o r i t h m c a n b e a p p l i e d r e c u r s i v e l y . I n s e c t i o n 5 , a n e x a m p l e i s p r e s e n t e d , i n w h i c h t h e

    p r o p o s e d a l g o r i t h m i s a p p l i e d f o r t e m p l a t e m a t c h i n g . F i n a l l y a n o u t l o o k t o f u t u r e r e s e a r c h a c t i v i t i e s i s p r e s e n t e d .

    K . B r i e c h l e : E - m a i l : k a i . b r i e c h l e @ e i . t u m . d e

    U . D . H a n e b e c k : E - m a i l : u w e . h a n e b e c k @ e i . t u m . d e

    Page 1/8

  • 8/12/2019 Template Matching Using f Ncc

    2/8

    2 . N C C { A L G O R I T H M

    T h e p r o b l e m t r e a t e d i n t h i s p a p e r i s t o d e t e r m i n e t h e p o s i t i o n o f a g i v e n p a t t e r n i n a t w o d i m e n s i o n a l i m a g e f .

    L e t f ( x y ) d e n o t e t h e i n t e n s i t y v a l u e o f t h e i m a g e f o f t h e s i z e M

    x

    M

    y

    a t t h e p o i n t ( x y ) x 2 f 0 : : : M

    x

    1 g ,

    y 2 f 0 : : : M

    y

    1 g . T h e p a t t e r n i s r e p r e s e n t e d b y a g i v e n t e m p l a t e t o f t h e s i z e N

    x

    N

    y

    . A c o m m o n w a y t o

    c a l c u l a t e t h e p o s i t i o n ( u

    p o s

    v

    p o s

    ) o f t h e p a t t e r n i n t h e i m a g e f i s t o e v a l u a t e t h e n o r m a l i z e d c r o s s c o r r e l a t i o n v a l u e

    a t e a c h p o i n t ( u v ) f o r f a n d t h e t e m p l a t e t , w h i c h h a s b e e n s h i f t e d b y u s t e p s i n t h e x d i r e c t i o n a n d b y v s t e p s

    i n t h e y d i r e c t i o n . E q u a t i o n ( 1 ) g i v e s a b a s i c d e n t i o n f o r t h e n o r m a l i z e d c r o s s c o r r e l a t i o n c o e c i e n t .

    =

    P

    x y

    ( f ( x y )

    f

    u v

    ) ( t ( x u y v )

    t )

    q

    P

    x y

    ( f ( x y )

    f

    u v

    )

    2

    P

    x y

    ( t ( x u y v )

    t )

    2

    ( 1 )

    I n ( 1 )

    f

    u v

    d e n o t e s t h e m e a n v a l u e o f f ( x y ) w i t h i n t h e a r e a o f t h e t e m p l a t e t s h i f t e d t o ( u v ) w h i c h i s c a l c u l a t e d

    b y

    f

    u v

    =

    1

    N

    x

    N

    y

    u + N

    x

    1

    X

    x = u

    v + N

    y

    1

    X

    y = v

    f ( x y ) : ( 2 )

    W i t h s i m i l a r n o t a t i o n

    t i s t h e m e a n v a l u e o f t h e t e m p l a t e t . T h e d e n o m i n a t o r i n ( 1 ) i s t h e v a r i a n c e o f t h e z e r o

    m e a n i m a g e f u n c t i o n f ( x y )

    f

    u v

    a n d t h e s h i f t e d z e r o m e a n t e m p l a t e f u n c t i o n t ( x u y v )

    t . D u e t o t h i s

    n o r m a l i z a t i o n , ( u v ) i s i n d e p e n d e n t t o c h a n g e s i n b r i g h t n e s s o r c o n t r a s t o f t h e i m a g e , w h i c h a r e r e l a t e d t o t h e m e a n

    v a l u e a n d t h e s t a n d a r d d e v i a t i o n .

    T h e d e s i r e d p o s i t i o n ( u

    p o s

    v

    p o s

    ) o f t h e p a t t e r n , w h i c h i s r e p r e s e n t e d b y t , i s e q u i v a l e n t t o t h e p o s i t i o n ( u

    m a x

    v

    m a x

    )

    o f t h e m a x i m u m v a l u e

    m a x

    o f ( u v ) . D u e t o t h e n o r m a l i z a t i o n , t h e u s e o f ( 1 ) f o r t h e c a l c u l a t i o n o f t h e p o s i t i o n

    o f t h e p a t t e r n i s m o r e r o b u s t t h a n o t h e r s i m i l a r i t y m e a s u r e s , l i k e s i m p l e c o v a r i a n c e o r t h e s u m o f t h e a b s o l u t e

    d i e r e n c e s ( S A D ) . N e v e r t h e l e s s t h e m a i n d r a w b a c k i s , t h a t t h e c a l c u l a t i o n o f ( 1 ) i s c o m p u t a t i o n a l l y e x p e n s i v e . F o r

    t h e d e n o m i n a t o r , w h i c h n o r m a l i z e s t h e c r o s s c o r r e l a t i o n c o e c i e n t , a t e v e r y p o i n t ( u v ) u 2 f 0 : : : M

    x

    N

    x

    g ,

    v 2 f 0 : : : M

    y

    N

    y

    g o f t h e i m a g e , a t w h i c h ( u v ) i s d e t e r m i n e d , t h e e n e r g y o f t h e z e r o m e a n i m a g e

    e

    f

    ( u v ) =

    u + N

    x

    1

    X

    x = u

    v + N

    y

    1

    X

    y = v

    ( f ( x y )

    f

    u v

    )

    2

    ( 3 )

    a n d t h e m e a n o f t h e i m a g e w i t h i n t h e a r e a o f t h e t e m p l a t e f u n c t i o n

    f

    u v

    ( 2 ) h a v e t o b e r e c a l c u l a t e d . I f t h i s c a l c u l a t i o n

    i s i m p l e m e n t e d i n a s t r a i g h t f o r w a r d n a i v e w a y , a c c o r d i n g t o ( 1 ) , t h e n u m b e r o f c a l c u l a t i o n s i s p r o p o r t i o n a l t o

    N

    x

    N

    y

    ( M

    x

    N

    x

    ) ( M

    y

    N

    y

    ) , t h o u g h t h e e n e r g y o f t h e z e r o m e a n t e m p l a t e f u n c t i o n

    e

    t

    ( u v ) =

    N

    x

    X

    x = 1

    N

    y

    X

    y = 1

    ( t ( x y )

    t )

    2

    ( 4 )

    a n d t h e m e a n o f t h e t e m p l a t e f u n c t i o n

    t h a v e t o b e p r e c a l c u l a t e d o n l y o n c e . T h i s c o m p u t a t i o n a l e o r t i s n o t

    a c c e p t a b l e f o r m o s t p r a c t i c a l a p p l i c a t i o n s . T h e n o m i n a t o r i n ( 1 ) c a n b e c a l c u l a t e d i n t h e f r e q u e n c y r a n g e u s i n g

    t h e w e l l { k n o w n F o u r i e r { t r a n s f o r m , y e t t h e n u m b e r o f c a l c u l a t i o n s i s s t i l l c o m p a r a t i v l y h i g h , a n d a n a l g o r i t h m t h a t

    c a l c u l a t e s t h e n o r m a l i z e d c r o s s c o r r e l a t i o n w i t h l e s s c a l c u l a t i o n s i s o f g r e a t i n t e r e s t .

    T o o v e r c o m e t h e s e c o m p l e x i t y p r o b l e m s , a n e c i e n t m e t h o d t o c a l c u l a t e t h e d e n o m i n a t o r o f t h e n o r m a l i z e d

    c r o s s c o r r e l a t i o n c o e c i e n t i s p r o p o s e d b y L e w i s .

    5

    T h e m a i n i d e a i s t o p r e c a l c u l a t e s u m { t a b l e s c o n t a i n i n g t h e

    i n t e g r a l o v e r t h e i m a g e f u n c t i o n f ( x y ) a n d t h e s q u a r e d i m a g e f u n c t i o n f

    2

    ( x y ) ( r u n n i n g s u m ) o n c e f o r e a c h i m a g e

    f , a n d u s e t h e s e t a b l e s f o r e c i e n t c a l c u l a t i o n o f t h e e x p r e s s i o n ( f ( x y )

    f

    u v

    )

    2

    a t e a c h p o i n t ( u v ) , a t w h i c h t h e

    n o r m a l i z e d c r o s s c o r r e l a t i o n c o e c i e n t i s e v a l u a t e d . U s i n g t h e s e s u m { t a b l e s , t h e r e s u l t i n g n u m b e r o f c a l c u l a t i o n s f o r

    t h e d e n o m i n a t o r d o e s n o l o n g e r d e p e n d o n t h e s i z e o f t h e t e m p l a t e N

    x

    N

    y

    b u t o n l y o n t h e s i z e o f t h e i m a g e f u n c t i o n

    M

    x

    M

    y

    . A b r i e f d e s c r i p t i o n o f t h i s c a l c u l a t i o n i s g i v e n i n s e c t i o n 3 . 1 .

    I n s e c t i o n 3 . 2 t h e k e y i d e a , t h a t a l l o w s a v e r y e c i e n t c a l c u l a t i o n o f t h e n u m e r a t o r o f ( 1 ) i s e x p l a i n e d i n d e t a i l .

    T h u s , t h e n o r m a l i z e d c r o s s c o r r e l a t i o n c o e c i e n t ( 1 ) c a n b e c a l c u l a t e d f o r a n a p p r o x i m a t e d t e m p l a t e f u n c t i o n

    ~

    t ( x y )

    w i t h a n o r d e r o f m a g n i t u d e l e s s c a l c u l a t i o n s t h a n t h e s t a n d a r d F F T a p p r o a c h , w h i c h o p e n s u p m a n y n e w a p p l i c a t i o n s .

    Page 2/8

  • 8/12/2019 Template Matching Using f Ncc

    3/8

    3 . F A S T N C C { A L G O R I T H M

    3 . 1 . C a l c u l a t i o n o f t h e d e n o m i n a t o r

    T o s i m p l i f y t h e c a l c u l a t i o n o f t h e d e n o m i n a t o r o f t h e n o r m a l i z e d c r o s s c o r r e l a t i o n c o e c i e n t , t h e k e y i d e a i s t o u s e

    t w o s u m t a b l e s s ( u v ) a n d s

    2

    ( u v ) o v e r t h e i m a g e f u n c t i o n f ( x y ) a n d t h e i m a g e e n e r g y f

    2

    ( x y ) .

    5

    T h e s u m t a b l e

    o f t h e i m a g e f u n c t i o n i s r e c u r s i v e l y d e n e d b y

    s ( u v ) = f ( u v ) + s ( u 1 v ) + s ( u v 1 ) s ( u 1 v 1 ) : ( 5 )

    A s i m i l a r r e c u r s i v e d e n i t i o n f o r t h e s u m t a b l e o v e r t h e i m a g e e n e r g y i s g i v e n b y

    s

    2

    ( u v ) = f

    2

    ( u v ) + s

    2

    ( u 1 v ) + s

    2

    ( u v 1 ) s

    2

    ( u 1 v 1 ) ( 6 )

    w i t h s ( u v ) = s

    2

    ( u v ) = 0 w h e n e i t h e r u v < 0 . T h e f o l l o w i n g a l g o r i t h m f o r s i m p l i e d c a l c u l a t i o n o f t h e d e n o m i n a t o r

    c a n b e a p p l i e d t o t h e w h o l e i m a g e f u n c t i o n o r t o a n y s u b i m a g e o f t h e i m a g e f u n c t i o n f ( x y ) . T h e n t h e s u m t a b l e s

    h a v e t o c a l c u l a t e d o n l y f o r t h i s s u b i m a g e r e g i o n . W i t h t h e s e t a b l e s , ( 2 ) c a n b e c a l c u l a t e d i n a v e r y e c i e n t m a n n e r ,

    i n d e p e n d e n t o f t h e s i z e N

    x

    N

    y

    o f t h e t e m p l a t e

    u + N

    x

    1

    X

    x = u

    v + N

    y

    1

    X

    y = v

    f ( x y ) = s ( u + N

    x

    1 v + N

    y

    1 ) s ( u 1 v + N

    y

    1 ) s ( u + N

    x

    1 v 1 ) + s ( u 1 v 1 ) :

    ( 7 )

    I t c a n b e s e e n f r o m ( 7 ) , t h a t o n l y t h r e e a d d i t i o n s / s u b t r a c t i o n s a r e n e c e s s a r y t o e v a l u a t e t h e d o u b l e s u m o v e r f ( x y )

    b y e v a l u a t i o n o f t h e s u m { t a b l e s ( u v ) .

    T h e d e n o m i n a t o r o f ( 1 ) i s t h e n e v a l u a t e d u s i n g t h e r u n n i n g s u m t a b l e s ( 5 ) , ( 6 ) a n d

    X

    x

    X

    y

    ( f ( x y )

    f

    u v

    )

    2

    =

    X

    x

    X

    y

    f

    2

    ( x y ) 2

    f

    u v

    X

    x

    X

    y

    f ( x y ) +

    X

    x

    X

    y

    f

    2

    u v

    : ( 8 )

    I n ( 8 ) a n d a l l e q u a t i o n s i n t h e r e m a i n d e r o f t h i s p a r a g r a p h , t h e d o u b l e s u m

    P

    x

    P

    y

    i s e v a l u t a t e d o v e r t h e r e g i o n o f

    t h e t e m p l a t e , w h i c h m e a n s u < x < u + N

    x

    1 a n d v < y < v + N

    y

    1 . W i t h

    X

    x

    X

    y

    f

    2

    u v

    = N

    x

    N

    y

    1

    N

    x

    N

    y

    X

    x

    X

    y

    f ( x y )

    2

    ( 9 )

    ( 8 ) c a n b e s i m p l i e d t o

    X

    x

    X

    y

    ( f ( x y )

    f

    u v

    )

    2

    =

    X

    x

    X

    y

    f

    2

    ( x y )

    1

    N

    x

    N

    y

    X

    x

    X

    y

    f ( x y )

    2

    : ( 1 0 )

    T h e s u m e x p r e s s i o n s i n ( 1 0 ) o v e r f

    2

    ( x y ) a n d f ( x y ) c a n e c i e n t l y b e c a l c u l a t e d u s i n g t h e r u n n i n g s u m t a b l e s ( 5 ) ,

    ( 6 ) . M o r e o v e r , o n e s q u a r e r o o t h a s t o c a l c u l a t e d f o r e a c h p o i n t ( u v ) t o d e t e r m i n e t h e d e n o m i n a t o r o f ( 1 ) .

    5

    3 . 2 . C a l c u l a t i o n o f t h e n u m e r a t o r

    A p p l i c a t i o n o f t h e a l g o r i t h m p r e s e n t e d i n t h e l a s t s u b s e c t i o n a l l o w s e c i e n t c a l c u l a t i o n o f t h e d e n o m i n a t o r , b u t t h e

    n u m b e r o f c o m p u t a t i o n s r e q u i r e d t o c a l c u l a t e t h e n u m e r a t o r o f t h e N C C { c o e c i e n t ( 1 ) i s s t i l l c o m p a r a t i v e l y h i g h ,

    e v e n i f i t i s d o n e i n t h e f r e q u e n c y r a n g e w i t h a n F F T a l g o r i t h m . T h e r e f o r e , f u r t h e r s i m p l i c a t i o n o f t h i s c a l c u l a t i o n

    i s r e q u i r e d . T h e n u m e r a t o r c a n b e r e w r i t t e n a s

    N ( u v ) =

    X

    x

    X

    y

    f ( x y ) t

    0

    ( x u y v )

    f

    u v

    X

    x

    X

    y

    t

    0

    ( x u y v ) ( 1 1 )

    w h e r e t

    0

    ( x u y v ) i s t h e z e r o m e a n t e m p l a t e f u n c t i o n d e n e d b y

    t

    0

    ( x u y v ) = t ( x u y v )

    t : ( 1 2 )

    Page 3/8

  • 8/12/2019 Template Matching Using f Ncc

    4/8

    0

    5

    10

    15

    20

    0

    5

    10

    15

    200

    0.2

    0.4

    0.6

    0.8

    1

    N

    Nx

    y

    basis function

    F i g u r e 1 . A s i n g l e r e c t a n g u l a r b a s i s f u n c t i o n t

    i

    ( x y ) .

    A s t

    0

    ( x y ) h a s z e r o m e a n a n d t h u s a l s o z e r o s u m , t h e t e r m

    f

    u v

    P

    x

    P

    y

    t

    0

    ( x u y v ) i s z e r o a s w e l l ,

    5

    a n d t h e

    n u m e r a t o r o f ( 1 ) c a n w r i t t e n a s

    N ( u v ) =

    X

    x

    X

    y

    f ( x y ) t

    0

    ( x u y v ) : ( 1 3 )

    T h e b a s i c i d e a t o s i m p l i f y t h e c a l c u l a t i o n o f t h e n u m e r a t o r i s t o e x p a n d t h e z e r o m e a n t e m p l a t e f u n c t i o n t

    0

    ( x y ) t o

    t h e w e i g h t e d s u m o f K r e c t a n g u l a r b a s i s f u n c t i o n s t

    i

    , y i e l d i n g a n a p p r o x i m a t i o n

    ~

    t ( x y ) o f t h e t e m p l a t e f u n c t i o n

    ~

    t ( x y ) =

    K

    X

    i = 1

    k

    i

    t

    i

    ( x y ) : ( 1 4 )

    T h e n u m e r a t o r o f t h e n o r m a l i z e d c r o s s c o r r e l a t i o n c o e c i e n t c a n t h e n b e e c i e n t l y e v a l u a t e d w i t h t h i s a p p r o x i m a -

    t i o n . T h e b a s i s f u n c t i o n t

    i

    ( x y ) i s c o n s t a n t e q u a l 1 i n s i d e a n r e c t a n g u l a r a r e a x

    i

    l

    x x

    i

    u

    y

    i

    l

    y y

    i

    u

    a n d z e r o

    o t h e r w i s e . T h u s x

    i

    l

    a n d x

    i

    u

    a r e t h e i n d i c e s o f t h e l o w e r a n d t h e u p p e r b o u n d o f t h e r e c t a n g u l a r a r e a t h a t i s c o n s t a n t

    e q u a l 1 i n t h e x { d i r e c t i o n . y

    i

    l

    a n d y

    i

    u

    a r e t h e r e s p e c t i v e i n d i c e s i n t h e y { d i r e c t i o n . F i g u r e 1 s h o w s a n e x a m p l e f o r a

    r e c t a n g u l a r b a s i s f u n c t i o n t

    i

    ( x y ) w h e r e N

    x

    = N

    y

    = 2 0 . I t i s c o n s t a n t e q u a l o n e f o r 6 x 1 4 8 y 1 2 . T h e

    q u a l i t y o f t h e a p p r o x i m a t i o n

    ~

    t ( x y ) o f t h e o r i g i n a l z e r o m e a n t e m p l a t e f u n c t i o n t

    0

    ( x y ) d e p e n d s b o t h o n t h e c h o i c e

    o f t h e b a s i s f u n c t i o n s , t h a t m e a n s , o n t h e i r l o w e r a n d u p p e r b o u n d s x

    i

    l

    , x

    i

    u

    a n d y

    i

    l

    , y

    i

    u

    a n d o n t h e n u m b e r o f b a s i s

    f u n c t i o n s t h a t a r e u s e d .

    U s i n g t h e s u m e x p a n s i o n o f t h e t e m p l a t e f u n c t i o n

    ~

    t ( x y ) a l l o w s t o c a l c u l a t e a n a p p r o x i m a t i o n f o r t h e n u m e r a t o r

    o f t h e c r o s s c o r r e l a t i o n c o e c i e n t

    ~

    N ( u v ) =

    K

    X

    i = 1

    k

    i

    x

    i

    u

    + u

    X

    x = x

    i

    l

    + u

    y

    i

    u

    + v

    X

    y = y

    i

    l

    + v

    f ( x y ) ( 1 5 )

    w h e r e K i s t h e n u m b e r o f b a s i s f u n c t i o n s a n d k

    i

    i s t h e c o e c i e n t f o r b a s i s f u n c t i o n i . R e m e m b e r t h a t x

    i

    l

    a n d y

    i

    l

    d e n o t e t h e i n d i c e s o f t h e l o w e r l i m i t s o f b a s i c f u n c t i o n i a n d x

    i

    u

    a n d y

    i

    u

    s u b s e q u e n t l y a r e t h e i n d i c e s o f t h e u p p e r

    l i m i t s . ( 1 5 ) i s o b t a i n e d f r o m ( 1 3 ) u s i n g ( 1 4 ) , b e c a u s e t h e b a s i s f u n c t i o n s t

    i

    ( x y ) a r e e i t h e r c o n s t a n t o n e o r z e r o . W i t h

    t h e r u n n i n g s u m t a b l e o v e r t h e i m a g e f u n c t i o n ( 5 ) , t h a t h a s a l r e a d y b e e n c a l c u l a t e d t o s i m p l i f y t h e d e t e r m i n a t i o n o f

    t h e d e n o m i n a t o r , w h i c h c a n n o t b e c a l c u l a t e d i n t h e f r e q u e n c y r a n g e , t h e i n n e r d o u b l e s u m i n ( 1 5 ) c a n b e c a l c u l a t e d

    Page 4/8

  • 8/12/2019 Template Matching Using f Ncc

    5/8

    w i t h o n l y 3 a d d i t i o n / s u b t r a c t i o n o p e r a t i o n s .

    x

    i

    u

    X

    x = x

    i

    l

    y

    i

    u

    X

    y = y

    i

    l

    f ( x y ) = s ( x

    i

    u

    y

    i

    u

    ) s ( x

    i

    u

    y

    i

    l

    1 ) s ( x

    i

    l

    1 y

    i

    u

    ) + s ( x

    i

    l

    1 y

    i

    l

    1 ) : ( 1 6 )

    100 200 300 400 500 600

    50

    100

    150

    200

    250

    300

    350

    400

    450

    Template

    ( a ) I m a g e f u n c t i o n f ( x y ) .

    50 100 150 200 250 300 350 400 450 500 550

    50

    100

    150

    200

    250

    300

    350

    400

    Maximum

    ( b ) C r o s s c o r r e l a t i o n m a t r i x ( u v ) .

    250 260 270 280 290 300

    180

    190

    200

    210

    220

    230

    240

    ( c ) T e m p l a t e f u n c t i o n t ( x y ) .

    250

    260

    270280

    290

    300

    180

    190

    200210

    220

    230

    240

    0

    20

    40

    60

    80

    100

    ( d ) S u r f a c e p l o t o f t ( x y ) .

    250 260 270 280 290 300

    180

    190

    200

    210

    220

    230

    240

    ( e ) S u m E x p a n s i o n

    ~

    t ( x y ) .

    250

    260

    270

    280

    290

    300

    180

    190

    200

    210

    220

    230

    240

    50

    0

    50

    ( f ) S u r f a c e p l o t o f

    ~

    t ( x y ) .

    F i g u r e 2 . E x p e r i m e n t : T e m p l a t e m a t c h i n g w i t h f a s t n o r m a l i z e d c r o s s c o r r e l a t i o n .

    T h i s m e a n s , t h a t t h e n u m b e r o f c a l c u l a t i o n s r e q u i r e d t o d e t e r m i n e a n a p p r o x i m a t i o n f o r t h e n u m e r a t o r i n ( 1 )

    d e p e n d s o n l y o n t h e n u m b e r o f r e c t a n g u l a r b a s i s f u n c t i o n s u s e d , b u t n o t o n t h e i r s i z e . T h e a p p r o x i m a t e d c r o s s

    Page 5/8

  • 8/12/2019 Template Matching Using f Ncc

    6/8

    c o r r e l a t i o n c o e c i e n t ~ ( u v ) i s

    ~ ( u v ) =

    ~

    N ( u v )

    q

    P

    x y

    ( f ( x y )

    f

    u v

    )

    2

    P

    x y

    ( t ( x u y v )

    t )

    2

    ( 1 7 )

    w h o s e d e n o m i n a t o r i s e q u i v a l e n t t o ( 1 ) a n d c a n b e e c i e n t l y c a l c u l a t e d u s i n g t h e s u m { t a b l e s ( 5 ) , ( 6 ) . S u b s t i t u t i n g

    ( 1 5 ) a n d ( 1 6 ) n a l l y y i e l d s t h e f o l l o w i n g c o m p a c t f o r m u l a f o r t h e a p p r o x i m a t e d c r o s s c o r r e l a t i o n c o e c i e n t

    ~ ( u v ) =

    P

    K

    i = 1

    k

    i

    s ( x

    i

    u

    + u y

    i

    u

    + v ) s ( x

    i

    u

    + u y

    i

    l

    + v 1 ) s ( x

    i

    l

    + u 1 y

    i

    u

    + v ) + s ( x

    i

    l

    + u 1 y

    i

    l

    + v 1 )

    q

    P

    x y

    ( f ( x y )

    f

    u v

    )

    2

    P

    x y

    ( t ( x u y v )

    t )

    2

    :

    ( 1 8 )

    3 . 3 . A n a l y s i s o f c o m p l e x i t y f o r t h e c a l c u l a t i o n o f t h e n u m e r a t o r

    T h e n u m b e r o f c o m p u t a t i o n s r e q u i r e d t o c a l c u l a t e t h e n u m e r a t o r o f t h e N C C c o e c i e n t f o r a n i m a g e o f t h e s i z e

    M

    x

    * M

    y

    a n d a t e m p l a t e o f t h e s i z e N

    x

    * N

    y

    t h a t h a s b e e n a p p r o x i m a t e d w i t h K r e c t a n g u l a r b a s i s f u n c t i o n s i s g i v e n

    i n t a b l e 1 . I t c a n b e s e e n , t h a t t h e n u m b e r o f m u l t i p l i c a t i o n s d e p e n d s l i n e a r l y o n t h e n u m b e r o f b a s i s f u n c t i o n s K

    f o r a g i v e n i m a g e f u n c t i o n f ( x y ) . F o r e a c h p o i n t ( u v ) , a t w h i c h t h e n o r m a l i z e d c r o s s c o r r e l a t i o n c o e c i e n t ( u v )

    i s e v a l u a t e d , K m u l t i p l i c a t i o n s a r e r e q u i r e d t o c a l c u l a t e t h e n u m e r a t o r , o n e f o r e a c h b a s i s f u n c t i o n .

    I n c o n t r a s t t o t h i s , a d i r e c t e v a l u a t i o n o f ( u v ) r e q u i r e s N

    x

    N

    y

    m u l t i p l i c a t i o n s a t e a c h p o i n t ( u v ) a t w h i c h

    i s e v a l u a t e d . T h e c o m p l e x i t y o f t h e F F T d e p e n d s o n t h e s i z e o f t h e t e m p l a t e a n d t h e i m a g e f u n c t i o n .

    6

    W h e n M i s

    m u c h l a r g e r t h a n N i t m a y e v e n e x c e e d t h e n u m b e r o f c o m p u t a t i o n s r e q u i r e d b y t h e d i r e c t m e t h o d . I n d e p e n d e n t o f

    M a n d N i t c a n a l s o b y f a r e x c e e d t h e n u m b e r o f c o m p u t a t i o n s r e q u i r e d b y t h e p r o p o s e d a l g o r i t h m d e p e n d i n g o n

    t h e n u m b e r o f b a s i s f u n c t i o n s K .

    T h e n u m b e r o f c o m p u t a t i o n s r e q u i r e d t o s e t u p t h e s u m { t a b l e s a n d e v a l u a t e t h e d e n o m i n a t o r o f t h e n o r m a l i z e d

    c r o s s c o r r e l a t i o n c o e c i e n t i s n o t r e g a r d e d i n t a b l e 1 a n d t a b l e 2 . T o c a l c u l a t e t h e d e n o m i n a t o r , t h a t n o r m a l i z e s

    t h e c r o s s c o r r e l a t i o n c o e c i e n t , t h e m e t h o d p r o p o s e d b y L e w i s

    5

    i s f a r m o r e e c i e n t t h a n a n a i v e , d i r e c t c a l c u l a t i o n .

    T h u s t h e c o m p u t a t i o n s t o s e t u p t h e s u m { t a b l e s a r e n e c e s s a r y f o r a l l t h r e e m e t h o d s d i c u s s e d h e r e a n d a r e n o t

    i n c l u d e d i n t h e c o m p a r i s o n . O f c o u r s e , t h e p r o p o s e d a l g o r i t h m f o r c a l c u l a t i o n o f t h e n o m i n a t o r c a n a l s o b e a p p l i e d

    t o c a l c u l a t e e c i e n t l y a n o r d i n a r y c r o s s c o r r e l a t i o n w i t h o u t n o r m a l i z a t i o n , b u t t h e n t h e e x t r a e o r t t o s e t u p t h e

    s u m t a b l e s h a s t o b e t a k e n i n t o a c c o u n t c o m p a r e d t o t h e s t a n d a r d F F T , t h a t d o e s n o t r e q u i r e a n y s u m { t a b l e s .

    A d d / S u b M u l t

    D i r e c t c a l c . N

    x

    N

    y

    ( M

    x

    N

    x

    + 1 ) ( M

    y

    N

    y

    + 1 ) N

    x

    N

    y

    ( M

    x

    N

    x

    + 1 ) ( M

    y

    N

    y

    + 1 )

    F F T 9 M

    x

    M

    y

    l o g

    2

    ( M

    x

    M

    y

    ) 6 M

    x

    M

    y

    l o g

    2

    ( M

    x

    M

    y

    )

    N e w a l g . ( 4 K 1 ) ( M

    x

    N

    x

    + 1 ) ( M

    y

    N

    y

    + 1 ) K ( M

    x

    N

    x

    + 1 ) ( M

    y

    N

    y

    + 1 )

    T a b l e 1 . A n a l y s i s o f C o m p l e x i t y , n u m e r a t o r o n l y .

    M

    x

    = 6 4 0 , M

    y

    = 4 8 0 ,

    N

    x

    = N

    y

    = 6 4 , K = 3

    A d d / S u b M u l t

    D i r e c t c a l c . 9 8 5 . 5 M i o 9 8 5 . 5 M i o

    F F T 5 0 . 4 M i o 3 3 . 6 M i o

    N e w a l g . 2 . 6 5 M i o 0 . 7 2 M i o

    T a b l e 2 . A n a l y s i s o f C o m p l e x i t y , E x a m p l e .

    3 . 4 . D e t e r m i n a t i o n o f b a s i s f u n c t i o n s

    T o a p p l y t h e p r o p o s e d a l g o r i t h m f o r e c i e n t c a l c u l a t i o n o f t h e n u m e r a t o r o f ( 1 ) , a s e t o f b a s i s f u n c t i o n s t

    i

    h a s t o

    b e d e t e r m i n e d t o a p p r o x i m a t e t h e o r i g i n a l t e m p l a t e f u n c t i o n . F o r s i m p l e t e m p l a t e f u n c t i o n s t ( x y ) , a s e t o f b a s i s

    Page 6/8

  • 8/12/2019 Template Matching Using f Ncc

    7/8

    f u n c t i o n s c a n b e d e t e r m i n e d m a n u a l l y , a s s h o w n i n s e c t i o n 5 . F o r a u t o m a t i c d e t e r m i n a t i o n o f t h e b a s i s f u n c t i o n s ,

    t h e q u a d r a t i c c r i t e r i o n

    J =

    X

    x y

    ( t

    0

    ( x y )

    ~

    t ( x y ) )

    2

    ( 1 9 )

    i s u s e d t o a s s e s s t h e q u a l i t y o f t h e a p p r o x i m a t i o n . A r e c u r s i v e a l g o r i t h m d i v i d e s t h e t e m p l a t e f u n c t i o n t ( x y ) i n t o

    r e c t a n g u l a r b a s i s f u n c t i o n s . I t s t a r t s w i t h a s i n g l e b a s i s f u n c t i o n t

    1

    ( x y ) =

    t = c o n s t a n t a n d c a l c u l a t e s J u s i n g ( 1 4 )

    a n d ( 1 9 ) . I f J > J

    m a x

    , w h e r e J

    m a x

    i s a p r e d e n e d t h r e s h o l d , t h e b a s i s f u n c t i o n i s d e v i d e d i n t o t w o b a s i s f u n c t i o n s

    a n d t h e c o e c i e n t s k

    i

    i = 1 2 a r e r e c a l c u l a t e d u n d e r t h e c o n d i t i o n , t h a t J i s m i n i m i z e d . T h i s p r o c e s s i s c o n t i n u e d

    r e c u r s i v e l y f o r e a c h b a s i s f u n c t i o n t

    i

    u n t i l J < J

    m a x

    . N o t e , h o w e v e r , t h a t t h e a p p r o x i m a t i o n f o u n d b y t h i s a l g o r i t h m

    i s n o t g l o b a l l y o p t i m a l w i t h r e g a r d t o t h e n u m b e r o f b a s i s f u n c t i o n s r e q u i r e d t o a p p r o x i m a t e t h e t e m p l a t e . T h i s

    m e a n s , t h a t a d i e r e n t a p p r o x i m a t i o n m i g h t h a v e t h e s a m e q u a l i t i y J , b u t u s e s l e s s t h a n K b a s i s f u n c t i o n s t

    i

    . M a n y

    f e a t u r e s e n c o u n t e r e d i n a n i n d o o r e n v i r o n m e n t c a n n e v e r t h e l e s s b e w e l l a p p r o x i m a t e d w i t h a f e w b a s i s f u n c t i o n s b y

    m e a n s o f t h e r e c u r s i v e a l g o r i t h m . T h e n u m b e r o f c o m p u t a t i o n s r e q u i r e d t o c a l c u l a t e t h e a p p r o x i m a t e d n u m e r a t o r

    o f ( 1 ) i s d i r e c t l y p r o p o r t i o n a l t o t h e n u m b e r o f b a s i s f u n c t i o n s K t h a t a r e u s e d f o r t h e a p p r o x i m a t i o n . T h e r e f o r e , a

    s m a l l n u m b e r o f w e l l { c h o s e n b a s i s f u n c t i o n s i s d e s i r a b l e . O n t h e o t h e r h a n d , u s i n g t o f e w b a s i s f u n c t i o n s r e s u l t s i n a

    b a d a p p r o x i m a t i o n o f t h e t e m p l a t e a n d t h u s o f t h e n u m e r a t o r ( 1 ) . A u t o m a t i c d e t e r m i n a t i o n o f t h e b a s i s f u n c t i o n s

    a l l o w s t o d e t e r m i n e a t r a d e { o b e t w e e n c o m p l e x i t y o f t h e c a l c u l a t i o n a n d t h e a p p r o x i m a t i o n e r r o r .

    4 . R E C U R S I V E A P P L I C A T I O N O F T H E A L G O R I T H M

    A s p o i n t e d o u t i n t h e l a s t s e c t i o n , t h e q u a l i t i y o f t h e a p p r o x i m a t i o n o f t h e t e m p l a t e d i r e c t l y e e c t s t h e r e s u l t o f

    t h e p r o p o s e d a l g o r i t h m , t h e a p p r o x i m a t e d n u m e r a t o r o f ( 1 ) . T h e r e s u l t s o f t h e d i r e c t c a l c u l a t i o n a n d t h e p r o p o s e d

    a l g o r i t h m a r e t h e s a m e , i f K = N

    x

    N

    y

    b a s i s f u n c t i o n s a r e u s e d t o r e p r e s e n t t h e t e m p l a t e . N e v e r t h e l e s s t h i s i s n o t

    p r a c t i c a l , a s t h e c o m p u t a t i o n a l c o m p l e x i t y o f t h e p r o p o s e d a l g o r i t h m c o n v e r g e s t o t h a t o f a d i r e c t c a l c u l a t i o n o f

    ( u v ) a n d t h u s e x c e e d s t h e c o m p l e x i t y o f t h e F F T b a s e d c a l c u l a t i o n .

    A s l o n g a s t h e a p p r o x i m a t i o n o f t h e t e m p l a t e f u n c t i o n i s s u c i e n t l y g o o d , t h e p a t t e r n r e p r e s e n t e d b y t ( x y ) i s

    r o b u s t l y d e t e c t e d u s i n g t h e m a x i m u m v a l u e o f ~ ( u v ) w i t h v e r y l i t t l e c o m p u t a t i o n a l e o r t , a s s h o w n i n t h e e x p a m p l e

    i n c h a p t e r 5 . I f t h e a p p r o x i m a t i o n o f t h e t e m p l a t e t ( x y ) c a l c u l a t e d b y t h e a l g o r i t h m p r o p o s e d i n s u b s e c t i o n 3 . 4 i s

    n o t g o o d e n o u g h t o y i e l d a s u c i e n t l y g o o d a p p r o x i m a t i o n o f t h e n o r m a l i z e d c r o s s c o r r e l a t i o n c o e c i e n t ( u v ) , t h e

    p r o p o s e d a l g o r i t h m i s a p p l i e d r e c u r s i v e l y . T h e d e n i t i o n o f a s u c i e n t l y g o o d a p p r o x i m a t i o n d e p e n d s o n t h e g i v e n

    p r o b l e m . I n t e m p l a t e m a t c h i n g a p p l i c a t i o n s , i t i s n e c e s s a r y t o d e t e r m i n e t h e p o s i t i o n o f t h e t e m p l a t e i n a n i m a g e

    b y s e a r c h i n g t h e m a x i m u m o f ( u v ) . I n t h i s c o n t e x t , a g o o d a p p r o x i m a t i o n m e a n s t h a t t h e m a x i m u m o f ~ ( u v ) i s

    e q u a l o r c l o s e t o t h e m a x i m u m o f ( u v ) .

    F o r a r e c u r s i v e a p p l i c a t i o n o f t h e p r o p o s e d a l g o r i t h m , t h e c r o s s c o r r e l a t i o n c o e c i e n t ~ ( u v ) i s c a l c u l a t e d w i t h

    a p p r o x i m a t i o n s o f t h e t e m p l a t e f u n c t i o n t ( x y ) t h a t u s e a n i n c r e a s i n g n u m b e r o f b a s i s f u n c t i o n s i n e a c h s t e p o f t h e

    r e c u r s i o n . I n t h e r s t s t e p , ~ ( u v ) i s c a l c u l a t e d w i t h a v e r y r o u g h a p p r o x i m a t i o n o f t ( x y ) u s i n g o n l y a f e w b a s i s

    f u n c t i o n s . T h e m a x i m u m e r r o r i n ~ ( u v ) o b t a i n e d b y t h i s a p p r o x i m a t i o n c a n b e e s t i m a t e d . T h i s e r r o r b o u n d i s

    t h e n u s e d t o d e t e r m i n e a s u b s e t f

    2

    ( x y ) o f a l l p i x e l s o f t h e i m a g e f u n c t i o n f ( x y ) . F o r t h i s s u b s e t , t h e p r o p o s e d

    a l g o r i t h m i s a p p l i e d r e c u r s i v e l y w i t h a b e t t e r a p p r o x i m a t i o n o f t ( x y ) , y i e l d i n g a s m a l l e r s u b s e t f

    3

    ( x y ) . T h e p r o c e s s

    s t o p s w h e n t h e n u m b e r o f p i x e l s i n t h e s u b s e t f

    N

    ( x y ) o f f ( x y ) i s s u c i e n t l y s m a l l . T h e c o r r e c t m a x i m u m v a l u e o f

    ( u v ) c a n t h e n b e f o u n d b y d i r e c t e v a l u a t i o n o f ( 1 ) o n s u b s e t f

    N

    ( x y ) , w h i c h i s e q u i v a l e n t t o u s i n g a r e p r e s e n t a t i o n

    w i t h t h e m a x i m u m n u m b e r o f b a s i s f u n c t i o n s K = N

    x

    N

    y

    a n d t h e p r o p o s e d a l g o r i t h m .

    5 . E X A M P L E

    F i g u r e 2 a ) s h o w s a n o r m a l c a m e r a i m a g e t a k e n f r o m a t y p i c a l i n d o o r e n v i r o n m e n t . T h e h a n d l e o f t h e d o o r i s t h e

    p a t t e r n t o b e f o u n d w i t h i n t h i s i m a g e . T h e t e m p l a t e f u n c t i o n t ( x y ) o f t h e p a t t e r n , w h i c h h a s t h e s i z e 6 4 6 4

    i s d i s p l a y e d m a g n i e d i n F i g . 2 c ) . T h i s t e m p l a t e c a n w e l l b e a p p r o x i m a t e d b y t h e w e i g h t e d s u m o f 3 r e c t a n g u l a r

    b a s i s f u n c t i o n s , w h i c h y i e l d s a n e w t e m p l a t e f u n c t i o n

    ~

    t ( x y ) ( F i g . 2 e ) . T h e b a s i s f u n c t i o n s w o u l d n o r m a l l y b e

    c a l c u l a t e d w i t h t h e p r o p o s e d r e c u r s i v e a l g o r i t h m , b u t t h i s w o u l d l e a d t o a w o r s e a p p r o x i m a t i o n u s i n g m o r e b a s i s

    f u n c t i o n . T h e r e f o r e f o r t h i s e x a m p l e , t h e t h r e e b a s i s f u n c t i o n s t

    i

    w e r e s e l e c t e d m a n u a l l y t o d e m o n s t r a t e h o w t h e

    c r o s s c o r r e l a t i o n a l g o r i t h m w o r k s . A s i m i l a r , b u t l e s s o b v i o u s r e s u l t c a n b e o b t a i n e d w i t h a w o r s e a p p r o x i m a t i o n ,

    t h a t i s a u t o m a t i c a l l y c o m p u t e d . N o t e t h a t t h e a p p r o x i m a t e d t e m p l a t e f u n c t i o n

    ~

    t ( x y ) h a s z e r o m e a n . F i g u r e 2 d )

    Page 7/8

  • 8/12/2019 Template Matching Using f Ncc

    8/8

    a n d e ) s h o w a s u r f a c e p l o t o f t h e o r i g i n a l a n d t h e a p p r o x i m a t e d t e m p l a t e f u n c t i o n t ( x y ) a n d

    ~

    t ( x y ) . T h e h e i g h t o f

    t h e p l o t c o r r e s p o n d s t o t h e v a l u e o f t h e f u n c t i o n t ( x y ) a n d

    ~

    t ( x y ) a t t h e p o i n t ( x y ) .

    N o t e , h o w e v e r , t h a t t h e v a l u e s 5 1 8 a n d 3 0 o f

    ~

    t ( x y ) a r e n o t e q u a l t o t h e c o e c i e n t s k

    i

    o f t h e K = 3 b a s i s

    f u n c t i o n s , b e c a u s e t h e b a s i s f u n c t i o n s t

    i

    ( x y ) o v e r l a p i n t h i s e x a m p l e . T h i s m e a n s , t h a t t h e c o e c i e n t o f t h e s m a l l e s t

    r e c t a n g l e i s c a l c u l a t e d t a k i n g i n t o a c c o u n t t h e t w o o u t e r r e c t a n g l e s , a s t h e a c t u a l v a l u e o f

    ~

    t ( x y ) i n t h e a r e a o f t h e

    s m a l l e s t r e c t a n g l e i s e q u a l t o t h e w e i g h t e d s u m o f a l l t h r e e b a s i s f u n c t i o n s .

    I n F i g . 2 b ) t h e r e s u l t i n g c r o s s c o r r e l a t i o n f u n c t i o n ~ ( u v ) o f t h e N C C c o m p u t e d w i t h t h e a l g o r i t h m ( 9 ) ( 1 0 )

    i s g i v e n . D a r k p i x e l s c o r r e s p o n d t o h i g h v a l u e s o f ~ t h a t a r e c l o s e t o o n e , a n d l i g h t p i x e l s t o l o w v a l u e s c l o s e t o

    1 . D e s p i t e t h e r o u g h a p p r o x i m a t i o n o f t h e t e m p l a t e f u n c t i o n ( F i g . 2 e ) ) , t h e f a s t N C C { a l g o r i t h m d e t e r m i n e s t h e

    p o s i t i o n o f t h e t e m p l a t e i n t h e o r i g i n a l i m a g e c o r r e c t l y , y i e l d i n g t h e m a x i m u m v a l u e o f ~ ( u v ) a t x y ]

    0

    = 2 4 5 1 7 8 ]

    0

    .

    5 . 1 . E c i e n c y

    F o r t h e e x a m p l e t h a t u s e s a V G A - c a m e r a i m a g e , t h e s i z e o f t h e i m a g e f u n c t i o n i s 6 4 0 4 8 0 p i x e l a n d 6 4 6 4

    p i x e l s f o r t h e t e m p l a t e f u n c t i o n . T a b l e 2 s h o w s , t h a t t h e n u m b e r o f m u l t i p l i c a t i o n s f o r t h e n u m e r a t o r i s r e d u c e d 4 7

    t i m e s c o m p a r e d t o t h e F F T a n d 2 0 4 8 t i m e s c o m p a r e d t o a d i r e c t c a l c u l a t i o n , a s s u m i n g t h a t t h e s u m t a b l e s u s e d

    f o r c a l c u l a t i n g t h e d e n o m i n a t o r a r e r e q u i r e d f o r e a c h a l g o r i t h m . T h i s m e a n s , t h a t u p t o 1 4 0 b a s i s f u n c t i o n s m a y

    b e u s e d , b e f o r e t h e c o m p u t a t i o n a l l o a d i s e q u i v a l e n t t o t h e F F T a l g o r i t h m . I t i s a s s u m e d t h a t t h e F F T a l g o r i t h m

    r e q u i r e s t h a t f a n d t b e e x t e n d e d w i t h z e r o s t o a c o m m o n p o w e r o f t w o ( z e r o p a d d i n g ) .

    6 . C O N C L U S I O N S

    A n e w f a s t a l g o r i t h m f o r t h e c o m p u t a t i o n o f t h e n o r m a l i z e d c r o s s c o r r e l a t i o n h a s b e e n d e r i v e d , t h a t u s e s a s u m

    e x p a n s i o n o f t h e g i v e n t e m p l a t e f u n c t i o n t a n d r e c t a n g u l a r b a s i s f u n c t i o n s t

    i

    ( x y ) . T h e n u m b e r o f c a l c u l a t i o n s

    r e q u i r e d t o e v a l u a t e t h e n o r m a l i z e d c r o s s c o r r e l a t i o n c o e c i e n t ( u v ) f o r t h e i m a g e f u n c t i o n f ( x y ) d e p e n d s l i n e a r l y

    o n t h e n u m b e r o f b a s i s f u n c t i o n s u s e d , b u t n o t o n t h e s i z e o f t h e t e m p l a t e t . I t h a s b e e n d e m o n s t r a t e d , t h a t t h e

    p o s i t i o n o f a s i m p l e f e a t u r e l i k e a d o o r h a n d l e c a n b e d e t e r m i n e d i n a V G A c a m e r a i m a g e w i t h a 4 7 t i m e s l e s s

    m u l t i p l i c a t i o n s c o m p a r e d t o a n e v a l u a t i o n o f ( u v ) t h a t u s e s t h e F F T . T h i s m a k e s t h e p r o p o s e d a l g o r i t h m a t t r a c t i v e

    f o r r e a l t i m e i m a g e p r o c e s s i n g a p p l i c a t i o n s l i k e f e a t u r e t r a c k i n g .

    A C K N O W L E D G M E N T S

    T h i s r e s e a r c h h a s b e e n s p o n s o r e d b y t h e B a v a r i a n R e s e a r c h F o u n d a t i o n ( B F S ) a s p a r t o f t h e p r o j e c t " D I R O K O L " .

    R E F E R E N C E S

    1 . G r e g o r y D . H a g e r a n d K e n t a r o T o y a m a , T h e X V i s i o n S y s t e m : A G e n e r a l { P u r p o s e S u b s t r a t e f o r P o r t a b l e R e a l -

    T i m e V i s i o n A p p l i c a t i o n s C o m p u t e r V i s i o n a n d I m a g e U n d e r s t a n d i n g , V o l u m e 6 9 , N u m b e r 1 , p p . 2 3 - 3 7 , 1 9 9 8 .

    2 . B . D . L u c a s a n d T . K a n a d e , A n I t e r a t i v e I m a g e R e g i s t r a t i o n T e c h n i q u e w i t h a n A p p l i c a t i o n t o S t e r e o V i s i o n ,

    I J C A I 1 9 8 1 .

    3 . H i r o c h i k a I n o u e , T e t s u y a T a c h i k a w a a n d M a s a y u k i I n a b a , R o b o t V i s i o n S y s t e m w i t h a C o r r e l a t i o n C h i p f o r R e a l {

    t i m e T r a c k i n g , O p t i c a l F l o w a n d D e p t h M a p G e n e r a t i o n , P r o c e e d i n g s o f t h e I E E E I n t e r n a t i o n a l C o n f e r e n c e o n

    R o b o t i c s a n d A u t o m a t i o n , p p 1 6 2 1 - 1 6 2 6 , F r a n c e , 1 9 9 2 .

    4 . C h a n g m i n g S u n , A F a s t S t e r e o M a t c h i n g M e t h o d , D i g i t a l I m a g e C o m p u t i n g : T e c h n i q u e s a n d A p p l i c a t i o n s , p p .

    9 5 - 1 0 0 , M a s s e y U n i v e r s i t y , A u c k l a n d , N e w Z e a l a n d , 1 0 - 1 2 D e c e m b e r 1 9 9 7 .

    5 . J . P . L e w i s , F a s t N o r m a l i z e d C r o s s { C o r r e l a t i o n , I n d u s t r i a l L i g h t a n d M a g i c .

    6 . R a f a e l C . G o n z a l e s , P a u l W i n t z , D i g i t a l I m a g e P r o c e s s i n g , S e c o n d E d i t i o n , A d d i s o n { W e s l e y P u b l i s h i n g C o m -

    p a n y , R e a d i n g , M a s s a c h u s e t t s , N o v e m b e r 1 9 8 7 , I S B N 0 - 2 0 1 - 1 1 0 2 6 - 1 .

    Page 8/8


Recommended