# compatibleTrackBranches

Formulate global hypotheses from clusters

## Description

example

[hypotheses,hypScores] = compatibleTrackBranches(clusters,incompatibleBranches,scores,maxNumHypotheses) returns the list of hypotheses hypotheses and their scores hypScores from information about clusters of branches and incompatibility of branches.

Hypotheses are sets of compatible track branches, which are branches that do not belong to the same track or share a detection in their history. The score of each hypothesis is the sum of scores of all branches included in the hypothesis.

## Examples

collapse all

Create a branch history matrix for 12 branches. For this example, the branch history matrix has 11 columns that represent the history of 2 sensors with a history depth of 4.

branchHistory = uint32([
4     9     9     0     0     1     0     0     0     0     0
5    10    10     0     0     0     2     0     0     0     0
6    11    11     0     0     3     0     0     0     0     0
1    12    12     0     0     1     0     1     0     0     0
1    13    13     0     0     0     2     1     0     0     0
1    14    14     0     0     1     2     1     0     0     0
2    15    15     0     0     3     0     3     0     0     0
3    16    16     0     0     0     4     0     4     0     0
7     0    17     1     0     0     0     0     0     0     0
1     5    18     1     0     0     0     0     2     0     0
1     5    19     0     2     0     0     0     2     0     0
1     5    20     1     2     0     0     0     2     0     0]);

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

[clusters,incompBranches] = clusterTrackBranches(branchHistory);

Specify a 12-by-1 column vector containing the branch scores.

scores = [81.4; 90.5; 12.7; 91.3; 63.2; 9.7; 27.8; 54.6; 95.7; 96.4; 15.7; 97.1];

Specify the number of global hypotheses.

numHypotheses = 6;

Get a matrix of hypotheses and the score of each hypothesis.

[hyps,hypScores] = compatibleTrackBranches(clusters,incompBranches,scores,numHypotheses)
hyps = 12x6 logical array

1   0   1   1   1   0
1   1   1   1   1   1
0   0   0   0   1   1
0   1   0   0   0   1
0   0   0   0   0   0
0   0   0   0   0   0
1   1   1   1   0   0
1   1   1   1   1   1
1   1   0   0   1   1
0   0   0   1   0   0
⋮

hypScores = 1×6

365.7000  359.9000  351.4000  350.7000  350.6000  344.8000

## Input Arguments

collapse all

Clusters, specified as one of the following.

• An M-by-P logical matrix. M is the number of branches and P is the number of clusters. The (i,j) element is true if branch j is contained in cluster i. The value of P is less than or equal to M.

• A vector of length M, where the i-th element gives the index of the cluster that contains branch i.

• A cell array c, where c{j} contains the IDs of all the branches in cluster j.

You can use clusterTrackBranches to compute the clusters from a branch history matrix.

Data Types: logical

Incompatible branches, specified as an M-by-M symmetric logical matrix. The (i,j) element is true if branches i and j are pairwise-incompatible.

You can use clusterTrackBranches to compute incompatible branches from a branch history matrix.

Data Types: logical

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. compatibleTrackBranches ignores the second column.

Data Types: single | double

Maximum number of hypotheses, specified as a positive integer.

## Output Arguments

collapse all

Hypotheses, returned as an M-by-H logical matrix, where M is the number of branches and H is the value of maxNumHypotheses.

Hypotheses score, returned as a 1-by-H numeric vector.

## 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.

## Version History

Introduced in R2018b