How to display skeleton data

18 Ansichten (letzte 30 Tage)
NGR MNFD
NGR MNFD am 4 Nov. 2023
Kommentiert: Image Analyst am 5 Nov. 2023
Hello, I hope you have a good day...What MATLAB command can be used to display skeletal data in 3D from this matrix? He explained: The first line is related to the data recording time, and the second line is the joint number, and the third, fourth, and fifth lines are related to the x-axis, y-axis, and z-axis of the joint 0. It continues in the same way. How can the moving skeleton be displayed? Wrote? The data form is as follows.time, 0, joint0_x, joint0_y, joint0_z, 1, joint1_x, joint1_y, joint1_z, 2, joint2_x, joint2_y, joint2_z, .I know and have studied the skeleton display code on different sites, but I was confused about my own code. please guide me. tanx so much.

Antworten (1)

Image Analyst
Image Analyst am 4 Nov. 2023
Try this:
data = readmatrix('human2_normal17_SkeletonData1.csv');
% Plot the first 4 joint skeletons.
PlotJointNumber(data, 1)
PlotJointNumber(data, 2)
PlotJointNumber(data, 3)
PlotJointNumber(data, 4)
function PlotJointNumber(data, jointNumber)
% Plot this joint.
column = 4 * jointNumber - 1;
x = data(:, column);
y = data(:, column+1);
z = data(:, column+2);
nexttile
plot3(x, y, z, 'b.-', 'LineWidth', 2)
grid on;
fontSize = 20;
xlabel('x','FontSize',fontSize);
ylabel('y','FontSize',fontSize);
zlabel('z','FontSize',fontSize);
caption = sprintf('Joint #%d', jointNumber);
title(caption,'FontSize',fontSize);
end
  4 Kommentare
NGR MNFD
NGR MNFD am 5 Nov. 2023
Just ignore the information about the first column of the human2_normal17_SkeletonData1.csv matrix. In fact, the new matrix obtained has 66 rows and one column, where we have a 25x3 matrix in each row.
Image Analyst
Image Analyst am 5 Nov. 2023
The concept is the same. You just need to read in your data. Then parse it into arrays for x, y, and z. Then use plot3 or plot to plot them.
To learn other fundamental concepts, invest 2 hours of your time here:

Melden Sie sich an, um zu kommentieren.

Produkte


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by