필터 지우기
필터 지우기

Help me with my kinect

조회 수: 2 (최근 30일)
bachelor student
bachelor student 2016년 8월 9일
댓글: Rik 2021년 11월 15일
I have a kinect Xbox360 and I am trying to use its depth matrix for avoiding obstacles in matlab, I have ran a code but it takes 3 seconds to imply, that's too much for my application, can anybody help me with that here is the code:
I just want to have the minimum distance
clc
clear all
imaqreset
depthVid=videoinput('kinect',2);% kinect recognition
triggerconfig(depthVid,'manual'); % choosing manual setting
depthVid.FramesPerTrigger=1; %frames per each run
depthVid.TriggerRepeat=inf; % maximum of runs we can get from the kinect
start(depthVid);
min=10^3;% initial arbitarary value for finding minimum distance
for i=1:100
trigger(depthVid);
[depthMap,~,depthMetaData]=getdata(depthVid); % getting data from kinect
% filtering the floor and min choosing
for i=1:480
for j=1:640
if i>320
depthMap(i,j)=0;
else if depthMap(i,j) ~= 0 && (depthMap(i,j)<min)
min=depthMap(i,j);
end
end
end
end
imshow(depthMap,[0 4096]);
min;
end
stop(depthVid);
  댓글 수: 1
Rik
Rik 2021년 11월 15일
I recovered the removed content from the Google cache (something which anyone can do). Editing away your question is very rude. Someone spent time reading your question, understanding your issue, figuring out the solution, and writing an answer. Now you repay that kindness by ensuring that the next person with a similar question can't benefit from this answer.

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2016년 8월 10일
Only Kinect for Windows is supported, not Kinect for XBOX 360. Microsoft deliberately made the Kinect for XBOX data unreadable.
  댓글 수: 3
Walter Roberson
Walter Roberson 2016년 8월 10일
편집: Walter Roberson 2021년 11월 13일
The answer there is from a Mathworks employee.
Kinect for XBOX 360 is not supported.
Walter Roberson
Walter Roberson 2016년 8월 10일
Your code is inefficient. There is no point (from the point of view of efficiency) of testing a condition that will not be true for a lot of the range. You should break up the "i" range at the very least.
mask = depthmap(1:320, :) ~= 0;
smallest = min(depthmap(mask));
depthmap(321:end, :) = 0;

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by