Assigning labels to the detected points

1 次查看(过去 30 天)
I am working on tracking a human. I have calculated the centroid and points(Head,hands and legs). Depending on the image, these points can be at maximum 5 or at least 2 depending on the pose of the person. I want to assign labels like left leg,right leg, left hand, right hand and head to these points. But the problem is that unless i plot them i dont know which point is what. I want to use some logic like if its above centroid then head or below centroid then legs or some other idea/heuristics but i dont know if its possible in Matlab. I am attaching an image with detected points and centroid. I will appreciate if anyone can suggest some ideas.

采纳的回答

Image Analyst
Image Analyst 2017-2-8
Yes, that's possible. Maybe you could use a structure array - one structure for each points. Like, do your logic to determine the body part, then if you're assigning the second point to Legs:
specialPoints(2).x = x;
specialPoints(2).y = y;
specialPoints(2).bodyPart = 'Legs';
Same for all the other points.
  3 个评论
Image Analyst
Image Analyst 2017-2-8
Look at the y value of the centroid and compare to the y value of your other points. If the centroid y value is less, it's above the other point, if it's greater, the centroid y value is more than the others, it's below
for k = 1 : length(y)
if y(k) > yCentroid
fprintf('Point #%d, at y=%f, is below the centroid at y=%f.\n', k, y(k), yCentroid);
else
fprintf('Point #%d, at y=%f, is above the centroid at y=%f.\n', k, y(k), yCentroid);
end
end

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Image Processing Toolbox 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by