Main Content

pruneTrackBranches

Prune track branches with low likelihood

Description

example

[toPrune,globalProbability] = pruneTrackBranches(branchHistory,scores,hypotheses) returns a logical flag, toPrune, that indicates which branches should be pruned based on the branch history, branch scores, and hypotheses. pruneTrackBranches also returns the global branch probabilities, globalProbability.

[toPrune,globalProbability] = pruneTrackBranches(branchHistory,scores,hypotheses,Name,Value) uses name-value pairs to modify how branches are pruned.

[toPrune,globalProbability,info] = pruneTrackBranches(___) returns additional information, info, about the pruned branches.

Examples

collapse all

Create a branch history matrix for a single sensor with 20 branches. For this example, the history depth is 4 therefore the matrix has 7 columns.

history = [     
   8    14    14     0     0     2     0
   1    23    23     0     0     2     1
   2    24    24     0     0     1     2
   9    25    25     0     1     0     0
  10    26    26     0     2     0     0
   1    28    28     0     1     0     1
   4    33    33     0     1     2     1
   1    34    34     0     1     2     1
   2    35    35     0     2     1     2
  11     0    36     1     0     0     0
  12     0    37     2     0     0     0
   8    14    38     2     0     2     0
   1    23    39     2     0     2     1
   2    24    40     1     0     1     2
   9    25    41     2     1     0     0
  10    26    42     1     2     0     0
   1    28    43     2     1     0     1
   4    33    44     2     1     2     1
   1    34    45     2     1     2     1
   2    35    46     1     2     1     2];

Get the list of clusters and the list of incompatible branches. The clusters matrix has two columns, therefore there are two clusters.

[clusters,incompBranches] = clusterTrackBranches(history);

Specify a 20-by-1 column vector containing branch scores.

scores = [4.5 44.9 47.4 6.8 6.8 43.5 50.5 61.9 64.7 9.1 9.1 19 61.7 ...
    63.5 21.2 20.5 60.7 67.3 79.2 81.5]';

Get a matrix of hypothesis.

hypotheses = compatibleTrackBranches(clusters,incompBranches,scores,10);

Prune the track branches, using name-value pair arguments to specify a single sensor and the 'Hypothesis' method of N-scan pruning. Return the pruning flag, global probability, and pruning information about each branch. To make the information easier to compare, convert the information from a struct to a table.

The i-th value of toPrune is true if any of 'PrunedByProbability', 'PrunedByNScan', or 'PrunedByNumBranches' are true in the i-th row of the information table.

[toPrune,probs,info] = pruneTrackBranches(history,scores,hypotheses, ...
    'NumSensors',1,'NScanPruning','Hypothesis');
infoTable = struct2table(info)
infoTable=20×6 table
    BranchID    PriorProbability    GlobalProbability    PrunedByProbability    PrunedByNScan    PrunedByNumBranches
    ________    ________________    _________________    ___________________    _____________    ___________________

       14           0.98901             0.098901                false               false               false       
       23                 1                  0.1                false               false               true        
       24                 1                  0.1                false               false               true        
       25           0.99889             0.099889                false               false               false       
       26           0.99889             0.099889                false               false               false       
       28                 1                    0                true                true                false       
       33                 1                    0                true                false               false       
       34                 1                  0.2                false               false               false       
       35                 1                  0.2                false               false               false       
       36           0.99989              0.19998                false               false               false       
       37           0.99989              0.19998                false               false               false       
       38                 1                    0                true                false               false       
       39                 1                  0.1                false               false               false       
       40                 1                  0.1                false               false               false       
       41                 1                  0.1                false               false               false       
       42                 1                  0.1                false               false               false       
      ⋮

Input Arguments

collapse all

Branch history, specified as a matrix of integers. Each row of branchHistory represents a unique track branch. branchHistory must have 3+(D×S) columns, where D is the number of maintained scans (the history depth) and S is the maximum number of maintained sensors. For more information, see the history output of the trackBranchHistory system object.

Branch scores, specified as an M-by-1 numeric vector or an M-by-2 numeric matrix.

Note

If you specify scores as an M-by-2 numeric matrix, then the first column specifies the current score of each branch and the second column specifies the maximum score. pruneTrackBranches ignores the second column.

Data Types: single | double

Hypotheses, returned as an M-by-H logical matrix, where M is the number of branches and H is the number of global hypotheses. You can use clusterTrackBranches to compute the clusters from a branch history matrix, then use compatibleTrackBranches to compute the hypotheses from the clusters.

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: [toPrune,probs] = pruneTrackBranches(branchHistory,scores,hypotheses,'MinBranchProbability',2e-3);

Minimum branch probability threshold, specified as the comma-separated pair consisting of 'MinBranchProbability' and a number in the range [0,1). Typical values are between 1e-3 and 5e-3. The pruneTrackBranches function prunes branches with global probability less than the threshold.

Maximum number of branches to keep per track, specified as the comma-separated pair consisting of 'MaxNumTrackBranches' and a positive integer. Typical values are between 2 and 6. If a track has more than this number of branches, then pruneTrackBrances prunes branches with the lowest initial score.

N-scan pruning method, specified as the comma-separated pair consisting of 'NScanPruning' and 'None' or 'Hypothesis'. If you specify 'Hypothesis', then pruneTrackBrances prunes branches that are incompatible with the current most likely branch in the most recent N scans. By default, pruneTrackBrances does not use N-scan pruning.

Number of sensors in history, specified as the comma-separated pair consisting of 'NumSensors' and a positive integer.

Output Arguments

collapse all

Branches to prune, returned as an M-by-1 logical vector. A value of true indicates that the branch should be pruned.

Data Types: logical

Global branch probabilities, returned as an M-by-1 numeric vector.

Pruning information about each branch, returned as a struct with the following fields.

  • BranchID — An M-by-1 numeric vector. Each value specifies the ID of a track branch. The IDs come from the third column of branchHistory.

  • PriorProbability — An M-by-1 numeric vector. Each value specifies the branch prior probability from the branch score.

  • GlobalProbability — An M-by-1 numeric vector. Each value specifies the branch global probability, which considers the hypotheses that contain the branch and their scores.

  • PrunedByProbability — An M-by-1 logical vector. A value of true indicates that the branch is pruned by MinBranchProbability.

  • PrunedByNScan — An M-by-1 logical vector. A value of true indicates that the branch is pruned by NScanPruning.

  • PrunedByNumBranches — An M-by-1 logical vector. A value of true indicates that the branch is pruned by MaxNumTrackBranches.

References

[1] Werthmann, John R. "A Step-by-Step Description of a Computationally Efficient Version of Multiple Hypothesis Tracking." In Proceedings of SPIE Vol. 1698, Signal and Processing of Small Targets. 1992, pp. 288–300. doi: 10.1117/12.139379.

[2] Blackman, Samuel, and Robert Popoli. "Design and Analysis of Modern Tracking Systems." Artech House, 1999.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Version History

Introduced in R2018b