main Content

分配

使用拍卖全球最近的邻居分配

描述

例子

[[作业,,,,unsignedrows,,,,非分配的collumns] =分配递减(costmatrix,,,,costofnonassignmentreturns a table of作业of detections to tracks derived based on the forward/reverse auction algorithm. The auction algorithm finds a suboptimal solution to the global nearest neighbor (GNN) assignment problem by minimizing the total cost of assignment. While suboptimal, the auction algorithm is faster than the Munkres algorithm for large GNN assignment problems, for example, when there are more than 50 rows and columns in the cost matrix.

The cost of each potential assignment is contained in the cost matrix,costmatrix。每个矩阵条目代表可能作业的成本。矩阵行表示轨道,列表示检测。所有可能的任务在成本矩阵中表示。成本越低,任务越有可能。每个轨道最多可以分配给一个检测,并且每个检测最多可以分配给一个轨道。如果行的数量大于列数,则某些轨道未分配。如果列数大于行的数量,则没有分配一些检测。您可以设置一个条目costmatrixInf至prohibit an assignment.

costofnonassignmentrepresents the cost of leaving tracks or detections unassigned. Higher values increase the likelihood that every existing object is assigned.

该功能返回一个未分配的曲目列表,unsignedrows,以及未分配的检测列表,非分配的collumns

例子

全部收缩

Use分配将三个检测分配给两个轨道。

Start with two predicted track locations in x-y coordinates.

tracks = [1,1; 2,2];

假设收到三个检测。至少不会分配一个检测。

dets = [1.1,1.1;2.1,2.1;1.5,3];

通过定义将检测分配给轨道的成本作为它们之间的欧几里得距离来构建成本矩阵。将非分配的成本设置为0.2。

为了i = size(轨道,1):-1:1 delta = dets-轨道(i,:);costmatrix(i,:) = sqrt(sum(delta。^ 2,2));结尾costofnonassignment = 0.2;

使用拍卖算法将检测分配给轨道。

[作业,非分配轨道,毫无配合的漏洞] =...分配(costMatrix,costofnonassignment);

显示作业。

disp(assignments)
1 1 2 2

Show that there are no unassigned tracks.

disp(未分配拖车)

Display the unassigned detections.

disp(未分配访问)
3

plot detection to track assignments.

情节(轨道(:,1),轨道(:,2),'*',dets(:,1),dets(:,2),'o')holdonxlim([0,4])ylim([0,4])传奇(“轨道”,,,,“检测”)sissionstr = strsplit(num2str(1:size(sigitionments,1)));文本(轨道(分配(:,1),1) + 0.1,...轨道(分配(:,1),2)-0.1,agissstr);文本(dets(分配(:,2),1) + 0.1,...dets(分配(:,2),2)-0.1,agissstr);文本(dets(unapsignedDetections(:),1) + 0.1,...dets(unassignedDetections(:),2) + 0.1,'unassigned');

图包含一个轴对象。轴对象包含7个类型行的对象,文本。这些对象表示轨道,检测。

检测任务的轨道是:

  1. 检测1分配给轨道1。

  2. Detection 2 is assigned to track 2.

  3. Detection 3 is not assigned.

输入参数

全部收缩

Cost matrix, specified as anm-by-n矩阵。m是要分配的轨道数量n是要分配的检测数量。成本矩阵中的每个条目都包含轨道和检测分配的成本。矩阵可能包含Inf表明禁止任务的条目。成本矩阵不能是稀疏的矩阵。

数据类型:单身的|双倍的

非分配成本,指定为标量。非分配的成本代表了未分配的轨道或检测的成本。更高的值增加了每个对象分配的可能性。该值不能设置为Inf

数据类型:单身的|双倍的

输出参数

全部收缩

探测到跟踪,返回作为整数值的分配l-by-2矩阵l是任务数。矩阵的第一列包含分配的轨道索引,第二列包含分配的检测指标。

数据类型:UINT32

未分配的轨道索引,作为整数值返回p-1列矢量。

数据类型:UINT32

未分配检测的索引,作为整数值返回-1列矢量。

数据类型:UINT32

References

[[1] Samuel S. Blackman and Popoli, R.现代跟踪系统的设计和分析。Artech House: Norwood, MA. 1999.

扩展功能

C/C ++代码生成
Generate C and C++ code using MATLAB® Coder™.

版本历史记录

在R2018B中引入