为检测到的点分配标签

Assigning labels to the detected points

我正在追踪人类。我已经计算了质心和点(头、手和腿)。根据图像的不同,这些点最多可以有 5 个,也可以至少有 2 个,具体取决于人的姿势。我想为这些点分配左腿、右腿、左手、右手和头部等标签。但问题是,除非我绘制它们,否则我不知道哪一点是什么。 我想使用一些逻辑,比如如果它在质心上方然后是头部或在质心下方然后是腿或其他一些 idea/heuristics 但我不知道它在 Matlab 中是否可行。我附上一张带有检测到的点和质心的图像。如果有人能提出一些想法,我将不胜感激。

如果你有质心xy坐标和这些点的坐标你就可以根据这个做逻辑,对吧?

请提供一些代码。我不明白你的问题。

编辑:

例如:matrix_with_point = [0.5 1;0.25 0.5;0.75 0.5];centroid = [0.5 0.5] 第 1 列是 x,第 2 列是 y 那么:

for i = 1:size(matrix_with_point,1)
      %check x direction
      if matrix_with_points(i,1) < centroid(1,1) %left
      % however you would like to label
      text(matrix_with_point(i,1),matrix_with_point(i,2),'Left')
      elseif matrix_with_points(i,1) >= centroid(1,1) %right
      % however you would like to label
      text(matrix_with_point(i,1),matrix_with_point(i,2),'Right')


      end
end

你可以走了,但我想你明白了吗?