def get_capture(self, timeout=TIMEOUT_WAIT_INFINITE, color_only=False, transform_depth_to_color=True): """Get next capture Parameters: timeout: Timeout of capture color_only: If True, only color image will be returned transform_depth_to_color: If True, depth image will be transformed to the color image space Returns: color: Color image deoth: Depth image pose: Pose data of shape (num_bodies, num_joints, 10). Last dimension means: 0:2 - 2d keypoints projected to color image 2:5 - 3d keypoints in world depth image coordinates 5:9 - orientation 9 - confidence body_index_map: Body Index map is the body instance segmentation map. Each pixel maps to the corresponding pixel in the depth image or the ir image. The value for each pixel represents which body the pixel belongs to. It can be either background (value 255) or the index of a detected k4abt_body_t. """ res = k4a_module.device_get_capture(timeout) self._verify_error(res) color = k4a_module.device_get_color_image() if color_only: return color # depth = k4a_module.device_get_depth_image(transform_depth_to_color) # pose, body_index_map = k4a_module.device_get_pose_data() return color, depth, pose, body_index_map
def get_capture(self, timeout=TIMEOUT_WAIT_INFINITE, color_only=False, transform_depth_to_color=True): res = k4a_module.device_get_capture(timeout) self._verify_error(res) color = k4a_module.device_get_color_image() if color_only: return color depth = k4a_module.device_get_depth_image(transform_depth_to_color) return color, depth
def _get_capture_color(self) -> Optional[np.ndarray]: return k4a_module.device_get_color_image()