- uTrack.m:
- set up parameters
- trackCloseGapKalmanSparse.m:
- Input: read the input params and stored
- Preamble:
- read the coordinate data
- calculate the nearest neighbor distance for each object
- remove the empty start and end frames
- Link frame-to-frame:
sequence: link forward, time reverse, link backward, time reverse, link forward- linkFeaturesKalmanSparse.m:
- Initilize input
- Reserve Memory: allocate struct memory
- Initial the first frame info for kalman initialize: stateVec, stateCor, noiseCor
- first frame: kalmanInitialLinearMotion.m
- others: use previous kalman info
- Link frame by frame:
- costMatLinearMotionLink2.m:
- get Input
- motion propagation
- get the transfer func, 3 kind of potential TF for linear motion
- For each objects in the 1st frame
- get previous kalman info
- compute new prediction
- store in new kalman info and will be use for next time
- calculate the cost matrix as the distance between prediction and actual measurement in 2rd frame
- then findout the minimum cost for 3 kind of TF
- use the user pre-defined max search radius to filter out some big distance (maxSearchRadius can also be defined by using local density)
- set all distance in CostMat > searchRadius to NaN and square the costMat as the upperLeft sub-matrix of the final costMat
- add lifetime penalty
- birth and death cost is set to 1.05 * CostMat.max
- finally construct the overall costMat as:
- costMat=[costMat death;birth lrblock];
- set all NaN in the costMat to -5
- use the LAP algorithm to find best solution
- then get the link index info:
- indx1c: linked objects index in frame1
- indx2c: linked objects index in frame2
- indx1u: in 1st frame but not in 2rd frame
- indx1c.count = indx2c.count
- indx1c.count + indx1u.count = total objects count in 1st frame
- then update the trackedFeatureInfo, near neighbor distance, prevCost matrixes
- all this three will be stored as [indx1c indx2c;indx1u x]
- update the feature life time, add 1 for miss linked objects, add 2 for linked objects
- calc the Kalman gain, get the best prediction and update the kalman info for next prediction to use
- rearrange all the tracks in the sequence of the start frame number
- store the tracks' each objects' [x, y, z=0, amplitude, dx, dy, dz, damp]
- costMatLinearMotionLink2.m:
- Reverse the frame sequence and repeat the process of link backward
.
.
.
- linkFeaturesKalmanSparse.m:
- Post processing:
- getTrackSEL: get each track's start time and end time (frame number)
- filter out those track life time < user pre-defined
- re-calc the nndistance
uTrack linear motion tracker pseudocode
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...