Download - Kalman ip cv

Transcript
Page 1: Kalman ip cv

KALMAN FILTER

APPLICATION IN COMPUTER VISION &

IMAGE PROCESSING

Hamid Bazargani

School of Electrical & Computer Eng.

Page 2: Kalman ip cv

Outline:

• A brief introduction to Kalman filter

• Classical Kalman Filter

• Kalman & Stereo vision localization

• Different extensions of Kalman Filter

• Image and Video De-noising (Kalman approach)

• Kalman Tracking for Robust pose estimation

Page 3: Kalman ip cv

Introduction:

• Kalman is a recurrent algorithm relying on series of uncertain measurements to optimally estimate an unknown variable.

• The Kalman filter is 50 years old but is still a popular method for sensory information analysis .

• The Kalman applications span area of navigation systems, aerospace, robotics, information processing , computer vision, etc

• Main properties: • Requires small computational cost • State space representation and ease of implementation • Recursive algorithm which only uses last state and current observation

Page 4: Kalman ip cv

Formulation:

Where F is transition matrix, G is a control input matrix . H is output matrix. Random variables w and v are process and measurement noise respectively.

Page 5: Kalman ip cv

Predict or time update Correct or measurement update

Kalman stages

Page 6: Kalman ip cv

Multivariate Gaussians:

posterior

prior Measurement evidence

Markov model:

)()|()|( xpxzpzxp ∝

Page 7: Kalman ip cv

Multivariate Gaussians:

posterior

prior Measurement evidence

−Σ−−∝ − )()(

21exp)( 1 µµ xxxp T

−Γ−−∝ − )()(

21exp)|( 1 zxzxxzp T

)()( 11111new z−−−−− Γ+ΣΓ+Σ= µµ

( ) 111new −−− Γ+Σ=Σ

Page 8: Kalman ip cv

Multivariate Gaussians:

CS373 - Programming a Robotic Car - Unit 2 Kalman Filter Prediciton - CS373 Unit 2 - Udacity By Sebastian Thrun

Page 9: Kalman ip cv

Kalman & Stereo Vision Localization:

• Stereo localization requires both camera’s information at each time step.

Page 10: Kalman ip cv

Kalman & Stereo Vision Localization:

• There is a small time delay between the two cameras’ image capturing. This time lag causes an error in estimation of object position in Cartesian coordinates.

Page 11: Kalman ip cv

Non-linearity & Kalman Filter:

[Refer to Video1]

• Python and Blender used for data acquisition which brings Physics engine to generate exact trajectory.

• Blender communicate with matlab over UDP protocol.

Page 12: Kalman ip cv

Non-linearity & Kalman Filter: Extended Kalman Filter

Figures from CS-223 (Stanford)

Page 13: Kalman ip cv

Non-linearity & Kalman Filter: Extended Kalman Filter

Figures from CS-223 (Stanford)

Page 14: Kalman ip cv

Non-linearity & Kalman Filter: Extended Kalman Filter

Figures from CS-223 (Stanford)

Page 15: Kalman ip cv

Adaptive Kalman Filter:

• Adaptive Fading Kalman Filter

• Innovation based Adaptive Kalman Filter

Page 16: Kalman ip cv

Adaption

Non-linearity Kalman EKF

AEKF

AKF

Kalman Filter Categories

Page 17: Kalman ip cv

SV Results

Noise level 05.0=nσ Noise level 5.0=nσ

Page 18: Kalman ip cv

Image and Video de-noising:

• noise is assumed to be signal-independent at each pixel

Page 19: Kalman ip cv

Image and Video de-noising:

• Wiener Filter

• Bilateral Filter

• Median Filter

• Non-Local Means Filtering

Page 20: Kalman ip cv

Image and Video de-noising:

• Wiener Filter

• Assume Stationary signal • Signal and noise are independent with constant PSD

Page 21: Kalman ip cv

Image and Video de-noising: • Wiener Filter

Page 22: Kalman ip cv

Image and Video de-noising: • Wiener Filter 15=nσ

Page 23: Kalman ip cv

Image and Video de-noising: • Wiener Filter

Filtered

Page 24: Kalman ip cv

Image and Video de-noising:

• Non-Local Means Filter

• Each pixel is replaced by weighted average of its neighborhoods.

• Larger patch size leads to expensive computation. while Smaller patch size results in poor de-noising effect.

• All weights should be normalized .

Page 25: Kalman ip cv

Image and Video de-noising: • Non-Local Means Filter 15=nσ

Page 26: Kalman ip cv

Image and Video de-noising: • Non-Local Means Filter

Page 27: Kalman ip cv

Image and Video de-noising: • Comparison

15=nσoriginal

Wiener filter NLM filter

Noisy

Page 28: Kalman ip cv

Image and Video de-noising: • Comparison

0 2 4 6 8

10 12 14

PSNR (db) PSNR (db)

Page 29: Kalman ip cv

Video de-noising:

• Each pixel is replaced by 3D spatio-temporal weighted average of its neighborhoods.

Page 30: Kalman ip cv

Motion estimation & Kalman Filter

• Optical Flow Algorithms • Block Matching Algorithms

• Full Search Algorithm (FSA) • Three Step Algorithm (TSA) • Four Step Algorithm (FSA) • Diamond Search Algorithm (DSA) • Adaptive Rood Pattern Search

Page 31: Kalman ip cv

Motion estimation & Kalman Filter

• Why Kalman Filter?

• Motion estimation inaccuracy when illumination is changed • Inaccuracy based on noise • The size of moving object may differ from searching region size • Fails in presence of occlusion

Page 32: Kalman ip cv

Motion estimation & Kalman Filter

2D Causal AR model:

B(m,n)

B(m,n-1)

B(m-1,n)

),(),1()1,(),(),(),1()1,(),(

,,10,01,

,,10,01,

nmwnmvbnmvbnmvnmwnmvanmvanmv

yiyiyiyi

xixixixi

+−+−=

+−+−=

Page 33: Kalman ip cv

Motion estimation & Kalman Filter

State space representation :

+

−−−

=

0

0

)1,(),1()1,(),1(

*

010000

000100

),1(),(

),1(),(

,

,

,

,

1101

1101

,

,

,

,

q

q

nmvnmv

nmvnmv

bb

aa

nmvnmv

nmvnmv

xi

xi

xi

xi

xi

xi

xi

xi

+

=

=

0

0

),1(),(

),1(),(

*0100

0001

),(),(

,

,

,

,

,

,

r

r

nmvnmv

nmvnmv

nmvnmv

z

xi

xi

xi

xi

yi

xi

=

000000000000

22

22

qq

qq

Q

=

000000000000

22

22

rr

rr

R

Page 34: Kalman ip cv

Motion estimation & Kalman Filter

Page 35: Kalman ip cv

Motion estimation & Kalman Filter

Page 36: Kalman ip cv

Motion estimation & Kalman Filter

Page 37: Kalman ip cv

Motion estimation & Kalman Filter

Page 38: Kalman ip cv

Motion estimation & Kalman Filter

Page 39: Kalman ip cv

Motion estimation & Kalman Filter

• Green arrows show motion vectors

• Red arrows show corrected motion vectors

• Kalam uses corrected version of neighboring vectors if available

Page 40: Kalman ip cv

Motion estimation Results [Refer to Video2]

• Results are generated using the following approaches:

• 2D 3x3 spatial domain NLM

• 3D 3x3x3 spatio-temporal domain NLM

• 3D 5x3x3 spatio-temporal domain NLM

Page 41: Kalman ip cv

Motion estimation Results [Refer to Video2]

Page 42: Kalman ip cv

Kalman Tracking for Robust pose estimation

• Object Recognition

• Object recognition requires set of 2D correspondences between target image and video frame.

• Robust RANSAC (RANdom SAmple Consensus) is used to robustly estimate the pose against wrong matches.

• Robust pose estimation brings an exhaustive computational cost.

Page 43: Kalman ip cv

Kalman Tracking for Robust pose estimation

• Tracking

• Feature points tracking

• Tracking the region of search for matches.

• Keep tracking of estimated pose after pose estimation process.

• Keep tracking of inliers (best matches) found from RANSAC loop. (My Contribution)

Page 44: Kalman ip cv

Kalman Tracking for Robust pose estimation

• Pose estimation:

Point Matching

RANSAC Loop

Video Frame points Target Points

M-estimator (LSM) Kalman tracker

Page 45: Kalman ip cv

Kalman Tracking for Robust pose estimation

• Pose estimation:

[Refer to Video3]

Page 46: Kalman ip cv

Implementation

• Programs are written with C++ using OpenCV library • C++ implementation of generic Kalman Filter algorithm

• C++ implementation of Non-Local Means algorithm

• C++ implementation of FSA Block Matching algorithm

• C++ implementation of Wiener filter for image denoising

• Matlab full implementation of Conventional, Extended , Adaptive Fading and Innovation-based Adaptive Kalman filter

Will be available for download soon on https://github.com/hamidb

Page 47: Kalman ip cv

Conclusion:

• We studied Kalman Filter as an adaptive filter which can be applied for Smoothing, prediction , filtering and tracking • Three main extensions of Kalman filter including conventional, extended and adaptive Kalman filter are reviewed. • Applying Kalman Filter in Video de-noising and compared the result with other filters like Wiener filter

• Applying Kalman filter in computer vision applications such as multiple view geometry and pose estimation

Page 48: Kalman ip cv

References: 1. Dan Simon. Optimal State Estimation: Kalman, H Infinity, and Nonlinear Approaches. Wiley-Interscience, 1

edition, August 2006. 2. S. Sangsuk-Iam and T. E. Bullock. Analysis of discrete time kalman filtering under incorrect noise

covariances. Automatic Control, IEEE Transactions 3. Qijun Xia, Ming Rao, Yiqun Ying, and Xuemin Shen. Adaptive fading kalman filter with an application.

Automatica 4. Buades, A., Coll, B., Morel, J.M.: A non-local algorithm for image denoising. In: IEEE Conference on

Computer Vision and Pattern Recognition (CVPR). (2005) 5. Buades, A., Coll, B., Morel, J.M.: Denoising image sequences does not require motion estimation. In: IEEE

International Conference on Advanced Video and Signal Based Surveillance. (2005) 6. Han, Yu Bing and Chen, Rushan: Efficient video denoising based on dynamic nonlocal means . Journal of

Image Vision Comput. (2012) 7. Chung-Ming Kuo; Chaur-Heh Hsieh; Yue-Dar Jou; Hsieh-Cheng Lin; Po-Chiang Lu, "Motion estimation for

video compression using Kalman filtering," Broadcasting, IEEE Transactions on , Jun 1996 8. Bazargani, H.; Omidi, E.; Talebi, H.A., "Adaptive Extended Kalman Filter for asynchronous shuttering error of

stereo vision localization," Robotics and Biomimetics (ROBIO), 2012 IEEE International Conference on , vol., no., pp.2254,2259, 11-14 Dec. 2012

9. Ruiz, V.; Fotopoulos, V.; Skodras, A.N.; Constantinides, A.G., "An 8×8-block based motion estimation using Kalman filter," Image Processing, 1997.

10. Antoni Buades and Bartomeu Coll and Jean Michel Morel, On image denoising methods,Technical Note, CMLA (Centre de Mathematiques et de Leurs Applications,(2004)

Page 49: Kalman ip cv

Thank you for your Attention.

http://www.slideshare.net/hamidbazargani/venn-diagrams-29181371


Top Related