Assigning labels to the detected points

1 view (last 30 days)
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.

Accepted Answer

Image Analyst
Image Analyst on 8 Feb 2017
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 Comments
Image Analyst
Image Analyst on 8 Feb 2017
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
BlueBee77
BlueBee77 on 9 Feb 2017
THanks alot, i got the idea :)

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!