• This repository has been archived on 20/Feb/2021
  • Stars
    star
    114
  • Rank 308,031 (Top 7 %)
  • Language
    C++
  • License
    Other
  • Created about 11 years ago
  • Updated about 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Kinect Common Bridge

Introduction

Kinect Common Bridge is a complement to the Kinect for Windows SDK that makes it easy to integrate Kinect scenarios in creative development libraries and toolkits.

Why KCB?

When working with the openFrameworks and Cinder community members, it was evident that they needed something similar to the managed APIs but for C++. The graphics libraries they use are written entirely in native C++ for “down to the bare metal” performance to accomplish their craft. As for the functionality, they wanted something lightweight to keep the extensions to their libraries as lightweight as possible. If you are not familiar with these libraries or any type of game development model, they do not have a typical application design pattern. They need to run as fast as possible to run simulations, update positions of objects, and then render those on screen either as fast as possible or locked in sync with the refresh of the display. This can run at typical 60 frames per second (fps) and as high as the CPU/GPU can handle.

Many familiar with Kinect know the maximum frame rate is 30fps. Using an event based model doesn’t work well for this type of development since it needs to grab the frame of data when it wants, regardless of what Kinect is doing and if it isn’t there, it will catch it next time around. It cannot block the thread that does this update/query cycle.

Taking a look at the common use case scenarios, the common tasks when working with the Kinect for Windows SDK and the device are:

  1. Select a sensor
  2. Get the color/IR, depth, and skeleton data from it.

That was the goal of KCB: allow any framework that is capable of loading the DLL direct access to the data.

Requirements

The Hardware and Software below are required to build the library:

Additionally, to take advantage of the face tracking and speech recognition capabilities you need to install:

  • Speech Server SDK: It is available at http://www.microsoft.com/en-us/download/details.aspx?id=27226. Note that depending on the OS version and target platform that you are building for, you may need to have either x86, or x64, or both on your machine.

  • Kinect for Windows Developer Toolkit: It is available at http://go.microsoft.com/fwlink/?LinkID=323589 and is necessary for face tracking functionality. After the installation, make sure that the KINECT_TOOLKIT_DIR environment variable is set. Usually its value will be something like C:\Program Files\Microsoft SDKs\Kinect\Developer Toolkit v1.8.0. Tip: reboot your machine after installation even if Windows does not prompt you. Environment variables may not be updated until you do so, causing build errors.

Getting Started

Once you have built KinectCommonBridge.dll, you can load it in your C++ app and start grabbing a frame of data with literally 5 lines of code:

KCBHANDLE kcbHandle = KinectOpenDefaultSensor();

KINECT_IMAGE_FRAME_FORMAT format = { sizeof(KINECT_IMAGE_FRAME_FORMAT), 0 };
KinectGetColorFrameFormat( kcbHandle, &format );

BYTE* pColorBuffer = new BYTE[format.cbBufferSize];

KinectGetColorFrame( kcbHandle, format.cbBufferSize, pColorBuffer, null );

To make this more realistic, let's just add an infinite loop that gets the time stamps:

LONGLONG timeStamp = 0;
while( true )
{
	if( KinectIsColorFrameReady(kcbHandle) && SUCCEEDED( 
			KinectGetColorFrame( kcbHandle, format.cbBufferSize, pColorBuffer, &timeStamp ) ) )
	{
		printf( "Color frame acquired:  %I64u\r\n", timeStamp );
	}
}

More advanced functionality: face tracking and voice recognition

KCB has additional support for more advanced features of the sensor such as face tracking and voice recognition. Check out the samples folder for working code that illustrates how to get up and running quickly.

KCB builds with both face tracking and voice recognition enabled. To disable these items remove the following preprocessor defines from the C++ preprocessor properties of the KinectCommonBridge project:

KCB_ENABLE_FT
KCB_ENABLE_SPEECH

Note that you'd also want to disable voice recognition if you use VS Express since it is not bundled with ATL which is a dependency when using Speech API.

To enable face tracking and voice recognition in your own project, you will need to add the following preprocessor defines to your project's C++ preprocessor properties:

KCB_ENABLE_FT
KCB_ENABLE_SPEECH

If you enable face tracking with the KCB_ENABLE_FT preprocessor define, you will need to include the following dll's with your application:

FaceTrackData.dll
FaceTrackLib.dll

These DLLs are part of the Kinect for Windows Developer Toolkit and are located in C:\Program Files\Microsoft SDKs\Kinect\Developer Toolkit v1.8.0\Redist. You will need to copy the correct versions of the DLLs depending on if you are doing a Win32 or x64 build. The Win32 DLLs are in the Redist\x86 folder and the x64 DLLs are in the Redist\amd64 folder. You can use the following post build event commands to copy the DLLs to your project's output directory:

Win32 Post Build Event

xcopy "$(FTSDK_DIR)Redist\x86\FaceTrackLib.dll" "$(OutDir)" /eiycq
xcopy "$(FTSDK_DIR)Redist\x86\FaceTrackData.dll" "$(OutDir)" /eiycq

x64 Post Build Event

xcopy "$(FTSDK_DIR)Redist\amd64\FaceTrackLib.dll" "$(OutDir)" /eiycq
xcopy "$(FTSDK_DIR)Redist\amd64\FaceTrackData.dll" "$(OutDir)" /eiycq

Additional Resources

More Repositories

1

cqrs-journey

Microsoft patterns & pratices CQRS Journey sample application
C#
1,361
star
2

android-sliding-layer-lib

Highly customizable SlidingLayer as you have seen in Wunderlist
Java
932
star
3

msdn-code-gallery-microsoft

Samples from Microsoft teams for the MSDN Code Gallery
696
star
4

New-KrbtgtKeys.ps1

This script will enable you to reset the krbtgt account password and related keys while minimizing the likelihood of Kerberos authentication issues being caused by the operation.
PowerShell
392
star
5

semantic-logging

Supporting semantic/structured logging for .NET
C#
217
star
6

mef

C#
153
star
7

http2-katana

HTTP 2.0 with Katana
C#
133
star
8

Learn-LTI

Access the Microsoft Learn http://docs.microsoft.com/learn Catalog of Learning Paths and Modules directly from your Learning Management Systems using the Microsoft Learn LTI application
TypeScript
125
star
9

BatchAI

Repo for publishing code Samples and CLI samples for BatchAI service
Jupyter Notebook
124
star
10

clrprofiler

C#
124
star
11

api

The Wunderlist API Documentation
123
star
12

wunderlist.js

Wunderlist Javascript SDK
JavaScript
120
star
13

ttlcache

an in-memory LRU string-string map with expiration for golang
Go
109
star
14

iot-journey

a guidance project for implementing an IoT solution on Azure
C#
89
star
15

botauth

Authentication middleware for the botframework
C#
74
star
16

msdn-code-gallery-community-s-z

MSDN Code Gallery Community Samples S-Z
C#
73
star
17

enterprise-library

Microsoft Enterprise Library is a collection of reusable software components (application blocks) addressing common cross-cutting concerns.
C#
71
star
18

SilverlightToolkit

The Silverlight Toolkit provides open source controls and components for Silverlight developers
C#
68
star
19

changelog

Wunderlist Release Notes
53
star
20

msdn-code-gallery-community-a-c

MSDN Code Gallery Community Samples A-C
C#
49
star
21

msgraph-sdk-python

Microsoft Graph SDK for Python.
Python
48
star
22

HTTP-SPEED-PLUS-MOBILITY

Prototype of the HTTP Speed+ Mobility proposal submitted to IETF
C#
44
star
23

msdn-code-gallery-community-m-r

MSDN Code Gallery Community Samples M-R
C#
43
star
24

bono

Quantum visualizer
JavaScript
41
star
25

wlist

A command line client for Wunderlist
Ruby
39
star
26

wunderlist-python

Example code on how to talk to the Wunderlist API from Python.
Python
35
star
27

moxy

a multi-host reverse proxy for golang
Go
34
star
28

msdn-code-gallery-community-d-l

MSDN Code Gallery Community Samples D-L
C#
29
star
29

WindowsPhoneToolkit

The Windows Phone Toolkit provides additional controls and capabilities for Windows Phone XAML developers
C#
28
star
30

bcl

C#
26
star
31

clrsecurity

C#
25
star
32

AWS-SDK-for-WP

Windows Phone 7 SDK for Amazon Web Services
C#
22
star
33

microsoft-teams-apps-profileplus

20
star
34

cordova-plugin-auth-dialog

JavaScript
18
star
35

backbone-azure-mobile-services

Backbone sync for Azue Mobile Services
JavaScript
18
star
36

clj-bugsnag

Fully fledged Bugsnag client for Clojure. Supports ex-data and ring middleware.
Clojure
18
star
37

microsoft-teams-apps-boards

Boards is OOB Power App in Teams
17
star
38

microsoft-teams-apps-employeeideas

17
star
39

mobile-web

Project Silk's MileageStats enhanced with a mobile experience
C#
16
star
40

microsoft-teams-apps-issuereporting

16
star
41

ETWFlamegraph

Tool to generare Flamegraphs from etl files
JavaScript
16
star
42

microsoft-teams-apps-perspectives

Perspectives is OOB Power App in Teams
15
star
43

wamo

Python
15
star
44

msdn-code-gallery-community-0-9-non-alphabetic

MSDN Code Gallery Community Samples 0-9 and Non-Alphabetic
Visual Basic .NET
15
star
45

night-shift

A micro-framework to build data processing workflows with GNU Make
Python
14
star
46

hamustro

Hamustro - the collector of events.
Go
14
star
47

Kinect-for-Windows-Samples

13
star
48

microsoft-teams-apps-inspection

Enables front line workers to inspect an asset or area to manage quality of products and services or maintain safety at workplace
12
star
49

grunt-local-googlefont

Download and use local Google fonts in your Grunt jobs
JavaScript
12
star
50

graphics-dependencies

MSOpenTech graphics projects dependencies
C
11
star
51

OpenGAX

The Guidance Automation Extensions (GAX) expands the capabilities of Visual Studio by running guidance packages, which automate key development tasks from within the Visual Studio environment. The Guidance Automation Toolkit (GAT) allows authoring of guidance packages.
C#
11
star
52

wunderbits.core

Core components of Wunderbits. Dependency free, high quality, 100% coverage.
JavaScript
10
star
53

of-kinect-demos

Private Kinect V2 demos
C++
9
star
54

web-essentials

The tools, concepts, and docs for building things for the web
HTML
9
star
55

snowblower

Golang based Snowplow collector which forwards events to an SNS topic
Go
8
star
56

data-access-application-block

C#
8
star
57

transient-fault-handling-application-block

C#
8
star
58

microsoft-teams-apps-milestones

Milestones is an OOB Power App for Teams
8
star
59

cordova-azure-mobile-services

Cordova plugin for Azure Mobile Services
JavaScript
8
star
60

logsanitizer

Log processing and sanitizer tool written in Python.
Python
7
star
61

cocos2d-x-3.4-quickstart

Cocos2d-x v3.4 quick start challenge for GDC 2015
C++
7
star
62

painless-config-as-code

Environment variable resolution using configuration-as-code logic on top of painless-config. For Node.js apps.
JavaScript
7
star
63

cheetah

Command line interface for MSSQL
JavaScript
7
star
64

keyvault-configuration-resolver-node

Helpful Azure KeyVault configuration resolver for Node.js objects
JavaScript
7
star
65

data-pipeline

Exploring the problem of high-scale data ingestion on Azure
Groff
6
star
66

exception-handling-application-block

C#
6
star
67

cordova-cortana-plugin

JavaScript
6
star
68

Visual-Studio-Puppet-plugin

Puppet Plug-in for Visual Studio
C#
6
star
69

kinect-x64

x64 builds of Kinect Common Bridge
6
star
70

reliable

A reliable queue using redis
Ruby
5
star
71

python-social-auth

Python
5
star
72

enterprise-library-common-infrastructure

C#
5
star
73

edx-platform

edx platform
Python
5
star
74

validation-application-block

C#
4
star
75

trie.js

Trie structure based text search for the browser
JavaScript
4
star
76

talks

Here you can find different material, as talk slides, community stuff, workshop code, public snippets that the folks at 6Wunderkinder use in their community/talks/events that they collaborate
4
star
77

cordova-cortana-demo

A demo of using Cortana in a Cordova app
JavaScript
4
star
78

ff-jpegxr

Proof of Concept for jpegxr support in Firefox
C
4
star
79

logging-application-block

C#
4
star
80

wunderbits.db

Data storage for the browser
JavaScript
4
star
81

archived-repo

To gain access, please finish setting up this repository now at: https://repos.opensource.microsoft.com/microsoft/wizard?existingreponame=archived-repo&existingrepoid=607391243
4
star
82

function-configuration-resolver-node

A specialized Node.js module to execute all the functions within an object graph, intended to enable post-processing configuration objects.
JavaScript
4
star
83

appgateway-ios

Application Gateway - iOS version
Objective-C
3
star
84

braketini

martini middleware for reporting panics to airbrake
Go
3
star
85

cordova-pointerevents

cordova-pointerevents
JavaScript
3
star
86

mauer

frontend package manager with patching support
JavaScript
3
star
87

environment-configuration-resolver-node

Helpful environment variable resolver for Node.js objects that performs a deep walk looking for a custom env:// scheme
JavaScript
3
star
88

gostack

set of idiomatic golang middlewares for building web servers
Go
2
star
89

appgateway-android

Application Gateway - Android
Java
2
star
90

policy-injection-application-block

C#
2
star
91

msopentech.github.io

JavaScript
2
star
92

freight-truck

S3 uploader grunt task
JavaScript
2
star
93

microsoft-teams-apps-howto

2
star
94

crud.js

Browsers databases available as CRUD stores
JavaScript
2
star
95

microsoft-teams-apps-bulletins

Bulletins is OOB Power App in Teams
2
star
96

Cocos2dGame-v3.7

Cocos2d-x v3.7 Windows 10 QuickStart Challenge for OSCON
C++
2
star
97

wunderlist.github.io

Wunderlist developer Zeug
HTML
2
star
98

angle-win8.0

Angle for Windows 8.0 Phone and Store Apps
C++
2
star
99

.github

1
star
100

handlebars-anti-clickjack

Simple handlebars helper for preventing iframe click jacking
JavaScript
1
star