Introduction to Using the Global Nearest Neighbor Tracker

MATLAB R2019b

 global nearest neighbor  (GNN) tracker:最近邻

1、目标

% # Choose the assignment algorithm to associate detections with tracks.
% # Use either history-based or score-based track logic for confirmation and deletion of tracks.
% # Use any kind of tracking filter, including an interacting multiple model filter.

2、初始化

        ①、assignment algorithms 有好几种:  |'Munkres'| 、|'Auction'| 、|'Jonker-Volgenant'|  |'Custom'| 。这里用Auction。

        ②、初始化轨迹confirm算法是history-based,2 out of 3.

3、时间1,探测了两个目标物,因为第二个目标物有明确的ObjectClassID,所以直接就跟踪上了。

4、时间2,第一个目标物跟踪上了,第二个目标物coast。

5、后面的就是换了Score-based算法。

6、要着重看一下trackGNN

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Nearest neighbor matching with ratio test is a simple and effective technique to filter out incorrect matches between feature descriptors. It works by comparing the distances between a descriptor in the first image and its two nearest neighbors in the second image. If the ratio of the distances is below a certain threshold, the match is considered correct. The ratio test is used to ensure that the nearest neighbor match is significantly closer to the descriptor than the second nearest neighbor. The threshold value for the ratio test is usually set between 0.7 and 0.8, depending on the specific application. Here is an example of how to perform nearest neighbor matching with ratio test in MATLAB: ```matlab % Load feature descriptors for two images descriptors1 = load('descriptors1.mat'); descriptors2 = load('descriptors2.mat'); % Find nearest neighbors using knnsearch idx = knnsearch(descriptors2, descriptors1, 'K', 2); % Apply ratio test threshold = 0.8; matches = []; for i = 1:size(descriptors1, 1) ratio = norm(descriptors1(i,:) - descriptors2(idx(i,1),:)) / norm(descriptors1(i,:) - descriptors2(idx(i,2),:)); if ratio < threshold matches = [matches; i, idx(i,1)]; end end % Visualize matches figure; showMatchedFeatures(image1, image2, points1(matches(:,1),:), points2(matches(:,2),:)); ``` In this example, the knnsearch function is used to find the two nearest neighbors of each descriptor in the second image for each descriptor in the first image. Then, for each descriptor in the first image, the ratio of the distances between the descriptor and its two nearest neighbors in the second image is computed. If the ratio is below the threshold, the match is considered correct and added to the matches matrix. Finally, the matched keypoints are visualized using the showMatchedFeatures function.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值