이 페이지는 기계 번역을 사용하여 번역되었습니다. 최신 내용을 영문으로 보려면 여기를 클릭하십시오.
Kinect for Windows V2에서 색상 및 깊이 스트림을 동시에 미리 보기
이 예제에서는 Kinect® for Windows® V2를 사용하여 색상 및 깊이 스트림을 미리 보는 방법을 보여줍니다.
요구 사항
MATLAB® 및 Image Acquisition Toolbox™
Kinect for Windows V2 센서
최소 PC 구성: Windows 10 64비트
Kinect for Windows V2 식별
imaqhwinfo("kinect")
명령은 Kinect의 색상 및 깊이 장치에 대한 정보를 제공합니다. Kinect에는 색상 센서와 깊이 센서라는 두 개의 센서가 있으므로 두 개의 장치로 열거됩니다.
kinectDeviceInfo = imaqhwinfo("kinect");
kinectDeviceInfo.DeviceIDs
ans=1×2 cell array
{[1]} {[2]}
컴퓨터 당 Kinect for Windows V2를 하나만 사용할 수 있습니다. 하지만 Kinect V1과 Kinect V2를 동일한 MATLAB 세션에서 함께 사용할 수 있습니다. 장치는 장치 ID [1],[2]
(Kinect V1) 및 [3],[4]
(Kinect V2)로 열거됩니다.
Kinect V2 장치 정보 얻기
특정 장치에 대한 정보는 장치 정보 구조체 배열을 인덱싱하기만 하면 얻을 수 있습니다.
Kinect 컬러 장치 정보를 얻으세요.
colorDevice = kinectDeviceInfo.DeviceInfo(1)
colorDevice = struct with fields:
DefaultFormat: 'BGR_1920x1080'
DeviceFileSupported: 0
DeviceName: 'Kinect V2 Color Sensor'
DeviceID: 1
VideoInputConstructor: 'videoinput('kinect', 1)'
VideoDeviceConstructor: 'imaq.VideoDevice('kinect', 1)'
SupportedFormats: {'BGR_1920x1080'}
Kinect 깊이 장치 정보를 얻으세요.
depthDevice = kinectDeviceInfo.DeviceInfo(2)
depthDevice = struct with fields:
DefaultFormat: 'Depth_512x424'
DeviceFileSupported: 0
DeviceName: 'Kinect V2 Depth Sensor'
DeviceID: 2
VideoInputConstructor: 'videoinput('kinect', 2)'
VideoDeviceConstructor: 'imaq.VideoDevice('kinect', 2)'
SupportedFormats: {'Depth_512x424'}
색상과 깊이 videoinput
객체 생성
videoinput
객체는 MATLAB와 이미지 수집 장치 간의 연결을 나타냅니다.
색상 videoinput
객체를 만듭니다.
colorVid = videoinput("kinect",1)
깊이 videoinput
객체를 생성합니다.
depthVid = videoinput("kinect",2)
색상 및 깊이 객체 모두 미리 보기
두 videoinput
객체를 미리 봅니다.
preview([colorVid depthVid]);
videoinput
객체 지우기
delete(colorVid); delete(depthVid);