How can I change the resolution of kinect V2 in matlab?

3 views (last 30 days)
Kinect V2 color stream supported format is : 1920x1080. But kinect V2 depth stream format is : 512x424. Now when I start live steam for both sensors then they have different sizes because of different resolution. I cant resize them, because I need coordinates . so when I resize using Imresize(),the coordinates are not matched. I already read matlab documentation.They said hardware only supports this two format respectively.Now How can i do this in code so that both stream have the same resolution. I tried two days long but failed.

Answers (1)

Walter Roberson
Walter Roberson on 29 Jun 2017
According to http://smeenk.com/kinect-field-of-view-comparison/ the fields of view of the color sensor and depth sensor are different, 84.1 x 53.8 degrees compared to 70.6 x 60 degrees, so having the depth sensor return the same resolution as the color sensor (or an integer reduction thereof) would be misleading.
  17 Comments
Jonathan
Jonathan on 2 Jul 2019
Thank you Mr Roberson. It worked. However, I want to ask if it is possible that for every RGB frame taken, can I be able to take a depth image at the same time? I want that for every 5 seconds that the rgb camera is taking an image, the depth camera must also take the image of the same frame at the same time. Can that be possible? If so can you please show me how I can achieve that.
Thank you.
Walter Roberson
Walter Roberson on 2 Jul 2019
maxFrame = 300;
vid = videoinput('kinect', 1); %1 for color, 2 for depth
vid.FramesPerTrigger = 1;
vid.TriggerRepeat = maxFrame;
depth = videoinput('kinect', 2); %1 for color, 2 for depth
depth.FramesPerTrigger = 1;
depth.TriggerRepeat = maxFrame;
start(vid);
start(depth)
for nFrame = 1 : maxFrame
s = getdata(vid);
d = getdata(depth);
red = s(:,:,1);
[...]
end

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!