필터 지우기
필터 지우기

How to track a line using kalman filter object of computer vision toolbox?

조회 수: 1 (최근 30일)
Aravind
Aravind 2014년 9월 19일
편집: Aravind 2014년 9월 20일
The following matlab documentation shows how to track a 2D point and estimate it's trajectory during occlusions. http://www.mathworks.in/help/vision/examples/using-kalman-filter-for-object-tracking.html
I want to implement the same idea for tracking a line. One idea I had was to track two points in the line and thus track the line, but that would require two kalman filter objects(I have intentions of tracking multiple lines, so multiple objects will be tedious). Can I implement using just one object?
trackedLocation = correct(kalmanFilter, detectedLocation);
trackedLocation = predict(kalmanFilter);
These are the code fragments for 2D pont tracking.In short, I need to add the line parameters for
detectedLocation.

답변 (1개)

Dima Lisin
Dima Lisin 2014년 9월 19일
Hi Aravind,
I think it can be done in principle, but I have never tried it.
You would not be able to use the configureKalmanFilter function, which is designed to create a Kalman filter for tracking a single point. You would have to construct the vision.KalmanFilter object directly, by setting up the StateTransitionModel and the MeasurementModel.
Assuming that you want to track line segments, which move on a 2D plane and do not change their size, and assuming that you choose to use a constant velocity motion model, then your state would include (x,y) coordinates of the two end points and a single velocity vector. Your measurement would just be the coordinates of the two end points. Then you would have to set up the appropriate state transition matrix, and the matrix mapping a state to a measurement.
Things will get more complicated if your line segments move in 3D, but you only see a 2D projection, and/or if the line segments can change in length as they move.
  댓글 수: 1
Aravind
Aravind 2014년 9월 20일
편집: Aravind 2014년 9월 20일
Thanks for your answer, so the states should be [x1,y1,x2,y2,dx1,dy1]? The velocity vector for x2 and y2 also should be dx1, dy1 respectively, right? , Since they are part of the same line segment..
WIth this, I get the following model,
%STM F = [1 0 0 0 t 0;0 1 0 0 0 t;0 0 1 0 t 0;0 0 0 1 0 t;0 0 0 0 1 0; 0 0 0 0 0 1]
%measurement matrix H = [1 0 0 0 0 0 ;0 1 0 0 0 0;0 0 1 0 0 0;0 0 0 1 0 0]
I'm unclear on how to choose a value of t, as it is the discrete time step when a new information is processed. What is the value used in matlab?
Sorry, for asking too many questions. :)

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Computer Vision Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by