simple-read
Overview
This example demonstrates how to get the distance (depth) value from the camera for a specific point.
Expect Output
Tutorial
Import openni package
Initialize SDK
Connect to camera
Create depth stream and start it
Read frame from camera and retrieve the depth data
Depth data is stored in order, from top left to bottom right. We calculate the index of the center point of the frame according to the width and height. Then get the value of it.
Full code
Last updated