fast motion estimation

19
1 Fast Motion Estimation  Algorithms Master: Prof. Hashemi By:  Amir Shahrokhi

Upload: kemxoi

Post on 04-Jun-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

8/13/2019 Fast Motion Estimation

http://slidepdf.com/reader/full/fast-motion-estimation 1/19

1

Fast Motion Estimation Algorithms

Master:

Prof. Hashemi

By:

 Amir Shahrokhi

8/13/2019 Fast Motion Estimation

http://slidepdf.com/reader/full/fast-motion-estimation 2/19

2

Progress

►What has been done: Download Papers about ME Specially Block Matching

Survey Papers and Their References

►What will be done: Simulate Some of Proposed Algorithms Using MATLAB

Comparison of different algorithms

8/13/2019 Fast Motion Estimation

http://slidepdf.com/reader/full/fast-motion-estimation 3/19

3

Outline

►Fast Motion Estimation Algorithms:

Introduction

Block Matching Algorithms

►Full Search Method

►2-D Logarithmic Search

►3-Step Search

►Conjugate Direction Search►Diamond Search

8/13/2019 Fast Motion Estimation

http://slidepdf.com/reader/full/fast-motion-estimation 4/19

4

Introduction

►Temporal correlation between successive frames

► An easy way to remove this redundancy:

Frame Replenishment:

► A threshold for difference in pixel intensity from previous frame►If less than threshold  Send nothing

►If more than threshold  Send position & intensity difference

► Advantage: Easy to implement, Low complexity

Disadvantage: Low compression when rapid changes

 In lowbit-rates may cause scene cuts

►Better way: Motion Compensated Coding 

8/13/2019 Fast Motion Estimation

http://slidepdf.com/reader/full/fast-motion-estimation 5/19

5

Introduction (Continue)

►Motion Compensated Coding

Frame changes are considered as object movements so:

►Estimate motion of current frame respect to previous

Calculate difference between motion compensated & currentframes

►Code motion vectors and differences as this frame

►To have better compression we need to good motion estimation

Different algorithms for motion estimation

►Block Matching (Our Discussion)

►Pel Recursive Technique

►Optical Flow

8/13/2019 Fast Motion Estimation

http://slidepdf.com/reader/full/fast-motion-estimation 6/19

6

Outline

►Fast Motion Estimation Algorithms:

Introduction

Block Matching Algorithms

►Full Search Method

►2-D Logarithmic Search

►3-Step Search

►Conjugate Direction Search►Diamond Search

8/13/2019 Fast Motion Estimation

http://slidepdf.com/reader/full/fast-motion-estimation 7/19

7

Block Matching

► Divide current frame to small rectangular blocks

► Motion of each block is assumed to be uniform

► Find the best match for each block in previous frame

► Calculate motion vector (MV) between current block and itscounterpart in previous frame

► Typical size for blocks: 16x16 pixels

► Maximum movement: w: typically 8, 16 or 32

► Matching Criteria: Mean Absolute Error (MAE)

Mean Square Error (MSE)

Sum of the Squared Error (SSE)

► MAE is preferred due to its simplicity

8/13/2019 Fast Motion Estimation

http://slidepdf.com/reader/full/fast-motion-estimation 8/19

8

Block Matching

►Search Window (in previous frame)

Rectangle with the same coordinate as current block incurrent frame, extended by w pixels in each directions

w

w w

w

qp

q+2w

p+2w

8/13/2019 Fast Motion Estimation

http://slidepdf.com/reader/full/fast-motion-estimation 9/19

9

Block Matching

► Full Search

 All candidates within search window are examined

(2w+1)2 positions should be examined

 Advantage: Good accuracy, Finds best match Disadvantage: Large amount of computation: (2w+1)2 

matches, 16x16 MAE for each match  Impractical forreal-time applications

In order to avoid this complexity, we should reducesearch positions  Fast Block Matching Algorithms

8/13/2019 Fast Motion Estimation

http://slidepdf.com/reader/full/fast-motion-estimation 10/19

10

Block Matching (Fast Algorithms)

► Improvements to Full Search

Successive Elimination Algorithm (SEA)► Li, Salari

► Using SAD as matching criterion

► Idea: excluding many search positions while finding still best match

► Let f(x,y) be the intensity of each pixel in current block and f’(x’,y’) beintensity of each pixel in a current search position, and (x,y) be thecounterpart of (x’,y’), so from triangular inequality: 

  |S f(x,y) – S f’(x,y)| <= S |f(x,y) – f’(x’,y’)| = SAD 

► So difference between sum of intensity values can be used as a lowerbound for SAD value. This bound is used to exclude search points

► Cost is to calculate sum of intensities, search points differ from eachother in 2 rows or columns and they have a great overlap  Sum ofintensities can be calculated efficiently

8/13/2019 Fast Motion Estimation

http://slidepdf.com/reader/full/fast-motion-estimation 11/19

11

Block Matching (Fast Algorithms)

► 2-D Logarithmic Search

Jain and Jain

Examine central point & itsfour surroundings

Distance from center: w/2 Find best match

If best match is in centeror on boundaries, halfdistance from center

Examine five new pointscentering previous best

When distance is 1, use all9 matches, find best. Stop

1

1

1

1 1

2

2

2

3

3

4

4 44

4

4

4

4

8/13/2019 Fast Motion Estimation

http://slidepdf.com/reader/full/fast-motion-estimation 12/19

8/13/2019 Fast Motion Estimation

http://slidepdf.com/reader/full/fast-motion-estimation 13/19

8/13/2019 Fast Motion Estimation

http://slidepdf.com/reader/full/fast-motion-estimation 14/19

14

Block Matching (Fast Algorithms)

► Conjugate Direction Search

Srinivasan, Rao

Start from center point, findbest match between this point

& its 2 horizontal neighbors Search 1 point in the direction

of best match & Examine

If no change in best match inhorizontal, repeat for vertical

When no change in vertical,select the point as best match

worst case 2w+3 points

1234 11

5

5

6

7

8/13/2019 Fast Motion Estimation

http://slidepdf.com/reader/full/fast-motion-estimation 15/19

15

Block Matching (Fast Algorithms)

► Improvement to CDS Fast One-Step Search (FOSS)

► Srinivasan, Ramachandran

► 5 macro-blocks : center of search area and 4 points between center and 4

borders of search area► Calculate number of search points for these macro-blocks in eight directions

► Direction with least number of search points is used as optimal for CDS

► This is done for first P-frame after I-frame

► This direction is unique for all P-frames in a GOP

► Reduces search points by 2, with the cost of 0.4% overhead of overall compute

► Better direction select and faster than CDS

8/13/2019 Fast Motion Estimation

http://slidepdf.com/reader/full/fast-motion-estimation 16/19

16

Block Matching (Fast Algorithms)

► Diamond Search (DS)

Zhu, Ma

Start with 9 points creating alarge diamond  with center of

search window in center Find best match, repeat with

this best match as center

If best match is in center, use 5points creating small diamond ,

find best match, this is target Better performance than 3SS

Less complex than N3SS and4SS, with same performance

8/13/2019 Fast Motion Estimation

http://slidepdf.com/reader/full/fast-motion-estimation 17/19

17

Block Matching (Fast Algorithms)

► DS Example

1 1

1

1

1

1

1

1

1

2

2

2

3

3

3

3

3

4

4

4

4

8/13/2019 Fast Motion Estimation

http://slidepdf.com/reader/full/fast-motion-estimation 18/19

18

References

►  “FPGA Implementation of a Novel, Fast Motion Estimation Algorithm for Real-Time VideoCompression”, FPGA 2001, CA. USA, S. Ramachandran and S. Srinivasan, Feb. 2001 

►  “Image & Video Compression for Multimedia Engineering”, Y.Q. Shi and H. Sun, 2000 

►  “A New Diamond Search Algorithm for Fast Block -Matching Motion Estimation”, IEEETrans. Image Processing, S. Zhu and K. K. Ma, Feb. 2000

 “A Novel Four-Step Search Algorithm for Fast Block Motion Estimation”, IEEE Trans.Circuits System, Video Technology, L. M. Po and W. C. Ma, June 1996

►  “Successive Elimination Algorithm for Motion Estimation” W. Li and E. Salari IEEE Trans. ,Jan. 1995

►  “A New Three-Step Search Algorithm for Block Motion Estimation”, IEEE Trans. CircuitsSystem, Video Technology, R. Li, B. Zeng, and M.L. Liou, Aug. 1994

 “Predictive Coding Based on Efficient Motion Estimation”, IEEE Trans. on communications,R. Srinivasan, K.R. Rao, Aug. 1985

►  “Motion Compensated Inter-Frame Coding for Video-Conferencing”, T. Koga, K. Iinuma, A.Hirano, Y. Iijima, and T. Ishiguro, Proc. NTC81, Nov. 1981

►  “Displacement Measurement and its Applications”, IEEE Trans. on communications, J.R.Jain and A.K Jain, Dec. 1981

8/13/2019 Fast Motion Estimation

http://slidepdf.com/reader/full/fast-motion-estimation 19/19

19

 Any Question?