示例#1
0
    def __init__(self, modulePath, sensor_calibration, modelType):

        _k4abt.k4abt.setup_library(modulePath)
        self.k4abt = _k4abt.k4abt()

        try:
            cdll.LoadLibrary(
                "C:/Program Files/Azure Kinect Body Tracking SDK/tools/directml.dll"
            )
        except Exception as e:
            _k4abt.K4ABT_TRACKER_CONFIG_DEFAULT.processing_mode = _k4abt.K4ABT_TRACKER_PROCESSING_MODE_GPU_CUDA

        self.tracker_handle = _k4abt.k4abt_tracker_t()
        if modelType == 1:
            try:
                _k4abt.K4ABT_TRACKER_CONFIG_DEFAULT.model_path = "C:/Program Files/Azure Kinect Body Tracking SDK/sdk/windows-desktop/amd64/release/bin/dnn_model_2_0_lite_op11.onnx".encode(
                    'utf-8')
            except Exception as e:
                print(
                    "Failed to find lite model. Check that you are using Body Tracker version 1.1.0\n"
                )
                print("Switching to the original body tracking model\n\n\n")

        self.tracker_config = _k4abt.K4ABT_TRACKER_CONFIG_DEFAULT
        self.body_frame_handle = _k4abt.k4abt_frame_t()
        self.segmented_body_img = _k4a.k4a_image_t()
        self.capture_handle = _k4a.k4a_capture_t()
        self.sensor_calibration = sensor_calibration

        self.tracker_running = False
        self.bodiesNow = []

        self.initializeTracker()
示例#2
0
	def __init__(self,modulePath='C:\\Program Files\\Azure Kinect SDK v1.4.0\\sdk\\windows-desktop\\amd64\\release\\bin\\k4a.dll'):

		self.k4a = _k4a.k4a(modulePath)

		self.device_handle = _k4a.k4a_device_t()
		self.capture_handle = _k4a.k4a_capture_t()	
		self.config = config()
		self.imu_sample = _k4a.k4a_imu_sample_t()

		self.cameras_running = False
		self.imu_running = False
    def __init__(self, modulePath, sensor_calibration):
        self.k4abt = _k4abt.k4abt(modulePath)

        self.tracker_handle = _k4abt.k4abt_tracker_t()
        self.tracker_config = _k4abt.K4ABT_TRACKER_CONFIG_DEFAULT
        self.body_frame_handle = _k4abt.k4abt_frame_t()
        self.segmented_body_img = _k4a.k4a_image_t()
        self.capture_handle = _k4a.k4a_capture_t()
        self.sensor_calibration = sensor_calibration

        self.tracker_running = False
        self.bodiesNow = []

        self.initializeTracker()
示例#4
0
    def __init__(self, modulePath=None):
        if modulePath is None:
            if platform.system().lower() == 'linux':
                modulePath = r'/usr/lib/x86_64-linux-gnu/libk4a.so'
            else:
                modulePath = 'C:\\Program Files\\Azure Kinect SDK v1.4.0\\sdk\\windows-desktop\\amd64\\release\\bin\\k4a.dll'
        self.k4a = _k4a.k4a(modulePath)

        self.device_handle = _k4a.k4a_device_t()
        self.capture_handle = _k4a.k4a_capture_t()
        self.config = config()
        self.imu_sample = _k4a.k4a_imu_sample_t()

        self.cameras_running = False
        self.imu_running = False