Fast Gaussian Filtering Algorithm Using Splines Kentaro Imajo (M2, - - PowerPoint PPT Presentation

fast gaussian filtering algorithm using splines
SMART_READER_LITE
LIVE PREVIEW

Fast Gaussian Filtering Algorithm Using Splines Kentaro Imajo (M2, - - PowerPoint PPT Presentation

@imos http://imoz.jp/ /23 Fast Gaussian Filtering Algorithm Using Splines Kentaro Imajo (M2, Kyoto University) November 12, International Conference on Pattern Recognition 2012 1 /23 Contents 1. Background and Goal 2. Approximation of


slide-1
SLIDE 1

@imos http://imoz.jp/

/23

Fast Gaussian Filtering Algorithm Using Splines

Kentaro Imajo (M2, Kyoto University)

November 12, International Conference on Pattern Recognition 2012

1

slide-2
SLIDE 2

/23

Contents

  • 1. Background and Goal
  • 2. Approximation of Gaussian Function
  • 3. 1D Convolution
  • 4. 2D Convolution
  • 5. Outline of Algorithm
  • 6. Experiments
  • 7. Conclusions

November 12, International Conference on Pattern Recognition 2012

Chapter 0. Contents 2

slide-3
SLIDE 3

/23

Background and Goal

Chapter 1 of 7

November 12, International Conference on Pattern Recognition 2012

Chapter 1. Background and Goal 3

slide-4
SLIDE 4

/23

Background

Many algorithms such as SIFT need to compute Gaussian filter.

Chapter 1. Background and Goal

November 12, International Conference on Pattern Recognition 2012

* =

2D Gaussian Func.

Figure Image Blurred by 2D Gaussian Filter

convolution

4

slide-5
SLIDE 5

/23

Gaussian Filter

Gaussian Filter is computed by convolutions with 2D Gaussian function. 2D Gaussian Function: where σ is spread.

Chapter 1. Background and Goal

November 12, International Conference on Pattern Recognition 2012

1 √ 2πσ exp

  • −x2 + y2

2σ2

  • Circle

5

slide-6
SLIDE 6

/23

Propose an algorithm to compute one Gaussian-filtered pixel in constant time to area size n (∝ σ2). Naïve method requires O(n) time.

Goal

Chapter 1. Background and Goal

November 12, International Conference on Pattern Recognition 2012

×

Area size is n Target Pixel

6

slide-7
SLIDE 7

/23

Preceding Methods

  • Naïve method takes O(n) time.
  • FFT method is fast for all pixels,

but it cannot compute pixels apart.

  • Down-sampling method has

large errors. Within 3% error in constant time

Chapter 1. Background and Goal

November 12, International Conference on Pattern Recognition 2012

7

slide-8
SLIDE 8

/23

Approximation of Gaussian Function

Chapter 2 of 7

Chapter 2. Approximation of Gaussian Function

November 12, International Conference on Pattern Recognition 2012

8

slide-9
SLIDE 9

/23

Spline

Approximate Gaussian function with a spline, which is written as: where a, b, n are parameters, and (・)+ is max(・, 0). * Coordinates b are control points.

Chapter 2. Approximation of Gaussian Function

November 12, International Conference on Pattern Recognition 2012

˜ ψ(x) =

  • i

ai (x − bi)n

+

9

slide-10
SLIDE 10

/23

  • 15
  • 12.5
  • 10
  • 7.5
  • 5
  • 2.5

2.5 5 7.5 10 12.5 15 80 160 240

˜ ψ(x) = 3(x + 11)2

+ 11(x + 3)2 +

+11(x 3)2

+ 3(x 11)2 +,

  • 2.657 102 exp
  • x2

5.27202

  • .

Approximation

Chapter 2. Approximation of Gaussian Function

November 12, International Conference on Pattern Recognition 2012

10

× × × ×

Approximation

Gaussian func.

×

Control points

slide-11
SLIDE 11

/23

Evaluation

Approximation error is about 2%. (2D error is about 3%.) Higher order improves more: Approximation error of 4th order approximation is about 0.3%.

Chapter 2. Approximation of Gaussian Function

November 12, International Conference on Pattern Recognition 2012

11

˜ ψ(x) = 70(x + 22)4

+ − 624(x + 11)4 + + 1331(x + 4)4 +

−1331(x − 4)4

+ + 624(x − 11)4 + − 70(x − 22)4 +.

slide-12
SLIDE 12

/23

1D Convolution

Chapter 3 of 7

Chapter 3. 1D Convolution

November 12, International Conference on Pattern Recognition 2012

12

slide-13
SLIDE 13

/23

Convolution

Convolution of a signal and a spline. Key Idea: Splines get discrete by differentiation.

Chapter 3. 1D Convolution

November 12, International Conference on Pattern Recognition 2012

13

  • 12
  • 8
  • 4
4 8 12
  • 240
  • 160
  • 80
80 160 240
  • 12
  • 8
  • 4
4 8 12
  • 25
25
  • 12
  • 8
  • 4
4 8 12
  • 10
  • 5
5 10
  • 12
  • 8
  • 4
4 8 12
  • 12
  • 8
  • 4
4 8 12

Differentiate

slide-14
SLIDE 14

/23

Transformation

Transform convolution into summation.

Chapter 3. 1D Convolution

November 12, International Conference on Pattern Recognition 2012

14

( ˜ ψ ∗ I)(x) =

  • ∆x∈Z

˜ ψ(∆x)I(x − ∆x) =

  • ∆x∈Z

m

  • i=0

ai(∆x − bi)n

+

  • I(x − ∆x)

=

m

  • i=0

aiJ(x − bi), J(x) =

  • ∆x∈Z

∆xn

+I(x − ∆x)

Pre-computed Several calculations

slide-15
SLIDE 15

/23

2D Convolution

Chapter 4 of 7

Chapter 4. 2D Convolution

November 12, International Conference on Pattern Recognition 2012

15

slide-16
SLIDE 16

/23

2D Gaussian func. can be decomposed: Approximation can be written as: where

( ˜ ψ ∗ I)(x, y) =

m

  • i=1

ai

m

  • j=1

ajJ(x − bi, y − bi)

2D Convolution

Chapter 4. 2D Convolution

November 12, International Conference on Pattern Recognition 2012

16

exp

  • −x2 + y2

2σ2

  • = exp
  • − x2

2σ2

  • exp
  • − y2

2σ2

  • 20 multiplications and 16 additions

J(x, y) =

(∆x,∆y)∈Z2

+ ∆xn∆ynI(x − ∆x, y − ∆y)

slide-17
SLIDE 17

/23

Evaluation

Chapter 4. 2D Convolution

November 12, International Conference on Pattern Recognition 2012

17

  • 15

15 x

  • 15

15 y

× × × × × × × × × × × × × × × ×

· · · Gaussian — Approximation × Control point

Figure Elevation and control points

slide-18
SLIDE 18

/23

Outline of Algorithm

Chapter 5 of 7

Chapter 5. Outline of Algorithm

November 12, International Conference on Pattern Recognition 2012

18

slide-19
SLIDE 19

/23

Outline of Algorithm

  • 1. Pre-compute J once an image

in linear time to the area of the image.

  • 2. Compute a Gaussian filtered value

in constant time (tens operations) for any combinations a, b.

Chapter 5. Outline of Algorithm

November 12, International Conference on Pattern Recognition 2012

19

( ˜ ψ ∗ I)(x, y) =

m

  • i=1

ai

m

  • j=1

ajJ(x − bi, y − bi) J(x, y) =

(∆x,∆y)∈Z2

+ ∆xn∆ynI(x − ∆x, y − ∆y)

slide-20
SLIDE 20

/23

Experiments

Chapter 6 of 7

Chapter 6. Experiments

November 12, International Conference on Pattern Recognition 2012

20

slide-21
SLIDE 21

/23

Experiments

Chapter 6. Experiments

November 12, International Conference on Pattern Recognition 2012

21 100 101 102 103 104 # of application pixels of the filter 10−8 10−7 10−6 10−5 10−4 Computational time (sec.) — Proposed method - - - Na¨ ıve method

Figure Computational time for one pixel on average

For 70+ pixels

  • ur algorithm is faster

Diameter of 9 has 69 pixels

slide-22
SLIDE 22

/23

Conclusions

Final Chapter

Chapter 7. Conclusions

November 12, International Conference on Pattern Recognition 2012

22

slide-23
SLIDE 23

/23

Conclusions

With pre-computing once an image, the proposed algorithm computes any size of the Gaussian filter

  • in constant time to size,
  • faster than naïve for 70+ pixels,
  • within 3% error.

Chapter 7. Conclusions

November 12, International Conference on Pattern Recognition 2012

23