I use Matlab R2016a and a kinect v2 sensor. The code I use just doesn't seem to run and the same error keeps popping out. The code is:
imaqreset;% Create color and depth kinect videoinput objects.
colorVid = videoinput('kinect', 1, ‘RBG_1920x1080’);depthVid = videoinput('kinect', 2, ‘depth_512x424’);triggerconfig(depthVid,'manual');depthVid.FramesPerTrigger=1;depthVid.TriggerRepeat=inf;set(getselectedsource(depthVid),'TrackingMode','Skeleton');viewer=vision.DeployableVideoPlayer();start(depthVideo);himg = figure;while ishandle(himg) trigger(depthVideo); [depthMap, ~, depthMetaData]= getdata(depthVid); imshow (depthMap, [0 4096]); if sum(depthMetaData.IsSkeletonTracked)>0 skeletonJoints= depthMetaData.JoingtDepthIndices(:,:,depthMetaData.IsSkeletonTracked); hold on; plot(skeletonJoints(:,1), skeletonJoints(:,2),'*'); hold off; endendstop(depthVid);
The error is The name 'TrackingMode' is not an accessible property for an instance of class 'videosource'. Also, at first the code ran smoothly up to the above mentioned error but later on it wouldn't even get past
colorVid= videoinput('kinect',1,'RBG_1920x1080');
saying that the adaptor name doesn't exist even though the kinect is connected. Please help! Thank you!
Best Answer