# TrackMate Algorithms

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

THIS IS A DRAFT WHERE SNIPPETS ARE LEFT

### Calculating linking costs

1. The distance between the two spots D is calculated
2. If the spots are separated by more than the max distance, the link is forbidden. If not,
3. For each feature in the map, a penalty p is calculated as

$p = 3 \times W \times \frac{ | f_1-f_2|}{f_1+f_2}$

where W is the factor associated to the feature in the map. This expression is such that: there is no penalty if the 2 feature values f1 and f2 are the same; that, with a factor of 1, the penalty if 1 is one value is the double of the other; the penalty is 2 if one is 5 times the other one. All penalties are summed, to form P = (1 + ∑ p ) The cost is set to the square of the product: C = ( D × P )²