Kinect and joint coordinates to get angles.
3 次查看(过去 30 天)
显示 更早的评论
Hi, i have a problem with kinect v1 and matlab 2013, I need to acquire data from the joints when a person is walking but I get very few data because is very slow the sample of the "getdata" to get all the jointscoordinates each second, and thats give me only some angles and looses others that I need. This is the code. I hope someone could help me :(
depthVid = videoinput('kinect',2,'Depth_640x480');
preview(colorVid);
preview(depthVid );
triggerconfig(depthVid,'manual');
depthVid.FramesPerTrigger=1;
depthVid.TriggerRepeat=inf;
set(getselectedsource(depthVid),'TrackingMode','Skeleton')
start(depthVid);
himg = figure;
while ishandle(himg);
trigger(depthVid);
[depthMap, ~, depthMetaData]= getdata(depthVid);
if sum(depthMetaData.IsSkeletonTracked)>0
cont=cont+1;
skeletonJoints= depthMetaData.JointImageIndices(:,:,depthMetaData.IsSkeletonTracked);
jointCoordinates=depthMetaData.JointWorldCoordinates(:,:,depthMetaData.IsSkeletonTracked);
imshow (depthMap, [0 4096]);
hold on;
graficar_esqueleto(skeletonJoints)
hold off;
i=i+1;
%Angulos de articulación de rodillas
jointCoordinates
%der
ang1=Angulo(13,15,jointCoordinates);
ang_rodilla1(i)=(180-ang1)
%izq
ang2=Angulo(17,19,jointCoordinates);
ang_rodilla2(i)=(180-ang2)
else
imshow (depthMap, [0 4096]);
end
drawnow
end
stop(depthVid);
clear depthVid;
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Acquisition Using Kinect for Windows Hardware 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!