package module
Version: v0.0.0-...-56e2ec9 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2020 License: MIT Imports: 6 Imported by: 0



This repository is a simple Go wrapper around the Azure Kinect SDK.

The library is work in progress, and requires at least Go v1.12 to run.


Use image transformation





View Source
const (
	// ColorImage ...
	ColorImage = iota
	// DepthImage ...
	// DepthTransformed is the depth image mapped on the RGB image
View Source
const (
	// Default is the default ID for one connected Kinect
	Default = 0


This section is empty.


func AvailableDevices

func AvailableDevices() uint

AvailableDevices returns the number of devices attached to the computer


type Capture

type Capture struct {
	// contains filtered or unexported fields

Capture encapsulates a Kinect capture

func NewCapture

func NewCapture(d *Device) *Capture

NewCapture returns a new capture object

func (*Capture) ColorImage

func (c *Capture) ColorImage() *image.RGBA

ColorImage converts and returns the RGBA data into a Go image. If no image could be found, nil is returned

func (*Capture) DepthImage

func (c *Capture) DepthImage() *image.Gray16

DepthImage converts and returns the depth value as a gray16 image. If no image could be found, nil is returned

func (*Capture) DepthTransformed

func (c *Capture) DepthTransformed() *image.Gray16

DepthTransformed converts and returns the transformed depth value as a gray16 image. If no image could be found, nil is returned

func (*Capture) SingleShot

func (c *Capture) SingleShot() error

SingleShot makes one capture shot and stores the data. It also releases the capture data.

type Device

type Device struct {
	ID        uint32 // device ID
	Fps       uint32 // actual FPS
	Capturing bool   // indicates if the device is in capturing mode

	Calibration C.k4a_calibration_t // stores the calibration
	// contains filtered or unexported fields

Device represents one Kinect DK device

func NewDevice

func NewDevice(id uint32) *Device

NewDevice creates a new k4ago device

func (*Device) Close

func (d *Device) Close()

Close releases all resources

func (*Device) GetHandle

func (d *Device) GetHandle() C.k4a_device_t

GetHandle returns the native handle

func (*Device) Open

func (d *Device) Open() error

Open opens the device and establishes the connection. Please make sure to close the device after usage!

func (*Device) SerialNumber

func (d *Device) SerialNumber() (string, error)

SerialNumber returns the serial number of the device

func (*Device) Start

func (d *Device) Start() error

Start starts the camera stream

func (*Device) Stop

func (d *Device) Stop()

Stop stops the camera stream

func (*Device) UpdateConfig

func (d *Device) UpdateConfig(config DeviceConfig) error

UpdateConfig sets the configuration for the Kinect sensor and reads the new calibration data

func (*Device) Versions

func (d *Device) Versions() (DeviceVersions, error)

Versions returns the stored sensor versions

type DeviceConfig

type DeviceConfig struct {
	Fps             int
	DepthMode       int
	ColorFormat     int
	ColorResolution int
	SyncDepthAndRgb bool

DeviceConfig configures the device parameters

type DeviceVersions

type DeviceVersions struct {
	Rgb    string
	Depth  string
	Audio  string
	Sensor string

DeviceVersions gives information about device sensor versions

func (DeviceVersions) String

func (v DeviceVersions) String() string

type Image

type Image struct {
	Type   ImageType
	Width  int
	Height int
	Raw    []byte

Image represents a container for a raw capture image of a type

type ImageType

type ImageType int

ImageType for the type


Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL