How to track a line using kalman filter object of computer vision toolbox?
3 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(1 个)
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.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Computer Vision Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!