Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A Python wrapper for Azure-Kinect-Sensor-SDK

License

NotificationsYou must be signed in to change notification settings

ykoneee/k4a-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 

Repository files navigation

k4a-python

PyPI
This library is a wrapper in Python for Azure-Kinect-Sensor-SDK

  • depth\color\ir image numpy data
  • depth (colorize)
  • depth to color transform
  • IMU data
  • read camera setting
  • set camera setting
  • some trivial functions, such as get_installed_count

Prereqs

Install

Linux

pip install k4a-python

pip install only have test on ubuntu 18.04, but it should aslo work well with other linux distributions.

Windows

pip on windows has not been tested, will test as soon.

TODO

  • other official c++ API
  • other official modules, like k4arecord
  • official example
  • Microphone data

Usage

The Python API mainly refers to theofficial C + + API
(Will have better example)
dirty example code :

import pyk4aimport cv2import numpy as npprint(pyk4a.Device.get_installed_count())device=pyk4a.Device.open(pyk4a.K4A_DEVICE_DEFAULT)print(device.get_serialnum())config = pyk4a.Configuration()config.depth_mode = pyk4a.K4A_DEPTH_MODE_WFOV_2X2BINNEDconfig.color_resolution = pyk4a.K4A_COLOR_RESOLUTION_720Pconfig.camera_fps = pyk4a.K4A_FRAMES_PER_SECOND_30config.color_format = pyk4a.K4A_IMAGE_FORMAT_COLOR_BGRA32config.synchronized_images_only = Truecalibration = device.get_calibration(config.depth_mode, config.color_resolution)transformation = pyk4a.Transformation(calibration)device.start_cameras(config)device.start_imu()capture=pyk4a.Capture()a=10while a>0:    a-=1    print(a)    if device.get_capture(capture,1000):        img=capture.get_color_image()        # img=transformation.depth_image_to_color_camera(img)        # print(img.get_device_timestamp())        print(device.get_raw_calibration())        img=img.numpy()        # state=device.get_imu_sample()        # print(state)        cv2.imshow('t',img)        cv2.waitKey(1)

About

A Python wrapper for Azure-Kinect-Sensor-SDK

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp