You are on page 1of 587

Intel RealSense SDK 2016 R2

Reference Manual
API Version 10.0

Table of Contents
Introducing the SDK

13

Basic Concepts

13

SDK Interfaces ................................................................................................................................... 14


Languages and Frameworks
Support
...................................................................................................................................
16
Session and Modules
................................................................................................................................... 18
Language-Specific
Restrictions
...................................................................................................................................
19
Streaming through
SenseManager
...................................................................................................................................
23
Raw Stream Capturing
and Processing
...................................................................................................................................
31
Capturing Individual Color
..........................................................................................................................................................
or Depth Stream
31
Capturing Unaligned Color
..........................................................................................................................................................
and Depth Streams
37
Capturing Aligned Color
..........................................................................................................................................................
and Depth Streams
44
......................................................................................................................................................... 49
Enabling Strong Synchronization
53
Capturing Unrectified.........................................................................................................................................................
Streams [R200]
Recording and Playing..........................................................................................................................................................
Back
56
Playback Modes

......................................................................................................................................................... 59

......................................................................................................................................................... 62
File Compression [Experimental]
Known Limitations ......................................................................................................................................................... 63
Accessing Image Data .......................................................................................................................................................... 64

I/O Device Operations


................................................................................................................................... 67
Enumerating Devices .......................................................................................................................................................... 67
Getting/Setting Device ..........................................................................................................................................................
Properties
70
Enumerating Streams .......................................................................................................................................................... 71
Enumerating Stream Configurations
.......................................................................................................................................................... 73
Working with Peripheral
..........................................................................................................................................................
Devices
74

Coordinate Systems
................................................................................................................................... 76
Configuring Coordinate..........................................................................................................................................................
System
78
Coordinates Mapping .......................................................................................................................................................... 80

Working with Camera


SR300
...................................................................................................................................
82
Activating F200 Compatibility
..........................................................................................................................................................
Mode
83
SDK Interface Compatibility
.......................................................................................................................................................... 83
SDK Interface Incompatibility
.......................................................................................................................................................... 86
Writing Camera Specific
..........................................................................................................................................................
Code [Advanced]
87

Working with the...................................................................................................................................


R200 Enhanced Mode
89
Checking R200 Enhanced
.......................................................................................................................................................... 90
Selecting R200 Enhanced
.......................................................................................................................................................... 90
Streaming with R200 Enhanced
.......................................................................................................................................................... 92
Taking Photo

.......................................................................................................................................................... 93

Interface Reference
................................................................................................................................... 95
AddRef
Constants

.......................................................................................................................................................... 96
......................................................................................................................................................... 98

Member Functions ......................................................................................................................................................... 98


......................................................................................................................................... 98
AddRef
2

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Base

.......................................................................................................................................................... 99

Constants

......................................................................................................................................................... 100

Member Functions ......................................................................................................................................................... 100


......................................................................................................................................... 101
close (Java)
Dispose (C#)

......................................................................................................................................... 101

QueryInstance

......................................................................................................................................... 102

......................................................................................................................................... 103
Release (C++)
Calibration
.......................................................................................................................................................... 104
Constants

......................................................................................................................................................... 106

Member Functions ......................................................................................................................................................... 106


......................................................................................................................................... 106
QueryStreamProjectionParameters
......................................................................................................................................... 107
QueryStreamProjectionParametersEx
Capture (+JS)
.......................................................................................................................................................... 108
......................................................................................................................................................... 112
Callbacks and Delegates
......................................................................................................................................... 112
Handler
Member Functions

................................................................................................................................... 114

................................................................................................................................... 114
OnDeviceListChanged
......................................................................................................................................................... 115
Constants
Member Functions ......................................................................................................................................................... 115
......................................................................................................................................... 115
CreateDevice
QueryDeviceInfo

......................................................................................................................................... 116

QueryDeviceNum

......................................................................................................................................... 117

......................................................................................................................................... 118
SubscribeCaptureCallbacks
......................................................................................................................................... 118
UnsubscribeCaptureCallbacks
Static Functions

......................................................................................................................................................... 119

StreamTypeFromIndex

......................................................................................................................................... 119

StreamTypeToIndex

......................................................................................................................................... 120

......................................................................................................................................... 121
StreamTypeToString
CaptureManager (+JS,+UWP)
.......................................................................................................................................................... 122
Constants

......................................................................................................................................................... 125

......................................................................................................................................................... 125
Callbacks and Delegates
......................................................................................................................................... 125
Handler
Member Functions

................................................................................................................................... 128

OnCreateDevice

................................................................................................................................... 128

OnSetupStreams

................................................................................................................................... 129

................................................................................................................................... 130
OnNextDevice
Member Functions ......................................................................................................................................................... 131
CloseStreams

......................................................................................................................................... 132

FilterByDeviceInfo (+UWP)......................................................................................................................................... 133


......................................................................................................................................... 134
FilterByStreamProfiles
LocateStreams

......................................................................................................................................... 135

QueryCapture

......................................................................................................................................... 137

QueryDevice

......................................................................................................................................... 138

QueryFrameByIndex

......................................................................................................................................... 139

QueryNumberOfFrames

......................................................................................................................................... 140

QueryFrameByTimeStamp......................................................................................................................................... 141
......................................................................................................................................... 141
QueryImageSize (+JavaScript)
ReadModuleStreamsAsync......................................................................................................................................... 143
......................................................................................................................................... 144
RequestStreams
SetFileName

......................................................................................................................................... 145

SetFrameByIndex

......................................................................................................................................... 146

SetFrameByTimeStamp ......................................................................................................................................... 147


......................................................................................................................................... 148
SetMask
SetPause
3

......................................................................................................................................... 149

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

......................................................................................................................................... 150

SetRealtime
Properties

......................................................................................................................................................... 151

capture (C#,JS)

......................................................................................................................................... 151

......................................................................................................................................... 152
device (C#,JS,UWP)
Device (+JS,+UWP) .......................................................................................................................................................... 152
Constants

......................................................................................................................................................... 153

153
Member Functions: .........................................................................................................................................................
Device Neutral
......................................................................................................................................... 156
CreateProjection
......................................................................................................................................... 158
IsStreamProfileSetValid (+UWP)
QueryColorAutoExposure ......................................................................................................................................... 159
......................................................................................................................................... 161
QueryColorAutoPowerLineFrequency
......................................................................................................................................... 162
QueryColorAutoWhiteBalance
......................................................................................................................................... 163
QueryColorBackLightCompensation
......................................................................................................................................... 164
QueryColorBackLightCompensationInfo
QueryColorBrightness

......................................................................................................................................... 165

QueryColorBrightnessInfo ......................................................................................................................................... 166


......................................................................................................................................... 167
QueryColorContrast
QueryColorContrastInfo

......................................................................................................................................... 168

QueryColorExposure

......................................................................................................................................... 169

QueryColorExposureInfo ......................................................................................................................................... 170


......................................................................................................................................... 171
QueryColorHue
QueryColorHueInfo

......................................................................................................................................... 172

QueryColorFieldOfView

......................................................................................................................................... 173

QueryColorFocalLength

......................................................................................................................................... 174

QueryColorFocalLengthMM......................................................................................................................................... 175
......................................................................................................................................... 176
QueryColorGain
QueryColorGainInfo

......................................................................................................................................... 177

QueryColorGamma

......................................................................................................................................... 178

QueryColorGammaInfo

......................................................................................................................................... 179

......................................................................................................................................... 180
QueryColorPowerLineFrequency
......................................................................................................................................... 181
QueryColorPowerLineFrequencyDefaultValue
QueryColorPrincipalPoint ......................................................................................................................................... 182
......................................................................................................................................... 183
QueryColorSaturation
QueryColorSaturationInfo ......................................................................................................................................... 184
......................................................................................................................................... 185
QueryColorSharpness
QueryColorSharpnessInfo ......................................................................................................................................... 186
QueryColorWhiteBalance ......................................................................................................................................... 187
......................................................................................................................................... 188
QueryColorWhiteBalanceInfo
......................................................................................................................................... 189
QueryDepthConfidenceThreshold
......................................................................................................................................... 190
QueryDepthConfidenceThresholdInfo
QueryDepthFieldOfView ......................................................................................................................................... 191
QueryDepthFocalLength ......................................................................................................................................... 192
......................................................................................................................................... 193
QueryDepthFocalLengthMM
......................................................................................................................................... 194
QueryDepthLowConfidenceValue
QueryDepthPrincipalPoint ......................................................................................................................................... 195
QueryDepthSensorRange ......................................................................................................................................... 196
......................................................................................................................................... 197
QueryDeviceAllowProfileChange
QueryDeviceInfo

......................................................................................................................................... 198

QueryDepthUnit

......................................................................................................................................... 198

QueryMirrorMode

......................................................................................................................................... 199

QueryStreamProfileSet

......................................................................................................................................... 201

......................................................................................................................................... 202
QueryStreamProfileSetNum
......................................................................................................................................... 203
ReadStreams
ReadStreamsAsync
4

......................................................................................................................................... 204

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

ResetProperties (+JS)

......................................................................................................................................... 206

.........................................................................................................................................
207
RestorePropertiesUponFocus
(+JS)
......................................................................................................................................... 208
SetColorAutoExposure
SetColorAutoWhiteBalance......................................................................................................................................... 209
......................................................................................................................................... 209
SetColorAutoPowerLineFrequency
......................................................................................................................................... 210
SetColorBackLightCompensation
......................................................................................................................................... 211
SetColorBrightness
SetColorContrast

......................................................................................................................................... 212

SetColorExposure

......................................................................................................................................... 213

SetColorHue

......................................................................................................................................... 214

SetColorGamma

......................................................................................................................................... 215

SetColorGain

......................................................................................................................................... 216

......................................................................................................................................... 217
SetColorPowerLineFrequency
......................................................................................................................................... 218
SetColorSaturation
SetColorSharpness

......................................................................................................................................... 219

SetColorWhiteBalance

......................................................................................................................................... 220

......................................................................................................................................... 221
SetDepthConfidenceThreshold
......................................................................................................................................... 222
SetDepthUnit
......................................................................................................................................... 223
SetDeviceAllowProfileChange
......................................................................................................................................... 224
SetMirrorMode
......................................................................................................................................... 225
SetStreamProfileSet
226
Member Functions: .........................................................................................................................................................
F200 & SR300 Functions
......................................................................................................................................... 226
QueryIVCAMAccuracy
......................................................................................................................................... 228
QueryIVCAMAccuracyDefaultValue
QueryIVCAMFilterOption ......................................................................................................................................... 229
......................................................................................................................................... 231
QueryIVCAMFilterOptionInfo
QueryIVCAMLaserPower ......................................................................................................................................... 232
......................................................................................................................................... 233
QueryIVCAMLaserPowerInfo
......................................................................................................................................... 234
QueryIVCAMMotionRangeTradeOff
......................................................................................................................................... 235
QueryIVCAMMotionRangeTradeOffInfo
......................................................................................................................................... 236
SetIVCAMAccuracy
SetIVCAMFilterOption

......................................................................................................................................... 236

SetIVCAMLaserPower

......................................................................................................................................... 238

......................................................................................................................................... 239
SetIVCAMMotionRangeTradeOff
240
Member Functions: .........................................................................................................................................................
SR300 Functions
......................................................................................................................................... 240
QuerySR300ColorExposurePriority
......................................................................................................................................... 242
QuerySR300ColorExposurePriorityInfo
......................................................................................................................................... 243
SetSR300ColorExposurePriority
243
Member Functions: .........................................................................................................................................................
R200 Functions
......................................................................................................................................... 244
QueryDSColorRectificationEnabled
......................................................................................................................................... 246
QueryDSDepthRectificationEnabled
QueryDSDisparityMultiplier......................................................................................................................................... 247
......................................................................................................................................... 248
QueryDSDisparityOutputEnabled
......................................................................................................................................... 249
QueryDSDisparityShift
QueryDSEmitterEnabled ......................................................................................................................................... 250
QueryDSLeftRightCropping......................................................................................................................................... 251
......................................................................................................................................... 252
QueryDSLeftRightExposure
......................................................................................................................................... 253
QueryDSLeftRightExposureInfo
QueryDSLeftRightGain

......................................................................................................................................... 254

QueryDSLeftRightGainInfo ......................................................................................................................................... 255


......................................................................................................................................... 256
QueryDSMinMaxZ
SetDSMinMaxZ

......................................................................................................................................... 257

......................................................................................................................................... 257
SetDSLeftRightAutoExposure
SetDSLeftRightCropping ......................................................................................................................................... 258
5

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

SetDSLeftRightExposure ......................................................................................................................................... 259


......................................................................................................................................... 260
SetDSLeftRightGain
SetDSEnableEmitter

......................................................................................................................................... 261

......................................................................................................................................... 262
SetDSEnableDisparityOutput
SetDSDisparityMultiplier ......................................................................................................................................... 263
......................................................................................................................................... 264
SetDSDisparityShift
......................................................................................................................................................... 265

Properties

deviceInfo (+JS,+UWP)

......................................................................................................................................... 265

......................................................................................................................................... 266
Sources (UWP)
Static Functions ......................................................................................................................................................... 266
Image

......................................................................................................................................... 266
FindAllAsync (UWP)
.......................................................................................................................................................... 267

Constants

......................................................................................................................................................... 269

Member Functions ......................................................................................................................................................... 269


......................................................................................................................................... 270
AcquireAccess
AddRef

......................................................................................................................................... 272

CopyImage

......................................................................................................................................... 273

ExportData

......................................................................................................................................... 274

ImportData

......................................................................................................................................... 275

QueryInfo

......................................................................................................................................... 276

QueryOptions

......................................................................................................................................... 277

QueryStreamType

......................................................................................................................................... 278

QueryTimeStamp

......................................................................................................................................... 280

ReleaseAccess

......................................................................................................................................... 280

SetOptions

......................................................................................................................................... 281

SetStreamType

......................................................................................................................................... 282

SetTimeStamp

......................................................................................................................................... 283

Properties (C#)

......................................................................................................................................................... 284

info

......................................................................................................................................... 285

options

......................................................................................................................................... 285

timeStamp

......................................................................................................................................... 285

......................................................................................................................................... 286
streamType
NativeTexturePlugin (Unity)
.......................................................................................................................................................... 286
Member Functions ......................................................................................................................................................... 289
......................................................................................................................................... 289
UpdateTextureNative (Unity)
Static Functions

......................................................................................................................................................... 290

......................................................................................................................................... 290
Activate (Unity)
Metadata
.......................................................................................................................................................... 290
Constants

......................................................................................................................................................... 291

Member Functions ......................................................................................................................................................... 291


......................................................................................................................................... 292
AttachBuffer
AttachSerializable

......................................................................................................................................... 293

CreateSerializable

......................................................................................................................................... 294

DetachMetaData

......................................................................................................................................... 295

QueryBuffer

......................................................................................................................................... 296

QueryBufferSize

......................................................................................................................................... 297

QueryMetaData

......................................................................................................................................... 298

QueryUID

......................................................................................................................................... 299

Properties (C#)

......................................................................................................................................................... 300

......................................................................................................................................... 300
uid
PlatformCameraControl
.......................................................................................................................................................... 300
......................................................................................................................................................... 303
Callbacks and Delegates
......................................................................................................................................... 303
Handler
Member Functions
6

................................................................................................................................... 305

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

OnPlatformCameraSample................................................................................................................................... 306
OnPlatformCameraError ................................................................................................................................... 306
......................................................................................................................................................... 307

Constants

Member Functions ......................................................................................................................................................... 308


......................................................................................................................................... 309
CreatePhotoProjection
EnumPhotoProfile

......................................................................................................................................... 309
......................................................................................................................................... 310

TakePhoto
PowerState

.......................................................................................................................................................... 312

Constants

......................................................................................................................................................... 315

Member Functions ......................................................................................................................................................... 315


......................................................................................................................................... 315
QueryInactivityInterval
QueryState

......................................................................................................................................... 316

SetInactivityInterval

......................................................................................................................................... 317

SetState
Projection

......................................................................................................................................... 317
.......................................................................................................................................................... 318

Constants

......................................................................................................................................................... 321

Member Functions ......................................................................................................................................................... 321


......................................................................................................................................... 321
CreateColorImageMappedToDepth
......................................................................................................................................... 322
CreateDepthImageMappedToColor
......................................................................................................................................... 323
MapColorToDepth
MapDepthToColor

......................................................................................................................................... 325

ProjectCameraToColor

......................................................................................................................................... 326

ProjectCameraToDepth

......................................................................................................................................... 327

ProjectColorToCamera

......................................................................................................................................... 328

ProjectDepthToCamera

......................................................................................................................................... 329

QueryInvUVMap

......................................................................................................................................... 330

QueryUVMap

......................................................................................................................................... 331

QueryVertices

......................................................................................................................................... 332

......................................................................................................................................... 333
SelectOption
SampleReader (UWP).......................................................................................................................................................... 334
......................................................................................................................................................... 336

Events

SampleArrived (UWP)

......................................................................................................................................... 336

................................................................................................................................... 337
SampleArrivedEventArgs (UWP)
Member Functions ......................................................................................................................................................... 337
EnableStream[s] (UWP) ......................................................................................................................................... 337
......................................................................................................................................................... 338

Properties

......................................................................................................................................... 338

sample (UWP)

......................................................................................................................................... 339

paused (UWP)
Static Functions

......................................................................................................................................................... 339

......................................................................................................................................... 339
Activate (UWP)
SenseManager (+JS,+UWP)
.......................................................................................................................................................... 341
Constants

......................................................................................................................................................... 349

......................................................................................................................................................... 349
Callbacks and Delegates
......................................................................................................................................... 349
Handler
Member Functions

................................................................................................................................... 351

OnConnect

................................................................................................................................... 351

OnModuleProcessedFrame................................................................................................................................... 353
................................................................................................................................... 354
OnModuleSetProfile

Events

OnNewSample

................................................................................................................................... 355

OnStatus

................................................................................................................................... 356
......................................................................................................................................................... 357

......................................................................................................................................... 357
DeviceConnected (JS,UWP)
...................................................................................................................................
359
DeviceConnectedEventArgs
(UWP)
StatusChanged (JS,UWP) ......................................................................................................................................... 359
7

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

................................................................................................................................... 360
StatusChangedEventArgs (UWP)
......................................................................................................................................................... 361
Member Functions Essentials
......................................................................................................................................... 361
AcquireFrame (+UWP)
Close[Down] (+JS,+UWP) ......................................................................................................................................... 364
......................................................................................................................................... 365
EnableModule
Init[Async] (+JS,+UWP) ......................................................................................................................................... 366
......................................................................................................................................... 368
IsConnected
PauseModule

......................................................................................................................................... 369

QuerySession

......................................................................................................................................... 370

QueryCaptureManager

......................................................................................................................................... 371

QueryModule

......................................................................................................................................... 372

Release (C++,JS)

......................................................................................................................................... 373

ReleaseFrame (+UWP)

......................................................................................................................................... 374

FlushFrame

......................................................................................................................................... 375

......................................................................................................................................... 375
StreamFrames (+JS,+UWP)
.........................................................................................................................................................
377
Member Functions (3D
Scanning)
Enable3DScan

......................................................................................................................................... 377

Query3DScan

......................................................................................................................................... 378

.........................................................................................................................................................
379
Member Functions (Blob
Tracking)
......................................................................................................................................... 379
EnableBlob
PauseBlob

......................................................................................................................................... 380

QueryBlob

......................................................................................................................................... 381

......................................................................................................................................... 382
QueryBlobSample
.........................................................................................................................................................
383
Member Functions (Enhanced
Video)
EnableEnhancedVideo

......................................................................................................................................... 383

PauseEnhancedVideo

......................................................................................................................................... 384

QueryEnhancedVideo

......................................................................................................................................... 385

......................................................................................................................................... 386
QueryEnhancedVideoSample
.........................................................................................................................................................
387
Member Functions (Face
Tracking)
EnableFace

......................................................................................................................................... 387

PauseFace

......................................................................................................................................... 388

QueryFace

......................................................................................................................................... 389

......................................................................................................................................... 390
QueryFaceSample
.........................................................................................................................................................
391
Member Functions (Hand
Cursor)
EnableHandCursor

......................................................................................................................................... 391

PauseHandCursor

......................................................................................................................................... 392

QueryHandCursor

......................................................................................................................................... 393

QueryHandCursorSample ......................................................................................................................................... 394


.........................................................................................................................................................
395
Member Functions (Hand
Tracking)
EnableHand

......................................................................................................................................... 395

PauseHand

......................................................................................................................................... 396

QueryHand

......................................................................................................................................... 397

......................................................................................................................................... 398
QueryHandSample
.........................................................................................................................................................
399
Member Functions (Object
Recognition)
EnableObjectRecognition ......................................................................................................................................... 399
PauseObjectRecognition ......................................................................................................................................... 400
QueryObjectRecognition ......................................................................................................................................... 401
......................................................................................................................................... 402
QueryObjectRecognitionSample
.........................................................................................................................................................
403
Member Functions (Object
Tracking)
......................................................................................................................................... 403
EnableTracker
PauseTracker

......................................................................................................................................... 404

QueryTracker

......................................................................................................................................... 405

......................................................................................................................................... 406
QueryTrackerSample
.........................................................................................................................................................
407
Member Functions (Person
Tracking)
8

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

EnablePersonTracking

......................................................................................................................................... 407

PausePersonTracking

......................................................................................................................................... 408

QueryPersonTracking

......................................................................................................................................... 409

......................................................................................................................................... 410
QueryPersonTrackingSample
.........................................................................................................................................................
411
Member Functions (Scene
Perception)
EnableScenePerception ......................................................................................................................................... 411
PauseScenePerception ......................................................................................................................................... 412
QuerySenePerception

......................................................................................................................................... 413

......................................................................................................................................... 414
QueryScenePerceptionSample
.........................................................................................................................................................
415
Member Functions (Stream
Capture)
EnableStream[s]

......................................................................................................................................... 415

QuerySample

......................................................................................................................................... 417

.........................................................................................................................................................
418
Member Functions (Touchless
Controller)
EnableTouchlessController......................................................................................................................................... 419
PauseTouchlessController ......................................................................................................................................... 420
QueryTouchlessController ......................................................................................................................................... 420
.........................................................................................................................................................
421
Member Functions (User
Segmentation)
......................................................................................................................................... 422
Enable3DSeg
Pause3DSeg

......................................................................................................................................... 423

Query3DSeg

......................................................................................................................................... 423

......................................................................................................................................... 424
Query3DSegSample
......................................................................................................................................................... 425
Properties
......................................................................................................................................... 426
captureManager (C#,JS,UWP)
......................................................................................................................................... 426
sample (UWP)
......................................................................................................................................... 427
session (C#,JS)
......................................................................................................................................................... 427

Static Functions

......................................................................................................................................... 428
CreateInstance (+JS,+UWP)
......................................................................................................................................... 429
detectPlatform (JS)
Session (+JS)

.......................................................................................................................................................... 432

Constants

......................................................................................................................................................... 435

Member Functions ......................................................................................................................................................... 435


......................................................................................................................................... 435
CreateAudio
CreateAudioSource

......................................................................................................................................... 438

CreateCaptureManager

......................................................................................................................................... 438

CreateImage

......................................................................................................................................... 439

CreateImpl

......................................................................................................................................... 441

CreatePhoto

......................................................................................................................................... 443

CreatePowerManager

......................................................................................................................................... 444

CreateSenseManager

......................................................................................................................................... 444

LoadImplFromFile

......................................................................................................................................... 445

QueryCoordinateSystem ......................................................................................................................................... 446


......................................................................................................................................... 447
QueryImpl
QueryImpls (JS)

......................................................................................................................................... 448

QueryModuleDesc (+JS) ......................................................................................................................................... 449


......................................................................................................................................... 450
QueryVersion
SetCoordinateSystem

......................................................................................................................................... 451

......................................................................................................................................... 452
UnloadImplFromFile
Properties (C#, JS) ......................................................................................................................................................... 453
version
Static Functions

......................................................................................................................................... 453
......................................................................................................................................................... 454

......................................................................................................................................... 454
CreateInstance
SyncPoint
.......................................................................................................................................................... 455
Constants

......................................................................................................................................................... 456

Member Functions ......................................................................................................................................................... 456


9

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Synchronize

......................................................................................................................................... 456

Static Functions

......................................................................................................................................................... 457
......................................................................................................................................... 457

ReleaseSP

......................................................................................................................................... 459
SynchronizeEx
VideoModule
.......................................................................................................................................................... 461
Constants

......................................................................................................................................................... 463

Member Functions ......................................................................................................................................................... 463


......................................................................................................................................... 463
ProcessImageAsync
ProcessSample

......................................................................................................................................... 464

QueryCaptureProfile

......................................................................................................................................... 465

SetCaptureProfile

......................................................................................................................................... 467

SetGPUExec

......................................................................................................................................... 467

SetProjection

......................................................................................................................................... 468

Structure Reference
................................................................................................................................... 469
Box3DF32

.......................................................................................................................................................... 470

DataDesc

.......................................................................................................................................................... 471

DeviceCap

.......................................................................................................................................................... 472

DeviceInfo (Capture,+JS,+UWP)
.......................................................................................................................................................... 473
ImageData

.......................................................................................................................................................... 477

Member Functions ......................................................................................................................................................... 478


FromByteArray (C#,Java) ......................................................................................................................................... 479
FromFloatArray (C#,Java) ......................................................................................................................................... 480
FromPImage (Processing) ......................................................................................................................................... 480
FromShortArray (C#,Java) ......................................................................................................................................... 481
......................................................................................................................................... 482
FromTexture2D (Unity)
FromUShortArray (C#)

......................................................................................................................................... 482

ToBitmap (C# .NET4)

......................................................................................................................................... 483

ToByteArray (C#,Java)

......................................................................................................................................... 484

ToFloatArray (C#,Java)

......................................................................................................................................... 485

ToPImage (Processing)

......................................................................................................................................... 486

ToShortArray (C#,Java)

......................................................................................................................................... 487

ToTexture2D (Unity)

......................................................................................................................................... 487

ToUShortArray (C#)

......................................................................................................................................... 488

......................................................................................................................................... 489
ToWriteableBitmap (C# .NET4)
ImageInfo
.......................................................................................................................................................... 490
ImplDesc (+JS)

.......................................................................................................................................................... 491

ImplVersion (+JS)

.......................................................................................................................................................... 495

Point3DF32 (+JS)

.......................................................................................................................................................... 496

Point4DF32 (+JS)

.......................................................................................................................................................... 497

PointF32 (+JS)

.......................................................................................................................................................... 499

PointI32 (+JS)

.......................................................................................................................................................... 500

PropertyInfo

.......................................................................................................................................................... 501

RangeF32

.......................................................................................................................................................... 502

RatioI32

.......................................................................................................................................................... 503

RectF32

.......................................................................................................................................................... 504

RectI32 (+JS)

.......................................................................................................................................................... 505

Sample (+UWP)

.......................................................................................................................................................... 507

Member Functions ......................................................................................................................................................... 508


......................................................................................................................................... 508
ReleaseImages
operator[] (C++,C#)

......................................................................................................................................... 509

get (Java)

......................................................................................................................................... 510

set (Java)

10

......................................................................................................................................... 510

SizeI32

.......................................................................................................................................................... 511

StreamCalibration

.......................................................................................................................................................... 512

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

StreamDesc

.......................................................................................................................................................... 515

StreamDescSet

.......................................................................................................................................................... 516

Member Functions ......................................................................................................................................................... 517


......................................................................................................................................... 518
operator[] (C++,C#)
get (Java)

......................................................................................................................................... 518

set (Java)
StreamProfile

.......................................................................................................................................................... 520

StreamProfileSet

.......................................................................................................................................................... 521

......................................................................................................................................... 519

Member Functions ......................................................................................................................................................... 522


......................................................................................................................................... 522
operator[] (C++,C#)
get (Java)

......................................................................................................................................... 523

set (Java)
StreamTransform

.......................................................................................................................................................... 524

......................................................................................................................................... 523

Enumerator Reference
................................................................................................................................... 525
Access (Image)

.......................................................................................................................................................... 526

ConnectionType (+JS,+UWP)
.......................................................................................................................................................... 527
CoordinateSystem

.......................................................................................................................................................... 528

DeviceModel (+JS,+UWP)
.......................................................................................................................................................... 529
DeviceOrientation (+JS,+UWP)
.......................................................................................................................................................... 530
ImplGroup (+JS)

.......................................................................................................................................................... 531

ImplSubgroup (+JS) .......................................................................................................................................................... 532


IVCAMAccuracy

.......................................................................................................................................................... 534

MirrorMode

.......................................................................................................................................................... 534

Option (Image)

.......................................................................................................................................................... 535

PixelFormat

.......................................................................................................................................................... 535

......................................................................................................................................................... 539
Type Extension (C#,Java)
......................................................................................................................................... 539
ToString
ProjectionOption

.......................................................................................................................................................... 539

PowerLineFrequency .......................................................................................................................................................... 540


Property (Advanced, +UWP)
.......................................................................................................................................................... 541
Rotation

.......................................................................................................................................................... 549

State

.......................................................................................................................................................... 550

Status (+JS,+UWP)

.......................................................................................................................................................... 551

555
Type Extension (C#,.........................................................................................................................................................
Java)
.........................................................................................................................................
555
IsError
......................................................................................................................................... 556

IsSuccessful

......................................................................................................................................... 556
IsWarning
StreamOption (+UWP).......................................................................................................................................................... 557
StreamType (+JS,+UWP)
.......................................................................................................................................................... 558
Type Extension

......................................................................................................................................................... 559

ToString (C#,Java)

......................................................................................................................................... 559

ToIndex (C#,Java)

......................................................................................................................................... 560

operator++ (C++)

......................................................................................................................................... 561

Samples

................................................................................................................................... 562

Sample: DF_CameraViewer
..........................................................................................................................................................
[C++]
564
Sample: DF_CameraViewer
..........................................................................................................................................................
(Java)
565
Sample: DF_Projection
..........................................................................................................................................................
[C++]
566
Sample: DF_RawStreams
..........................................................................................................................................................
[C++, C#]
572
Sample: DF_StreamViewer
..........................................................................................................................................................
[UWP]
574
Sample: FF_IQSampleTool
..........................................................................................................................................................
[C#]
574

Appendices

580

C++ Data Type Definitions


................................................................................................................................... 581
11

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

11

SDK API Conventions


................................................................................................................................... 582
Recorded File Format
................................................................................................................................... 584

12

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Introducing the SDK


The Intel RealSense SDK 2016 R2 is a library of pattern detection and recognition
algorithm implementations exposed through standardized interfaces. The library aims at
lowering barriers to using these algorithms and shifting the application developers focus
from coding the algorithm details to innovating on the usage of these algorithms for next
generation human computer experience.
Optimization Notice
Intel's compilers may or may not optimize to the same
degree for non-Intel microprocessors for optimizations
that are not unique to Intel microprocessors. These
optimizations include SSE2, SSE3, and SSSE3 instruction
sets and other optimizations. Intel does not guarantee the
availability, functionality, or effectiveness of any
optimization on microprocessors not manufactured by Intel.
Microprocessor- dependent optimizations in this product
are intended for use with Intel microprocessors. Certain
optimizations not specific to Intel microarchitecture are
reserved for Intel microprocessors. Please refer to the
applicable product User and Reference Guides for more
information regarding the specific instruction sets
covered by this notice.

Notice revision #20110804

This document gives a general overview of the features and describes different algorithms
and their API definitions.
Notational Conventions
This SDK document uses the Intel Clear typeface for normal prose.
With the exception of section headings, captions and the table of contents, all code-related
items appear in the Courier New typeface (Status).
Hyperlinks appear underlined in blue, such as Status.
This is a note that provides additional information to aid your understanding of the
procedure or concept.
This is a tip that provides alternate methods or shortcuts.

Basic Concepts
SDK Architecture
The SDK library architecture, as illustrated in Figure 1, consists of several layers of

13

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

components. The essence of the SDK functionalities lays in the input/output (I/O) modules
and the algorithm modules. The I/O modules retrieve input from an input device or send
output to an output device. The algorithm modules include various pattern detection and
recognition algorithms that are critical ingredients of innovative human computer
experience, such as face recognition, gesture recognition, speech recognition, and text to
speech.

Figure 1: SDK Architecture Simplified

The SDK standardizes the interfaces of the I/O and the algorithm modules so that the
applications can access the functionalities without being concerned with the underlying
implementations. Multiple implementations of SDK interfaces may coexist. The SDK provides
the mechanism to search for a specific implementation from available algorithm modules as
well as other critical features such as creating an instance of the algorithm implementation.

2.1

SDK Interfaces
The SDK consists of multiple interfaces. Figure 2 illustrates the interface hierarchy.

14

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Figure 2: SDK C++/C# Interface Hierarchy

The Session interface manages the following modules: I/O modules, algorithm modules, and
any other SDK interface implementations. First you need to create an instance of the Session
interface (through the CreateInstance function) in your application, and then create other
module instances from the Session instance. See Session and Modules for basic concepts.
For predefined usages such as hand tracking and face tracking, you can use the
SenseManager interface. This interface organizes a multi-modal pipeline (that contains an I/O
device and multiple algorithm modules) and controls the execution of the pipeline such as
starting, stopping, pausing and resuming the pipeline. To create the SenseManager instance,
use the CreateInstance function.
Internally, the SenseManager interface uses the CaptureManager interface to select the I/O
device and color/depth/audio streams. Retrieve the CaptureManager instance (from the
SenseManager interface) to constrain the device search and/or to set file recording and
playback during the pipeline initialization. You can subsequently retrieve the Capture
interface for physical camera operations, such as enumerating devices/streams, and querying
stream configurations and device properties. See I/O Device Operations for more details.
During the pipeline execution, when some samples are ready from the I/O device, you can
access the captured samples through the Image interfaces, which abstract the image buffers.
When an algorithm module in the pipeline is ready with some processing results, you need to
access algorithm specific interfaces, such as HandModule for hand tracking and FaceModule
for face tracking. These interfaces provide algorithm specific functions to query/set algorithm
configurations and algorithm data.
The audio path is a bit different where the application manages the audio source through the
AudioSource interface, and specific voice features directly in the module interface, for
example, SpeechRecognition.

15

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.2

Languages and Frameworks Support


To extend the reach of different developers, the SDK provides wrappers for a few popular
languages, frameworks and game engines such as C#, Unity*, Processing*, and Java*. The
application links to the native C++ interfaces or different wrappers that support similar
interfaces for the programming environment, as illustrated in Figure 3.

Figure 3: SDK Language and Framework Wrappers

The interfaces are mostly matched with slightly different naming prefixes.
For C++, C# and Java, this manual uses [M] (where M stands for "managed") in the interface
names to represent interfaces that are available in a managed environment (such as C# and
Java). For example, Capture represents the C++ interface PXCCapture and the C#, and Java
interface PXCMCapture.
The manual uses additional markings after the interface or method names as follows:

16

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Marking

Example

Comment

None

Base

Common for all languages and


frameworks, except JavaScript and
UWP interfaces. JavaScript and UWP
interfaces or methods are listed
separately.

(C++)

PXCBase.Release

C++ specific interface or methods.

(C#)

PXCMBase.Dispose

C# and Unity C# specific interface or


methods.

(C#.NET4)

PXCMImage.ImageData.ToBitmap

C# .NET4 specific interface or


methods. Not available in Unity C#.

(Unity)

PXCMImage.ImageData.ToTexture2 Unity C# specific interface or methods.


D
Not available in C#.

(Java)

PXCMBase.close

Java and Processing specific interface


or methods.

(Processing) PXCMImage.ImageData.ToPImage

Processing specific interface or


methods. Not available in Java.

(JS)

PXCMSession.QueryImpls

JavaScript specific interface or


methods.

(+JS)

PXCMSession.QueryModelDesc

Emphasize that the JavaScript


language is part of this function along
with other language interfaces.

(UWP)

SampleReader.EnableStream[s]

UWP specific interface or methods.

(+UWP)

SenseManager.CreateInstance

Emphasize that the UWP interface is


part of this function along with other
language interfaces.

The SDK provides multiple layers of interfaces to enable Unity applications. The SDK Unity C#
scripts support enables developers who write C# scripts for their game applications. The SDK
Unity Toolkit provides a higher level abstraction for developers that would like to introduce
perceptual computing interactions to their applications with minimum code writing. The SDK
Unity C# scripts (same as the C# interface) are described in this manual while the SDK Unity
Toolkit is detailed in the SDK Unity Toolkit reference manual.

17

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Figure 4: SDK Unity Support

The SDK provides limited support of browser applications, i.e., JavaScript* programs in a
browser page. As illustrated in Figure 5, the SDK function calls are routed through the web
socket protocol to a local web service, which runs the SDK runtimes. Due to web socket
bandwidth and latency limitations, as well as protecting user privacy, the SDK JavaScript limits
to the following features: face tracking, hand tracking, blob tracking, and speech command
and control.

Figure 5: SDK Browser Support

2.3

Session and Modules


The SDK building blocks are modules: I/O modules and algorithm modules. An SDK session is
the context that holds these modules. Every SDK application creates a single or multiple SDK
sessions. Each session maintains its own context for I/O and algorithm models and is not
aware of other sessions.
Within an SDK session, there are multiple I/O and algorithm modules that implement certain
SDK interfaces. In some cases, there might be multiple implementations of the same SDK
interface. You can create an instance of the module from the session, use it, and then destroy
it. The module's life cycle is the duration of its use.
The SDK session must be the first instance to create before any module operations and the
last to destroy after all modules are destroyed.

18

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The Session interface is not explicitly exposed in C# UWP.


Example 1 shows how to create an SDK session and print the SDK version.
Example 1: Create an SDK Session and Print the SDK Version

[C++]
PXCSession *session=PXCSession::CreateInstance();
...
PXCSession::ImplVersion ver=session->QueryVersion();
wprintf_s(L"SDK Version %d.%d\n",ver.major, ver.minor);
...
session->Release();
[C#]
PXCMSession session=PXCMSession.CreateInstance();
...
Console.WriteLn("SDK Version {0}.
{1}",session.version.major,session.version.minor);
...
session.Dispose();
[Java]
PXCMSession session=PXCMSession.CreateInstance();
...
PXCMSession.ImplVersion ver=session.QueryVersion();
System.out.printf("SDK Version %d.%d%n",ver.major,ver.minor);
...
session.close();
[JavaScript]
// In JavaScript, use SenseManager.createInstance instead.
// Then get a session instance from the SenseManager.
intel.realsense.SenseManager.createInstance().then(function(sm) {
document.write(sm.session.version);
});
[C#/UWP]
// As Universal apps must statically include the SDK runtime files.
// The SDK version is fixed at the development time.

2.4

Language-Specific Restrictions
When developing an application with the SDK, you must take into account the following
language-specific restrictions:
[C++]

Do not use the compiler keyword dynamic_cast to cast types. Instead, use the
QueryInstance function or its template.

19

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Do not use the compiler keyword delete to destroy an instance. Instead, use the Release
function.
Do not release any instance returned by the QueryInstance function. See the Remarks
section of the QueryInstance function for details.
Example 2 shows how to cast a session instance to a meta data instance in C++.
Example 2: Cast a PXCSession Instance to PXCMetadata

PXCSession *session=PXCSession::CreateInstance();
PXCMetadata *mdata=session->QueryInstance<PXCMetaData>();
session->Release();

See Also
Configuring C++ Development Environment
Appendix A: C++ Data Type Definitions
[C#]

Each C# instance is a C# managed object that internally points to a C++ unmanaged instance.
Dispose the C# object so that the unmanaged C++ instance can be destroyed, with exception
that internally managed instances (such as those returned by the QueryInstance function)
do not have to be explicitly destroyed.
Releasing internally managed instances is ignored.
Example 3 shows how to cast a session instance to a meta data instance in C#:
Example 3: Cast a PXCMSession Instance to PXCMMetadata

PXCMSession session=PXCMSession.CreateInstance();
...
PXCMMetadata mdata=session.QueryInstance<PXCMMetadata>();
...
session.Dispose();

See Also
Configuring C# Development Environment
Configuring Unity Development Environment
[Java]

Java does not support unsigned data types while the SDK defines depth map data as an array
of unsigned short integers for the effective range. You can retrieve the depth map data as a
signed short integer array but should instead treat the values as unsigned.

20

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

As illustrated in Example 4, each Java instance is a Java managed object that internally points
to a Java unmanaged instance. Release the Java object so that the unmanaged C++ resource
can be destroyed, with exception that internally managed instances (such as those returned
by the QueryInstance function) do not have to be explicitly destroyed.
Releasing internally managed instances is ignored.
Example 4: Create and Manage Instances

// Create an instance and pass a reference to the Java function.


PXCMSession session=PXCMSession.CreateInstance();
...
// Cast interfaces; The returned instance is internally managed by
PXCMSession.
PXCMMetadata mdata=(PXCMMetadata)session.QueryInstance(PXCMMetadata.CUID);
...
// Instances must be destroyed via close()
session.close();

Some SDK Java methods must return more than a single value, such as a status code, an
instance of certain interface, and a time stamp. Java does not natively support this feature.
The SDK uses the following convention to overcome this limitation (See Example 5 for an
example):
If the returned value is an SDK interface instance, the application should create the
instance first using the default constructor, and then pass the instance to the Java function,
which initializes the instance.
If the returned value is a structure class or an array of data, the application must initialize
the structure and then pass a reference to the Java function, which sets the structure field
values in place.
If the returned value is a primitive data type, the application must create an array of the
primitive and then pass the array instance to the Java function. The application can retrieve
the values via the first element of the array upon a successful execution.
Example 5: Return Primitives, Structures, or Instances from Java Methods

...
// For instances, create an instance with the default constructor and then
pass the instance to the Java function.
PXCMSpeechSynthesis vsynth=new PXCMSpeechSynthesis();
session.CreateImpl(vsynth);
...
// For structures or arrays, create a structure instance and pass a
reference to the Java function.
PXCMSpeechSynthesis.ProfileInfo pinfo=new
PXCMSpeechSynthesis.ProfileInfo();
vsynth.QueryProfile(pinfo);
...

21

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

// For primitives, create an array of the primitives and pass the array to
the Java function. The output value is in array[0].
int[] index=new int[1];
PXCMSyncPoint.SynthronizeEx(sps, index); // sps is an array of the
PXCMSyncPoint instances.
...

See Also
Configuring Java Development Environment
Configuring Processing Development Environment
[JavaScript]

The SenseManager and most algorithm interfaces expose two working modes:
o The polling mode where the application explicitly checks data availability periodically
and retrieves the data when available.
o The event callback mode where the data is pushed to the application when available.
In JavaScript, the SDK supports only the event callback mode to follow the asynchronous
nature of the language.
SDK functions return a Promise object if their operations are not instant. You must resolve
the Promise object before making use of the data. Example 6 shows how to create the
SenseManager instance and then resolve the Promise object.
Example 6: Create a SenseManager Instance

var sm;
intel.realsense.SenseManager.createInstance()
.then(function(instance){
sm=instance;
});

Due to browser security restrictions, any SDK functions that require file-based operations
will not be available to JavaScript.
To protect user privacy, the SDK prohibits from delivering any information that may
contain personal identifiable information to the browser pages. This includes raw or
processed image/audio data and any algorithm data that may be sensible.
The SDK supports the following navigational features only:
o Face tracking including location, landmarks, pose, and expressions detection.
o Hand tracking including finger and hand detection.
o Blob Tracking showing blob outlines.
o Voice Command and Control.

22

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

See Also
Face Tracking and Recognition Algorithm
Hand Tracking Algorithm
Blob Tracking Algorithm
Speech Recognition Algorithm
[C#/UWP]

The C# for Microsoft* Universal Application Platform* supports raw color and depth
streaming and the blob tracking algorithm only. Other algorithms are in development.
See Also
Raw Stream Capturing and Processing
Blob Tracking Algorithm

2.5

Streaming through SenseManager


The SenseManager interface is the main interface to any predefined use cases:
1. There is one or more algorithm modules.
2. There is a single camera input device.
It is possible to create multiple instances of the SenseManager interface to work with
different cameras.
3. The camera serves input data to the algorithm modules.
Figure 6 shows an example. The application configures the SenseManager interface to read
raw camera samples, and work on finger tracking and face tracking.

23

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Figure 6: SenseManager Supported Use Cases

Conceptually, the application can treat each channel of camera sample capture and algorithm
processing as running independently and concurrently. Each channel is given a module
identifier to identify the captured image sample(s) and the algorithm output.
o The first image channel configured to capture uses the module identifier
Capture.CUID, the second Capture.CUID+1, and so on.
o The algorithm module identifier uses their interface identifiers, such as
HandModule.CUID or FaceModule.CUID.
The typical programming flow of the SenseManager interface includes the following steps:
Create Instance:
Use the CreateInstance function to create an instance of the SenseManager interface.
As the SenseManager interface is the dominant interface that covers most use cases, the
SDK creates a convenient function CreateInstance that shortcuts the Session creation. You
can use the CreateInstance function to quickly get to the SenseManager interface
functions.
Example 7: Create a SenseManager Instance

[C++]
PXCSenseManager *sm=PXCSenseManager::CreateInstance();
[C#]
PXCMSenseManager sm=PXCMSenseManager.CreateInstance();
[Java]
PXCMSenseManager sm=PXCMSenseManager.CreateInstance();
[JavaScript]
intel.realsense.SenseManager.createInstance().then(function(sm) {
// working with sm: the SenseManager instance
24

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

....
});
[C#/UWP]
using Intel.RealSense;
SenseManager sm=SenseManager.CreateInstance();

Configure the components:


Use the set of EnableXXX functions (or the Activate function from the algorithm modules) to
enable raw sample capture or different algorithm modules.
Example 8: Configure A Color Image Capture

[C++]
sm->EnableStream(PXCCapture::STREAM_TYPE_COLOR,0,0);
[C#]
sm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_COLOR,0,0);
[Java]
sm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_COLOR,0,0);
[JavaScript]
// SDK prohibits from streaming raw images to browser pages.
// Here we illustarte how to enable face tracking
intel.realsense.FaceModule.activate(sm).then(function{fm) {
// working with fm: the face module instance
}
[C#/UWP]
using Intel.RealSense;
SampleReader reader=SampleReader.Activate(sm, StreamType.STREAM_TYPE_COLOR,
0, 0, 0);

Control the execution flow and retrieve results:


Depending on the application threading model, you can choose to use a message loop or
use event callbacks. Either way, the SenseManager delivers the data (the captured image
sample, or the module output) when they are ready.
Example 9 shows the relevant code side by side. On the left, the application uses the
AcquireFrame function to wait for the frame data to be ready, the QuerySample function
(or the sample property) to retrieve the image sample, and then the ReleaseFrame
function to resume processing the next frame. On the right, the application listens to the
image ready event in the OnNewSample function (or the SampleArrived event).
During the execution, the application can pause/resume certain algorithm modules. It
25

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

improves performance and saves power if you are not interested in the results of these
modules.
Example 9: Control Flow and Retrieve Results

[C++]
sm->Init();
for (;;) {
pxcStatus sts=sm>AcquireFrame(true);
if
(sts<PXC_STATUS_NO_ERROR)
break;
PXCCapture::Sample
*sample;
sample=sm>QuerySample();
.... // process image
sm->ReleaseFrame();
}

class MyHandler: public


PXCSenseManager::Handler
{
public:
virtual pxcStatus PXCAPI OnNewSample(
pxcUID, PXCCapture::Sample
*sample)
{
// return NO ERROR to continue, or
// any ERROR to exit the loop
return PXC_STATUS_NO_ERROR;
}
};
void MainRoutine(void) {
...
// Initialize my event handler
MyHandler handler;

sm->Close();

// Stream depth samples


sm->Init(&handler);
sm->StreamFrames(true);
sm->Close();
...
}

[C#]
sm.Init();
for (;;) {
pxcmStatus
sts=sm.AcquireFrame(true);
if (sts.IsError())
break;
PXCMCapture.Sample
sample;
sample=sm.QuerySample()
;
.... // process image
sm.ReleaseFrame();
}

26

Intel RealSense SDK 2016 R2 Reference Manual

pxcmStatus OnNewSample(int mid,


PXCMCapture.Sample sample)
{
// return NO ERROR to continue,
// or any ERROR to exit the loop
return pxcmStatus.PXCM_STATUS_NO_ERROR;
}

...
// Initialize my event handler
PXCMSenseManager::Handler handler=
new PXCMSenseManager.Handler();
handler.onNewSample=OnNewSample;
// Stream depth samples
sm.Init(handler);
sm.StreamFrames(true);

2010-2016 Intel Corporation

sm.Close();

sm.Close();
...

[Java]
sm.Init();
for (;;) {
pxcmStatus
sts=sm.AcquireFrame(true);
if (sts.isError())
break;
PXCMCapture.Sample
sample;
sample=sm.QuerySample(
);
.... // process image
sm.ReleaseFrame();
}
sm.Close();

class MyHandler implements


PXCMSenseManager.Handler
{
public pxcmStatus OnNewSample(int mid,
PXCMCapture.Sample sample)
{
// return NO ERROR to continue, or
// any ERROR to exit the loop
return
pxcmStatus.PXCM_STATUS_NO_ERROR;
}
};
...
// Initialize my event handler
MyHandler handler=new MyHandler();
// Stream depth samples
sm.Init(handler);
sm.StreamFrames(true);
sm.Close();
...

[JavaScript]
// Here we demo how to configure face tracking since streaming raw images
is prohibited.
// The JavaScript application uses event callback only.
// callback to receive data
var onFaceData=function(sender, data) {
....
}
// fm is the FaceModule instance
fm.onFrameProcessed = onFaceData;
sm.init().then(function () {
// Start Streaming
return sm.streamFrames();
});
[C#/UWP]
sm.Init();
for (;;) {

27

Intel RealSense SDK 2016 R2 Reference Manual

void OnSample(Object sender,


SampleArrivedEventArgs args)
{

2010-2016 Intel Corporation

Status
sts=sm.AcquireFrame(true);
if
(sts<Status.STATUS_NO_ERRO
R)
break;
Sample
sample=reader.Sample;
.
.... // process image

}
...
// reader is the SampleReader instance
reader.SampleArrived+=OnSample;
// sm is the SenseManager instance
await sm.InitAsync();
sm.StreamFrames();
sm.Close();
...

sm.ReleaseFrame();
}
sm.Close();

Release the instance


The complete example is as illustrated in Example 10:
Example 10: Configure and Stream a Color Stream

[C++]
PXCSenseManager *sm=PXCSenseManager::CreateInstance();
sm->EnableStream(PXCCapture::STREAM_TYPE_COLOR,0,0);
sm->Init();
while (sm->AcquireFrame(true)>=PXC_STATUS_NO_ERROR) {
PXCCapture::Sample *sample=sm->QuerySample();
.... // process image
sm->ReleaseFrame();
}
sm->Release();
[C#]
PXCMSenseManager sm=PXCMSenseManager.CreateInstance();
sm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_COLOR,0,0,0);
sm.Init();
while (!sm.AcquireFrame(true).IsSuccessful()) {
PXCMCapture.Sample sample=sm.QuerySample();
.... // process image
sm.ReleaseFrame();
}
sm.Dispose();
[Java]

28

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

PXCMSenseManager sm=PXCMSenseManager.CreateInstance();
sm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_COLOR,0,0,0);
sm.Init();
while (sm.AcquireFrame(true).isSuccessful()) {
PXCMCapture.Sample sample=sm.QuerySample();
.... // process image
sm.ReleaseFrame();
}
sm.close();
[JavaScript]
// We demo face tracking since streaming raw images is prohibited.
// name space shortcuts
var rs=intel.realsense;
var rsf=intel.realsense.face;
// the SenseManager instance
var sm;
// the face module instance
var fm;
// Close when page goes away
// See also https://developer.mozilla.org/en-US/docs/Web/Guide/
User_experience/Using_the_Page_Visibility_API about page visibility change.
window.beforeunload=function() {
if (sm!=undefined) {
sm.release().then(function() {
sm=fm=undefined;
}
}
}
// Resume processing when page is active
window.onfocus=function() {
if (fm!=undefined) {
sm.captureManager.device.restorePropertiesUponFocus();
fm.pause(false);
}
}
// Pause processing when page is inactive
window.onblur=function() {
if (fm!=undefined) {
fm.pause(true);
}
}
// My data processing routine
var onFaceData=function(sender, data) {
....
29

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

}
// create the SenseManager instance
var fc;
rs.SenseManager.createInstance().then(function (instance) {
sm=instance;
// Activate Face Tracking
return rsf.FaceModule.activate(sm);
}).then(function (instance) {
fm=instance;
// Set my Face Data Handler: onFaceData(sender, data)
fm.onFrameProcessed = onFaceData;
// Configure Face Tracking
return fm.createActiveConfiguration();
}).then(function (instance) {
fc=instance;
// Enable face detection
fc.detection.isEnabled = true;
return fc.applyChanges();
}).then(function (result) {
fc.release();
// SenseManager Initialization
return sm.init();
}).then(function (result) {
// Start Streaming
return sm.streamFrames();
});
[C#/UWP]
using Intel.RealSense;
// Create a SenseManager instance
SenseManager sm=SenseManager.CreateInstance();
// Enable blob tracking
SampleReader reader=SampleReader.Activate(sm, StreamType.STREAM_TYPE_COLOR,
640, 480, 30);
// Initialize
sm.Init();
// Stream Data
while (sm.AcquireFrame(true)>=Status.STATUS_NO_ERROR) {
// Working on reader.Sample
....

30

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

// Resume next frame processing


sm.ReleaseFrame();
}
// Clean up
sm.Dispose();

2.6

Raw Stream Capturing and Processing


This section addresses the following common tasks of capturing and processing raw image
and audio stream(s):
Capturing Individual Color or Depth Stream
Capturing Unaligned Color and Depth Streams
Capturing Aligned Color and Depth Streams
Recording and Playing Back Streams
Accessing Image and Audio Data
JavaScript developers please skip this section. The SDK does not provide raw stream
access to protect user privacy.

2.6.1

Capturing Individual Color or Depth Stream


This section addresses capturing individual color or depth streams. For information about
capturing more than a single stream, see Capturing Unaligned Color and Depth Streams and/
or Capturing Aligned Color and Depth Streams.
The SenseManager interface implements I/O device configuration and data streaming. You
can use the interface in one of the two ways: by procedural calls or by event callbacks.
Capturing Color Samples Using Procedural Calls
Example 11 shows how to capture color samples by procedural calls. The example does the
following:
[C++]

Select a color stream by using the EnableStream function, and then initialize the pipeline
by using the Init function.
In the loop, use the AcquireFrame function to wait for a color sample to be ready and then
retrieve it through the QuerySample function.
Release the frame for reading next sample using the ReleaseFrame function.
Use the Close function to clean up.

31

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C#]

Select a color stream by using the EnableStream function, and then initialize the pipeline
by using the Init function.
In the loop, use the AcquireFrame function to wait for a color sample to be ready and then
retrieve it through the QuerySample function.
Release the frame for reading next sample using the ReleaseFrame function.
Use the Close function to clean up.
[Java]

Select a color stream by using the EnableStream function, and then initialize the pipeline
by using the Init function.
In the loop, use the AcquireFrame function to wait for a color sample to be ready and then
retrieve it through the QuerySample function.
Release the frame for reading next sample using the ReleaseFrame function.
Use the Close function to clean up.
[C#/UWP]

Activate a color stream by using the Activate function, and then initialize the pipeline by
using the Init function.
In the loop, use the AcquireFrame function to wait for a color sample to be ready and then
retrieve it through the sample property.
Release the frame for reading next sample using the ReleaseFrame function.
Use the Close function to clean up.

You can use the filtering functions (such as FilterByDeviceInfo) of the CaptureManager
interface to customize the stream selection process, for example, to choose a specific
camera. Use the QueryCaptureManager function (or the captureManager property) to
retrieve an instance of the CaptureManager interface.
Example 11: Capture Color Samples using the SenseManager and Procedural Calls

[C++]
// Create a PXCSenseManager instance
PXCSenseManager *sm=PXCSenseManager::CreateInstance();
// Select the color stream
sm->EnableStream(PXCCapture::STREAM_TYPE_COLOR,640,480);
// Initialize and Stream Samples
sm->Init();

32

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

for (;;) {
// This function blocks until a color sample is ready
if (sm->AcquireFrame(true)<PXC_STATUS_NO_ERROR) break;
// retrieve the sample
PXCCapture::Sample *sample=sm->QuerySample();
// work on the image sample->color
...
// go fetching the next sample
sm->ReleaseFrame();
}
// Close down
sm->Release();
[C#]
// Create a PXCMSenseManager instance
PXCMSenseManager sm=PXCMSenseManager.CreateInstance();
// Select the color stream
sm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_COLOR,640,480);
// Initialize and Stream samples
sm.Init();
for (;;) {
// This function blocks until a color sample is ready
if (sm.AcquireFrame(true).IsError()) break;
// retrieve the sample
PXCMCapture.Sample sample=sm.QuerySample();
// work on the image sample.color
...
// go fetching the next sample
sm.ReleaseFrame();
}
// Close down
sm.Dispose();
[Java]
// Create a PXCMSenseManager instance
PXCMSenseManager sm=PXCMSenseManager.CreateInstance();
// Select the color stream
sm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_COLOR,640,480);
// Initialize and Stream samples
sm.Init();
for (;;) {
33

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

// This function blocks until a color sample is ready


if (sm.AcquireFrame(true).isError()) break;
// retrieve the sample
PXCMCapture.Sample sample=sm.QuerySample();
// work on the image sample.color
...
// go fetching the next sample
sm.ReleaseFrame();
}
// Close down
sm.close();
[C#/UWP]
// Create a SenseManager instance
SenseManager sm=SenseManager.CreateInstance();
// Select the color stream
SampleReader
reader=SampleReader.Activate(sm,StreamType.STREAM_TYPE_COLOR,640,480,30);
// Initialize and Stream samples
sm.Init();
for (;;) {
// This function blocks until a color sample is ready
if (sm.AcquireFrame(true)<Status.STATUS_NO_ERROR) break;
// retrieve the sample
Sample sample=reader.Sample;
// work on the image sample.Color
...
// go fetching the next sample
sm.ReleaseFrame();
}
// Close down
sm.Dispose();

Capturing Color Samples Using Event Callbacks


Example 12 shows how to capture 60 fps depth samples using the SenseManager interface
by event callbacks. The main procedure creates the event handler and calls the
StreamFrames function.
Example 12: Capture 60FPS Depth Samples using the SenseManager and Event Callbacks

[C++]
class MyHandler: public PXCSenseManager::Handler {
34

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

public:
virtual pxcStatus PXCAPI OnNewSample(pxcUID, PXCCapture::Sample
*sample) {
// work on sample->color
...
// return NO ERROR to continue, or any ERROR to exit the loop
return PXC_STATUS_NO_ERROR;
}
};
// Create a SenseManager instance
PXCSenseManager *sm=PXCSenseManager::CreateInstance();
// Enable depth stream at 320x240x60fps
sm->EnableStream(PXCCapture::STREAM_TYPE_DEPTH,320,240,60);
// Initialize my event handler
MyHandler handler;
sm->Init(&handler)
// Stream depth samples
sm->StreamFrames(true);
// Clean up
sm->Release();
[C#]
pxcmStatus OnNewSample(int mid, PXCMCapture.Sample sample) {
// work on sample.color
...
// return NO ERROR to continue, or any ERROR to exit the loop
return pxcmStatus.PXCM_STATUS_NO_ERROR;
}
// Create a SenseManager instance
PXCMSenseManager sm=PXCMSenseManager.CreateInstance();
// Enable depth stream at 320x240x60fps
sm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_DEPTH,320,240,60);
// Initialize my event handler
PXCMSenseManager.Handler handler=new PXCMSenseManager.Handler();
handler.onNewSample=OnNewSample;
sm.Init(handler);
// Stream depth samples
sm.StreamFrames(true);
// Clean up
sm.Dispose();
[Java]
35

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

class MyHandler implements PXCMSenseManager.Handler {


public pxcmStatus OnNewSample(int mid, PXCMCapture.Sample sample) {
// work on sample.color
...
// return NO ERROR to continue, or any ERROR to exit the loop
return pxcmStatus.PXCM_STATUS_NO_ERROR;
}
...
};
// Create a SenseManager instance
PXCMSenseManager sm=PXCMSenseManager.CreateInstance();
// Enable depth stream at 320x240x60fps
sm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_DEPTH,320,240,60);
// Initialize my event handler
MyHandler handler=new MyHandler();
sm.Init(handler);
// Stream depth samples
sm.StreamFrames(true);
// Clean up
sm.close();
[C#/UWP]
void OnNewSample(object sender, SampleArrivedEventArgs args) {
// work on args.Sample.Color
...
}
// Create a SenseManager instance
SenseManager sm=SenseManager.CreateInstance();
// Enable depth stream at 320x240x60fps
SampleReader
reader=SampleReader.Activate(sm,StreamType.STREAM_TYPE_DEPTH,320,240,60);
reader.SampleArrived+=OnNewSample;
// Initialize
sm.Init(handler);
// Stream depth samples
sm.StreamFrames();

36

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.6.2

Capturing Unaligned Color and Depth Streams


Example 13 shows how to capture unaligned color and depth samples. The example handles
each sample (of some stream) individually when the sample is ready. Each stream may deliver
samples in different frame rates.
The example does the following:
[C++]

Select the color and depth streams using the EnableStream function, and then initializes
the pipeline using the Init function.
In the loop, use the AcquireFrame function with ifall=false to wait for any sample that
is ready to read.
Retrieve the sample using the QuerySample function. Check the color or depth sample
readiness and process accordingly.
Release the frame for reading next sample using the ReleaseFrame function.
Use the Close function to clean up.
[C#]

Select the color and depth streams using the EnableStream function, and then initializes
the pipeline using the Init function.
In the loop, use the AcquireFrame function with ifall=false to wait for any sample that
is ready to read.
Retrieve the sample using the QuerySample function. Check the color or depth sample
readiness and process accordingly.
Release the frame for reading next sample using the ReleaseFrame function.
Use the Close function to clean up.
[Java]

Select the color and depth streams using the EnableStream function, and then initializes
the pipeline using the Init function.
In the loop, use the AcquireFrame function with ifall=false to wait for any sample that
is ready to read.
Retrieve the sample using the QuerySample function. Check the color or depth sample
readiness and process accordingly.
Release the frame for reading next sample using the ReleaseFrame function.
Use the Close function to clean up.

37

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C#/UWP]

Select the color and depth streams by activating multiple SampleReader instances, and
then initializes the pipeline using the Init function.
In the loop, use the AcquireFrame function with ifall=false to wait for any sample that
is ready to read.
Retrieve the sample using the sample function. Check the color or depth sample readiness
and process accordingly.
Release the frame for reading next sample using the ReleaseFrame function.
Use the Close function to clean up.
Example 13: Capture Unaligned Color and Depth Samples using the SenseManager

[C++]
// Create a SenseManager instance
PXCSenseManager *sm=PXCSenseManager::CreateInstance();
// Select the color and depth streams
sm->EnableStream(PXCCapture::STREAM_TYPE_COLOR,640,480,30);
sm->EnableStream(PXCCapture::STREAM_TYPE_DEPTH,320,240,30);
// Initialize and Stream Samples
sm->Init();
for (;;) {
// This function blocks until any sample is ready
if (sm->AcquireFrame(false)<PXC_STATUS_NO_ERROR) break;
// retrieve the color and depth samples unaligned
PXCCapture::Sample *sample=sm->QuerySample();
if (sample) {
if (sample->color) {
// work on the color sample
...
}
if (sample->depth) {
// work on the depth sample
...
}
}
// go fetching the next samples
sm->ReleaseFrame();
}
// Close down
sm->Release();
[C#]

38

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

// Create a SenseManager instance


PXCMSenseManager sm=PXCMSenseManager.CreateInstance();
// Select the color and depth streams
sm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_COLOR,640,480,30);
sm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_DEPTH,320,240,30);
// Initialize and Stream Samples
sm.Init();
for (;;) {
// This function blocks until any sample is ready
if (sm.AcquireFrame(false).IsError()) break;
// retrieve the samples
PXCMCapture.Sample sample=sm.QuerySample();
if (sample!=null) {
if (sample.color!=null) {
// work on the color sample
...
}
if (sample.depth!=null) {
// work on the depth sample
...
}
}
// go fetching the next samples
sm.ReleaseFrame();
}
// Close down
sm.Dispose();
[Java]
// Create a SenseManager instance
PXCMSenseManager sm=PXCMSenseManager.CreateInstance();
// Select the color and depth streams
sm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_COLOR,640,480,30);
sm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_DEPTH,320,240,30);
// Initialize and Stream Samples
sm.Init();
for (;;) {
// This function blocks until any sample is ready
if (sm.AcquireFrame(false).isError()) break;
// retrieve the samples
PXCMCapture.Sample sample=sm.QuerySample();
if (sample!=null) {
if (sample.color!=null) {
// work on the color sample
...
39

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

}
if (sample.depth!=null) {
// work on the depth sample
...
}
}
// go fetching the next samples
sm.ReleaseFrame();
}
// Close down
sm.close();
[C#/UWP]
// Create a SenseManager instance
SenseManager sm=SenseManager.CreateInstance();
// Select the color and depth streams
SampleReader
colorReader=SampleReader.Activate(sm,StreamType.STREAM_TYPE_COLOR,640,480,3
0);
SampleReader
depthReader=SampleReader.Activate(sm,StreamType.STREAM_TYPE_DEPTH,320,240,3
0);
// Initialize and Stream Samples
sm.Init();
for (;;) {
// This function blocks until any sample is ready
if (sm.AcquireFrame(false)<Status.STATUS_NO_ERROR) break;
// retrieve the samples
Sample sample=sm.sample;
if (sample!=null) {
if (sample.Color!=null) {
// work on the color sample
...
}
if (sample.Depth!=null) {
// work on the depth sample
...
}
}
// go fetching the next samples
sm.ReleaseFrame();
}
// Close down
sm.Dispose();

40

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

It is also possible to capture unaligned color and depth samples using the StreamFrames
function and the SenseManager event callbacks. Example 14 shows how to do that.
Example 14: Capture Unaligned Color and Depth Samples using the SenseManager Events

[C++]
class MyHandler:public PXCSenseManager::Handler {
public:
virtual pxcStatus PXCAPI OnNewSample(pxcUID, PXCCapture::Sample
*sample) {
if (sample->color) {
// work on the color sample
...
}
if (sample->depth) {
// work on the depth sample
...
}
// return NO_ERROR to continue, or any error to exit the loop
return PXC_STATUS_NO_ERROR;
}
};
// Create a SenseManager instance
PXCSenseManager *sm=PXCSenseManager.CreateInstance();
// Select the color and depth streams
sm->EnableStream(PXCCapture::STREAM_TYPE_COLOR,640,480,30);
sm->EnableStream(PXCCapture::STREAM_TYPE_DEPTH,320,240,30);
// Initialize my handler
MyHandler handler;
sm->Init(&hanlder);
// Streaming
sm->StreamFrames(true);
// Clean up
sm->Release();
[C#]
pxcmStatus OnNewSample(Int32 mid, PXCMCapture.Sample sample) {
if (sample.color!=null) {
// work on the color sample
...
}
if (sample.depth!=null) {
// work on the depth sample
...
}
// return NO_ERROR to continue, or any error to exit the loop
return pxcmStatus.PXCM_STATUS_NO_ERROR;

41

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

};
// Create a SenseManager instance
PXCMSenseManager sm=PXCMSenseManager.CreateInstance();
// select the color and depth streams
sm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_COLOR,640,480,30);
sm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_DEPTH,320,240,30);
// Initialize my handler
PXCMSenseManager.Handler handler=new PXCMSenseManager.Handler();
handler.onNewSample=OnNewSample;
sm.Init(handler);
// Streaming
sm.StreamFrames(true);
// Clean up
sm.Dispose();
[Java]
class MyHandler implements PXCMSenseManager.Handler {
public pxcmStatus OnNewImage(int mid, PXCMCapture.Sample sample) {
if (sample.color!=null) {
// work on the color sample
...
}
if (sample.depth!=null) {
// work on the depth sample
...
}
// return NO_ERROR to continue, or any error to exit the loop
return pxcmStatus.PXCM_STATUS_NO_ERROR;
}
};
// Create a SenseManager instance
PXCMSenseManager sm=PXCMSenseManager.CreateInstance();
// select the color and depth streams
sm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_COLOR,640,480,30);
sm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_DEPTH,320,240,30);
// Initialize my handler
MyHandler handler=new MyHandler();
sm.Init(handler);
// Streaming
sm.StreamFrames(true);
// Clean up
sm.close();

42

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C#/UWP]
void OnNewSample(Object sender, SampleArrivedEventArgs args) {
if (args.Sample.Color!=null) {
// work on the color sample
...
}
if (args.Sample.Depth!=null) {
// work on the depth sample
...
}
};
// Create a SenseManager instance
SenseManager sm=SenseManager.CreateInstance();
// select the color and depth streams
SampleReader colorReader=SampleReader.Activate(sm,
StreamType.STREAM_TYPE_COLOR,640,480,30);
colorReader.SampleArrived+=OnNewSample;
SampleReader depthReader=SampleReader.Activate(sm,
StreamType.STREAM_TYPE_DEPTH,320,240,30);
depthReader.SampleArrived+=OnNewSample;
// Initialize
sm.Init();
// Streaming
sm.StreamFrames();

43

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.6.3

Capturing Aligned Color and Depth Streams


Example 15 shows how to capture aligned color and depth samples. The example
synchronizes the arrival time of the frames and processes the data at once.
The example does the following:
[C++]

Select the color and depth streams using the EnableStream function, and then initializes
the pipeline using the Init function.
In the loop, use the AcquireFrame function with ifall=true to wait for both samples to
be ready.
Retrieve the color and depth samples using the QuerySample function.
Release the frame for reading next sample using the ReleaseFrame function.
Use the Close function to clean up.
[C#]

Select the color and depth streams using the EnableStream function, and then initializes
the pipeline using the Init function.
In the loop, use the AcquireFrame function with ifall=true to wait for both samples to
be ready.
Retrieve the color and depth samples using the QuerySample function.
Release the frame for reading next sample using the ReleaseFrame function.
Use the Close function to clean up.
[Java]

Select the color and depth streams using the EnableStream function, and then initializes
the pipeline using the Init function.
In the loop, use the AcquireFrame function with ifall=true to wait for both samples to
be ready.
Retrieve the color and depth samples using the QuerySample function.
Release the frame for reading next sample using the ReleaseFrame function.
Use the Close function to clean up.
[C#/UWP]

Select the color and depth streams by the EnableStream function, and then initializes the
pipeline using the Init function.
44

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

In the loop, use the AcquireFrame function with ifall=true to wait for both samples to
be ready.
Retrieve the color and depth samples using the sample function.
Release the frame for reading next sample using the ReleaseFrame function.
Use the Close function to clean up.
Example 15: Capture Aligned Color and Depth Samples using the SenseManager

[C++]
// Create a SenseManager instance
PXCSenseManager *sm=PXCSenseManager::CreateInstance();
// Select the color and depth streams
sm->EnableStream(PXCCapture::STREAM_TYPE_COLOR,640,480,30);
sm->EnableStream(PXCCapture::STREAM_TYPE_DEPTH,320,240,30);
// Initialize and Stream Samples
sm->Init();
for (;;) {
// This function blocks until both samples are ready
if (sm->AcquireFrame(true)<PXC_STATUS_NO_ERROR) break;
// retrieve the color and depth samples aligned
PXCCapture::Sample *sample=sm->QuerySample();
// work on the samples sample->color and sample->depth
...
// go fetching the next samples
sm->ReleaseFrame();
}
// Close down
sm->Release();
[C#]
// Create a SenseManager instance
PXCMSenseManager sm=PXCMSenseManager.CreateInstance();
// Select the color and depth streams
sm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_COLOR,640,480,30);
sm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_DEPTH,320,240,30);
// Initialize and Stream Samples
sm.Init();
for (;;) {
// This function blocks until both samples are ready
if (sm.AcquireFrame(true).IsError()) break;
45

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

// retrieve the samples


PXCMCapture.Sample sample=sm.QuerySample();
// work on the samples: sample.color & sample.depth
...
// go fetching the next samples
sm.ReleaseFrame();
}
// Close down
sm.Dispose();
[Java]
// Create a SenseManager instance
PXCMSenseManager sm=PXCMSenseManager.CreateInstance();
// Select the color and depth streams
sm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_COLOR,640,480,30);
sm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_DEPTH,320,240,30);
// Initialize and Stream Samples
sm.Init();
for (;;) {
// This function blocks until both samples are ready
if (sm.AcquireFrame(true).isError()) break;
// retrieve the samples
PXCMCapture.Sample sample=sm.QuerySample();
// work on the samples: sample.color & sample.depth
...
// go fetching the next samples
sm.ReleaseFrame();
}
// Close down
sm.close();
[C#/UWP]
// Create a SenseManager instance
SenseManager sm=SenseManager.CreateInstance();
// Select the color and depth streams
SampleReader reader=SampleReader.Activate(sm);
reader.EnableStream(StreamType.STREAM_TYPE_COLOR,640,480,30);
reader.EnableStream(StreamType.STREAM_TYPE_DEPTH,320,240,30);

46

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

// Initialize and Stream Samples


sm.Init();
for (;;) {
// This function blocks until both samples are ready
if (sm.AcquireFrame(true)<Status.STATUS_NO_ERROR) break;
// retrieve the samples
Sample sample=sm.Sample;
// work on the samples: sample.Color & sample.Depth
...
// go fetching the next samples
sm.ReleaseFrame();
}
// Close down
sm.Dispose();

You can capture aligned color and depth samples using the StreamFrames function and the
SenseManager event callbacks. See Example 16.
Example 16: Capture Aligned Color and Depth Samples using the SenseManager Events

[C++]
class MyHandler:public PXCSenseManager::Handler {
public:
virtual pxcStatus PXCAPI OnNewSample(pxcUID, PXCCapture::Sample
*sample) {
// Work on sample->color and sample->depth
...
// return NO_ERROR to continue, or any error to exit the loop
return PXC_STATUS_NO_ERROR;
}
};
// Create a SenseManager instance
PXCSenseManager *sm=PXCSenseManager.CreateInstance();
// Select the color and depth streams
PXCVideoModule::DataDesc ddesc={};
ddesc.deviceInfo.streams=PXCCapture::STREAM_TYPE_COLOR|
PXCCapture::STREAM_TYPE_DEPTH;
sm->EnableStreams(&ddesc);
// Initialize my handler
MyHandler handler;
sm->Init(&hanlder);
// Stream Data
sm->StreamFrames(true);

47

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

// Clean up
sm->Release();
[C#]
pxcmStatus OnNewSample(Int32 mid, PXCMCapture.Sample sample) {
// Work on sample.color and sample.depth
....
// return NO_ERROR to continue, or any error to exit the loop
return pxcmStatus.PXCM_STATUS_NO_ERROR;
};
// Create a SenseManager instance
PXCMSenseManager sm=PXCMSenseManager.CreateInstance();
// Select the color and depth streams
PXCMVideoModule.DataDesc ddesc=new PXCMVideoModule.DataDesc();
ddesc.deviceInfo.streams=PXCMCapture.StreamType.STREAM_TYPE_COLOR|
PXCMCapture.StreamType.STREAM_TYPE_DEPTH;
sm.EnableStreams(ddesc);
// Initialize my handler
PXCMSenseManager.Handler handler=new PXCMSenseManager.Handler();
handler.onNewSample=OnNewSample;
sm.Init(handler);
// Streaming
sm.StreamFrames(true);
// Clean up
sm.Dispose();
[Java]
class MyHandler implements PXCMSenseManager.Handler {
public pxcmStatus OnNewSample(int mid, PXCMCapture.Sample sample) {
// Work on sample.color and sample.depth
...
// return NO_ERROR to continue, or any error to exit the loop
return pxcmStatus.PXCM_STATUS_NO_ERROR;
}
};
// Create a SenseManager instance
PXCMSenseManager sm=PXCMSenseManager.CreateInstance();
// Select the color and depth streams
PXCMVideoModule.DataDesc ddesc=new PXCMVideoModule.DataDesc();
ddesc.deviceInfo.streams=EnumSet.of(PXCMCapture.StreamType.STREAM_TYPE_COLO
R, PXCMCapture.StreamType.STREAM_TYPE_DEPTH);
sm.EnableStreams(ddesc);
// Initialize my handler
MyHandler handler=new MyHandler();
48

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

sm.Init(handler);
// Streaming
sm.StreamFrames(true);
// Clean up
sm.close();
[C#/UWP]
void OnNewSample(Object sender, SampleArrivedEventArgs args) {
// Work on args.Sample.Color and args.Sample.Depth
....
};
// Create a SenseManager instance
SenseManager sm=SenseManager.CreateInstance();
// Select the color and depth streams
SampleReader reader=SampleReader.Activate(sm);
reader.EnableStream(StreamType.STREAM_TYPE_COLOR,640,480,30);
reader.EnableStream(StreamType.STREAM_TYPE_DEPTH,640,480,30);
reader.SampleArrived+=OnNewSample;
// Initialize
sm.Init();
// Streaming
sm.StreamFrames();
2.6.3.1

Enabling Strong Synchronization

With Intel RealSense Depth Camera Manager 1.3, the SDK supports hardware-based color
and depth stream synchronization, which produces color and depth sample pairs with closer
time stamps. This may be important in many applications such as 3D background
segmentation.
Use the STREAM_OPTION_STRONG_STREAM_SYNC option to enable strong synchronization.
The option must set on all streams that require synchronization, or the option is ignored.
Needless to say, the streams must have the same frame rate. For example, if you need to
synchronize color and depth streams, use the Enable Stream[s] function and specify the
option on both the color and depth streams, as illustrated in Example 7.
With camera model F200, there is a penalty of noticeable stopping and restarting camera
streaming if any of the applications (on a system) requests to enable strong synchronization.
Use strong synchronization only when necessary.
Example 17: Capture Aligned Color and Depth Samples with Strong Synchronization

[C++]
// Create a SenseManager instance
PXCSenseManager *sm=PXCSenseManager::CreateInstance();
49

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

// Select the color and depth streams


sm>EnableStream(PXCCapture::STREAM_TYPE_COLOR,0,0,0,PXCCapture::Device::STREA
M_OPTION_STRONG_STREAM_SYNC);
sm>EnableStream(PXCCapture::STREAM_TYPE_DEPTH,0,0,0,PXCCapture::Device::STREA
M_OPTION_STRONG_STREAM_SYNC);
// Initialize and Stream Samples
sm->Init();
for (;;) {
// This function blocks until both samples are ready
if (sm->AcquireFrame(true)<PXC_STATUS_NO_ERROR) break;
// retrieve the color and depth samples aligned
PXCCapture::Sample *sample=sm->QuerySample();
// work on the samples sample->color and sample->depth
...
// go fetching the next samples
sm->ReleaseFrame();
}
// Close down
sm->Release();
[C#]
// Create a SenseManager instance
PXCMSenseManager sm=PXCMSenseManager.CreateInstance();
// Select the color and depth streams
sm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_COLOR,0,0,0,PXCMCapture.
Device.StreamOption.STREAM_OPTION_UNRECIFIED);
sm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_DEPTH,0,0,0,PXCMCapture.
Device.StreamOption.STREAM_OPTION_UNRECIFIED);
// Initialize and Stream Samples
sm.Init();
for (;;) {
// This function blocks until both samples are ready
if (sm.AcquireFrame(true).IsError()) break;
// retrieve the samples
PXCMCapture.Sample sample=sm.QuerySample();
// work on the samples: sample.color & sample.depth
...
// go fetching the next samples
sm.ReleaseFrame();
}
50

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

// Close down
sm.Dispose();
[Java]
// Create a SenseManager instance
PXCMSenseManager sm=PXCMSenseManager.CreateInstance();
// Select the color and depth streams
sm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_COLOR,0,0,0,PXCMCapture.
Device.StreamOption.STREAM_OPTION_UNRECIFIED);
sm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_DEPTH,0,0,0,PXCMCapture.
Device.StreamOption.STREAM_OPTION_UNRECIFIED);
// Initialize and Stream Samples
sm.Init();
for (;;) {
// This function blocks until both samples are ready
if (sm.AcquireFrame(true).isError()) break;
// retrieve the samples
PXCMCapture.Sample sample=sm.QuerySample();
// work on the samples: sample.color & sample.depth
...
// go fetching the next samples
sm.ReleaseFrame();
}
// Close down
sm.close();
[C#/UWP]
// Create a SenseManager instance
SenseManager sm=SenseManager.CreateInstance();
// Select the color and depth streams
SampleReader reader=SampleReader.Activate(sm);
reader.EnableStream(StreamType.STREAM_TYPE_COLOR,640,480,30,StreamOption.ST
REAM_OPTION_STRONG_STREAM_SYNC);
reader.EnableStream(StreamType.STREAM_TYPE_DEPTH,640,480,30,StreamOption.ST
REAM_OPTION_STRONG_STREAM_SYNC);
// Initialize and Stream Samples
sm.Init();
for (;;) {
// This function blocks until both samples are ready
if (sm.AcquireFrame(true)<Status.STATUS_NO_ERROR) break;
// retrieve the samples
Sample sample=sm.Sample;

51

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

// work on the samples: sample.Color & sample.Depth


...
// go fetching the next samples
sm.ReleaseFrame();
}
// Close down
sm.Dispose();

52

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.6.3.2

Capturing Unrectified Streams [R200]

With Intel RealSense Depth Camera Manager 1.4, the SDK supports capturing unrectified
streams for the camera model R200. Rectification is a process that corrects lens distortion
and alignment. The unrectified streams are raw images from the camera sensors.
The SDK identifies the unrectified stream configuration (see the StreamProfile structure)
with the STREAM_OPTION_UNRECTIFIED stream option. This is a mandate option (if not
specified, the stream configuration is rectified.) You can request an unrectified stream by
specifying the STREAM_OPTION_UNRECTIFIED option, as illustrated in Example 7.
Not all R200 algorithm modules support unrectified streams. Use only when necessary.
You can retrieve the unrectified calibration parameters through the
QueryStreamProjectionParametersEx function, by specifying the
STREAM_OPTION_UNRECTIFIED stream option.
Example 18: Capture Unrectified Color Samples

[C++]
// Create a SenseManager instance
PXCSenseManager *sm=PXCSenseManager::CreateInstance();
// Select the color and depth streams
sm>EnableStream(PXCCapture::STREAM_TYPE_COLOR,0,0,0,PXCCapture::Device::STREA
M_OPTION_UNRECTIFIED);
sm->EnableStream(PXCCapture::STREAM_TYPE_DEPTH);
// Initialize and Stream Samples
sm->Init();
for (;;) {
// This function blocks until both samples are ready
if (sm->AcquireFrame(true)<PXC_STATUS_NO_ERROR) break;
// retrieve the color and depth samples aligned
PXCCapture::Sample *sample=sm->QuerySample();
// work on the samples sample->color
...
// go fetching the next samples
sm->ReleaseFrame();
}
// Close down
sm->Release();

53

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C#]
// Create a SenseManager instance
PXCMSenseManager sm=PXCMSenseManager.CreateInstance();
// Select the color and depth streams
sm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_COLOR,0,0,0,PXCMCapture.
Device.StreamOption.STREAM_OPTION_UNRECTIFIED);
sm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_DEPTH);
// Initialize and Stream Samples
sm.Init();
for (;;) {
// This function blocks until both samples are ready
if (sm.AcquireFrame(true).IsError()) break;
// retrieve the samples
PXCMCapture.Sample sample=sm.QuerySample();
// work on the samples: sample.color
...
// go fetching the next samples
sm.ReleaseFrame();
}
// Close down
sm.Dispose();
[Java]
// Create a SenseManager instance
PXCMSenseManager sm=PXCMSenseManager.CreateInstance();
// Select the color and depth streams
sm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_COLOR,0,0,0,PXCMCapture.
Device.StreamOption.STREAM_OPTION_UNRECTIFIED);
sm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_DEPTH);
// Initialize and Stream Samples
sm.Init();
for (;;) {
// This function blocks until both samples are ready
if (sm.AcquireFrame(true).isError()) break;
// retrieve the samples
PXCMCapture.Sample sample=sm.QuerySample();
// work on the samples: sample.color
...
// go fetching the next samples
sm.ReleaseFrame();
}

54

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

// Close down
sm.close();
[C#/UWP]
using Intel.RealSense;
// Create a SenseManager instance
SenseManager sm=SenseManager.CreateInstance();
// Select the color and depth streams
SampleReader reader=SampleReader.Activate(sm);
reader.EnableStream(StreamType.STREAM_TYPE_COLOR,0,0,0,StreamOption.STREAM_
OPTION_UNRECTIFIED);
reader.EnableStream(StreamType.STREAM_TYPE_DEPTH);
// Initialize and Stream Samples
sm.Init();
for (;;) {
// This function blocks until both samples are ready
if (sm.AcquireFrame(true,)<Status.STATUS_NO_ERROR) break;
// retrieve the samples
PXCMCapture.Sample sample=sm.QuerySample();
// work on the samples: sample.color
...
// go fetching the next samples
sm.ReleaseFrame();
}
// Close down
sm.Dispose();
}

55

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.6.4

Recording and Playing Back


You can record any streaming sequences to a file and play it back later.
To enable file recording and playback:
Use the SetFileName function from the CaptureManager instance.
In the recording mode, provide a file name and set the recording mode to true.
In the playback mode, provide a file name and set the recording mode to false.
There is no restriction on what the file name can be, except that in the recording mode, the
file must be writable.
You can retrieve an instance of the CaptureManager instance by using the
QueryCaptureManager function.
Example 19 shows how to record or playback captured color samples.
During recording, the SDK writes huge amount of data to the disk. The file size can grow
rapidly. It is recommended to use fast-speed solid state drive (SSD) to ensure realtime
recording without losing any frames.
During recording, samples are recorded as they are processed by the application to the
disk. For example, if the application captures unaligned color and depth samples, the samples
on the disk are unaligned. If the application aligns the samples, the samples on the disk are
aligned.
Example 19: Record or Playback Color Samples using the SenseManager

[C++]
void RecordORPlayback(pxcCHAR *file, bool record) {
// Create a SenseManager instance
PXCSenseManager *sm=PXCSenseManager::CreateInstance();
// Set file recording or playback
sm->QueryCaptureManager()->SetFileName(file,record);
// Select the color stream
sm->EnableStream(PXCCapture.STREAM_TYPE_COLOR,640,480,0);
// Initialize and Record 300 frames
sm->Init();
for (int i=0;i<300;i++) {
// This function blocks until a color sample is ready
if (sm->AcquireFrame(true)<PXC_STATUS_NO_ERROR) break;

56

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

// Retrieve the sample


PXCCapture::Sample *sample=sm->QuerySample();
// Work on the image sample->color
...
// Go fetching the next sample
sm->ReleaseFrame();
}
// close down
sm->Release();
}
[C#]
void RecordORPlayback(String file, Boolean record) {
// Create a SenseManager instance
PXCMSenseManager sm=PXCMSenseManager.CreateInstance();
// Set file recording or playback
sm.captureManager.SetFileName(file,record);
// Select the color stream
sm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_COLOR,640,480,0);
// Initialize and Record 300 frames
sm.Init();
for (int i=0;i<300;i++) {
// This function blocks until a color sample is ready
if (sm.AcquireFrame(true).IsError()) break;
// Retrieve the sample
PXCMCapture.Sample sample=sm.QuerySample();
// Work on the image sample.color
...
// Go fetching the next sample
sm.ReleaseFrame();
}
// Close down
sm.Dispose();
}
[Java]
void RecordORPlayback(string file, boolean record) {
// Create a SenseManager instance
PXCMSenseManager sm=PXCMSenseManager.CreateInstance();
// Set file recording or playback
sm.QueryCaptureManager().SetFileName(file,record);

57

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

// Select the color stream


sm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_COLOR,640,480,0);
// Initialize and Record 300 frames
sm.Init();
for (int i=0;i<300;i++) {
// This function blocks until a color sample is ready
if (sm.AcquireFrame(true).isError()) break;
// Retrieve the sample
PXCMCapture.Sample sample=sm.QuerySample();
// Work on the image sample.color
...
// Go fetching the next sample
sm.ReleaseFrame();
}
// Close down
sm.close();
}

58

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.6.4.1

Playback Modes

You can configure the SDK file playback behaviors as follows:


Function

Default Description

SetPause

false

SetRealtime true

If true, the file playback returns the same sample of the current
frame repeatedly.
If true, the file playback returns the current frame sample at its
presentation time (according to the sample time stamp.) If false,
the file playback returns the sample immediately.

Choose pause=true and realtime=false if you want to accurately locate any frame data
during playback. Example 20 shows how to accurately retrieve the frame data based on the
frame index.
Example 20: Accurate Frame Positioning

[C++]
// Create a SenseManager instance
PXCSenseManager* sm = PXCSenseManager::CreateInstance();
// Set file playback name
sm->QueryCaptureManager()->SetFileName(filename, false);
// Enable stream and Initialize
sm->EnableStream(PXCCapture::STREAM_TYPE_COLOR, 0, 0);
sm->Init();
// Set realtime=true and pause=false
sm->QueryCaptureManager()->SetRealtime(false);
sm->QueryCaptureManager()->SetPause(true);
// Streaming loop
for (int i = 0; i < nframes; i+=3) {
// Set to work on every 3rd frame of data
sm->QueryCaptureManager()->SetFrameByIndex(i);
sm->FlushFrame();
// Ready for the frame to be ready
pxcStatus sts = sm->AcquireFrame(true);
if (sts < PXC_STATUS_NO_ERROR) break;
// Retrieve the sample and work on it. The image is in sample->color.
PXCCapture::Sample* sample = sm->QuerySample();
....
// Resume processing the next frame
sm->ReleaseFrame();
}

59

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

// Clean up
sm->Release();
[C#]
// Create a SenseManager instance
PXCMSenseManager sm = PXCMSenseManager.CreateInstance();
// Set file playback name
sm.captureManager.SetFileName(filename, false);
// Enable stream and Initialize
sm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_COLOR, 0, 0);
sm.Init();
// Set realtime=true and pause=false
sm.captureManager.SetRealtime(false);
sm.captureManager.SetPause(true);
// Streaming loop
for (int i = 0; i < nframes; i+=3) {
// Set to work on every 3rd frame of data
sm.captureManager.SetFrameByIndex(i);
sm.FlushFrame();
// Ready for the frame to be ready
pxcmStatus sts = sm.AcquireFrame(true);
if (sts < pxcmStatus.PXCM_STATUS_NO_ERROR) break;
// Retrieve the sample and work on it. The image is in sample.color.
PXCMCapture.Sample sample = sm.QuerySample();
....
// Resume processing the next frame
sm.ReleaseFrame();
}
// Clean up
sm.Dispose();
[Java]
// Create a SenseManager instance
PXCMSenseManager sm = PXCMSenseManager.CreateInstance();
// Set file playback name
sm.QueryCaptureManager().SetFileName(filename, false);
// Enable stream and Initialize
sm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_COLOR, 0, 0);
sm.Init();
// Set realtime=true and pause=false
sm.QueryCaptureManager().SetRealtime(false);
sm.QueryCaptureManager().SetPause(true);
60

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

// Streaming loop
for (int i = 0; i < nframes; i+=3) {
// Set to work on every 3rd frame of data
sm.captureManager.SetFrameByIndex(i);
sm.FlushFrame();
// Ready for the frame to be ready
pxcmStatus sts = sm.AcquireFrame(true);
if (sts < pxcmStatus.PXCM_STATUS_NO_ERROR) break;
// Retrieve the sample and work on it. The image is in sample.color.
PXCMCapture.Sample sample = sm.QuerySample();
....
// Resume processing the next frame
sm.ReleaseFrame();
}
// Clean up
sm.close();

61

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.6.4.2

File Compression [Experimental]

Recording raw color and depth samples to a disk imposes huge burden on the system. For
example, with color configuration RGB32x1920x1080x30fps and depth configuration
640x480x30fps, the SDK needs about 272MB/s disk I/O bandwidth to write the samples to
the disk. This requirement makes most spinning disks and certain slow SSD inapplicable for
file recording.
To solve the issue, the SDK provides an experimental feature to compress the samples before
writing to the disk. The feature is based on H.264 encoding (I-frame only, constant QP) on
color samples and lossless LempelZivOberhumer (LZO) encoding on depth samples. The
compression rate is roughly 10:1 for color samples and 2:1 for depth samples. In the
previous example, the disk I/O bandwidth is now reduced to be about 42MB/s.
The system requirement is as follows:
Intel Iris Graphics with the latest Intel Iris Graphics Driver
You can control the recording features with the following registry settings:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\SOFTWARE\Intel\RSSDK\FileRecording]
"DisableH264Compression"=dword:0
"H264_QPI"=dword:8
"DisableLZOCompression"=dword:0

By default, the H.264 compression is enabled on the color stream, and the LZO
compression is enabled on all other streams.
The H.264 QPI (I-frame quantization parameter) value ranges from 0 (least compression)
to 51 (most compression).
A recorded file with the H.264 compression can only be played back on systems with Intel
Iris Graphics.
See Also
Appendix C: Recorded File Format

62

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.6.4.3

Known Limitations

The SDK file recording and playback feature has the following limitations:
File recording may impact application timing, as organizing data and writing to the disk are
non-trivial workloads. Enable file recording only when necessary.
The timing routine (that calculates the sample presentation time in the realtime playback
mode) is timing sensitive. Thus the file playback routine may skip frames if the system is
under load. To ensure frame-accurate playback, turn off the realtime mode.
If repeatable playback (receiving the exact same frame sequence in multiple application
runs) is expected, for example, in a validation scenario, you must turn off the realtime
mode, and enable no more than a single modality.

63

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.6.5

Accessing Image Data


For shared access or interoperability with other libraries, the SDK uses the Image interface to
abstract the image storage.
To access the image buffers, use the image AcquireAccess function to lock access to the
image storage and retrieve the storage details in the ImageData structure. The data planes
are pointers by data.planes[0-3] and the pitches are stored in data.pitches[0-3]. When
the access is completed, use the ReleaseAccess function to release the lock. Example 21
shows how to read image buffers.
The SDK supports different pixel formats. See the PixelFormat enumerator for details
about the pixel formats and their memory layouts.
The SDK provides pixel format conversion. The application may request a different pixel
format (from the internal pixel format) in the image AcquireAccess function.
For C#, the data planes planes[0-3] in the ImageData structure are pointers in the
unmanaged memory. See Member Functions for a set of helper functions to access the image
data.
Example 21: Read Image Buffers

[C++]
// image is a PXCImage instance
PXCImage::ImageData data;
image->AcquireAccess(PXCImage::ACCESS_READ,&data);
... // image planes are in data.planes[0-3] with pitch data.pitches[0-3]
image->ReleaseAccess(&data);
[C#]
// image is a PXCMImage instance
PXCMImage.ImageData data;
image.AcquireAccess(PXCMImage.Access.ACCESS_READ,out data);
... // image planes are in data.buffer.planes[0-3] with pitch
data.buffer.pitches[0-3]
image.ReleaseAccess(data);
[Java]
// image is a PXCMImage instance
PXCMImage.ImageData data;
image.AcquireAccess(PXCMImage.Access.ACCESS_READ,data);
... // image planes are in data.buffer.planes[0-3] with pitch
data.buffer.pitches[0-3]
image.ReleaseAccess(data);

Create an Image Instance


To create a Image instance from an image buffer, use the CreateImage function from the
Session interface, as illustrated in Example 22 (C++) and Example 23 (C++). In Example 22,
the application creates a PXCImage instance that internally points to the imported image
buffer. The application must maintain the life cycle of the imported image buffer to be longer
64

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

than that of the PXCImage instance. In Example 23, the application makes a copy of the
imported image.
Example 22: Create an Image Instance Without Data Copy

[C++]
// Image info
PXCImage::ImageInfo info={};
info.format=PXCImage::PIXEL_FORMAT_RGB32;
info.width=image_width;
info.height=image_height;
// Image data
PXCImage::ImageData data={};
data.format=PXCImage::PIXEL_FORMAT_RGB32;
data.planes[0]=image_buffer;
data.pitches[0]=ALIGN64(info.width*4);
// Create the image instance
PXCImage *image=session->CreateImage(&info,0,&data);
...
image->Release();
Example 23: Create an Image Instance With Data Copy

[C++]
// Image info
PXCImage::ImageInfo info={};
info.format=PXCImage::PIXEL_FORMAT_RGB32;
info.width=image_width;
info.height=image_height;
// Create the image instance
PXCImage image=session->CreateImage(&info);
// Write data
PXCImage::ImageData data;
image->AcquireAccess(PXCImage::ACCESS_WRITE,&data);
... // copy the imported image to data.planes[0]
image->ReleaseAccess(&data);

For C# and Java, there is always a copy of the data as the imported image is in the managed
memory while the image storage is in the unmanaged memory. Example 24 shows how to
create a PXCMImage instance from a bitmap.
Example 24: Create an Image Instance from Bitmap

[C#]
// Read bitmap into the memory
Bitmap bitmap = (Bitmap)Image.FromFile(file);
// Image info
PXCMImage.ImageInfo iinfo = new PXCMImage.ImageInfo();
65

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

iinfo.width = bitmap.Width;
iinfo.height = bitmap.Height;
iinfo.format = PXCMImage.PixelFormat.PIXEL_FORMAT_RGB32;
/* Create the image */
PXCMImage image=session.CreateImage(iinfo);
/* Copy the data */
PXCMImage.ImageData idata;
image.AcquireAccess(PXCMImage.Access.ACCESS_WRITE, out idata);
BitmapData bdata = new BitmapData();
bdata.Scan0 = idata.planes[0];
bdata.Stride = idata.pitches[0];
bdata.PixelFormat = PixelFormat.Format32bppRgb;
bdata.Width = bitmap.Width;
bdata.Height = bitmap.Height;
BitmapData bdata2 = bitmap.LockBits(new Rectangle(0, 0, bitmap.Width,
bitmap.Height),
ImageLockMode.ReadOnly | ImageLockMode.UserInputBuffer,
PixelFormat.Format32bppRgb, bdata);
image.ReleaseAccess(idata);
bitmap.UnlockBits(bdata2);
... // do something with the image
image.Dispose();

66

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.7

I/O Device Operations


The SDK uses the following concepts to manage the camera devices, device properties and
streams on the system:
Each SDK session may contain multiple camera modules, each carries a different camera
implementation. Each camera module may contain multiple devices. See Enumerate
Devices for how to enumerate devices.
Each device has a set of device properties. See Get/Set Device Properties for how to get/set
device properties.
Each device may contain multiple streams (audio or video streams). See Enumerate Streams
for how to enumerate streams.
Each stream may contain multiple configurations. See Enumerate Stream Configurations
for how to enumerate stream configurations.
See Working with Peripheral Devices for special handling of peripheral devices.

2.7.1

Enumerating Devices
[C++]

An SDK session may contain multiple capture modules and each module can manage
multiple devices. Use the QueryImpl function to enumerate each capture module, the
CreateImpl function to create an instance of the module, and then the QueryDevice
function to retrieve device specific information.
Example 25 shows how to enumerate video capture devices.
See Handler for an example of how to subscribe to any camera change events.
Example 25: Enumerate Video Devices

// session is a PXCSession instance


PXCSession::ImplDesc desc1={};
desc1.group=PXCSession::IMPL_GROUP_SENSOR;
desc1.subgroup=PXCSession::IMPL_SUBGROUP_VIDEO_CAPTURE;
for (int m=0;;m++) {
PXCSession::ImplDesc desc2;
if (session->QueryImpl(&desc1,m,&desc2)<PXC_STATUS_NO_ERROR) break;
wprintf_s(L"Module[%d]: %s\n", m, desc2.friendlyName);
PXCCapture *capture=0;
pxcStatus sts=session->CreateImpl<PXCCapture>(&desc2,&capture);
if (sts<PXC_STATUS_NO_ERROR) continue;
// print out all device information
for (int d=0;;d++) {
PXCCapture::DeviceInfo dinfo;

67

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

sts=capture->QueryDeviceInfo(d,&dinfo);
if (sts<PXC_STATUS_NO_ERROR) break;
wprintf_s(L"

Device[%d]: %s\n",d,dinfo.name);

}
capture->Release();
}
[C#]

An SDK session may contain multiple capture modules and each module can manage
multiple devices. Use the QueryImpl function to enumerate each capture module, the
CreateImpl function to create an instance of the module, and then the QueryDevice
function to retrieve device specific information.
Example 26 shows how to enumerate video capture devices.
See Handler for an example of how to subscribe to any camera change events.
Example 26: Enumerate Video Devices

// session is a PXCMSession instance


PXCMSession.ImplDesc desc1=new PXCMSession.ImplDesc();
desc1.group=PXCMSession.ImplGroup.IMPL_GROUP_SENSOR;
desc1.subgroup=PXCMSession.ImplSubgroup.IMPL_SUBGROUP_VIDEO_CAPTURE;
for (int m=0;;m++) {
PXCMSession.ImplDesc desc2;
if (session.QueryImpl(desc1,m,out desc2).IsError()) break;
Console.WriteLn("Module[{0}]: {1}", m, desc2.friendlyName);
PXCMCapture capture;
pxcmStatus sts=session.CreateImpl<PXCMCapture>(desc2, out capture);
if (sts.IsError()) continue;
// print out all device information
for (int d=0;;d++) {
PXCMCapture.DeviceInfo dinfo;
sts=capture.QueryDeviceInfo(d,out dinfo);
if (sts.IsError()) break;
Console.WriteLn("

Device[{0}]: {1}",d,dinfo.name);

}
capture.Dispose();
}
[Java]

An SDK session may contain multiple capture modules and each module can manage
multiple devices. Use the QueryImpl function to enumerate each capture module, the

68

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

CreateImpl function to create an instance of the module, and then the QueryDevice

function to retrieve device specific information.


Example 27 shows how to enumerate video capture devices.
See Handler for an example of how to subscribe to any camera change events.
Example 27: Enumerate Video Devices

// session is a PXCMSession instance


PXCMSession.ImplDesc desc1=new PXCMSession.ImplDesc();
desc1.group=EnumSet.of(PXCMSession.ImplGroup.IMPL_GROUP_SENSOR);
desc1.subgroup=EnumSet.of(PXCMSession.ImplSubgroup.IMPL_SUBGROUP_VIDEO_CAPT
URE);
for (int m=0;;m++) {
PXCMSession.ImplDesc desc2=new PXCMSession.ImplDesc();
if (session.QueryImpl(desc1,m,desc2).isError()) break;
System.printf("Module[%d]: %d%n", m, desc2.friendlyName);
PXCMCapture capture=new PXCMCapture();
pxcmStatus sts=session.CreateImpl(desc2, capture);
if (sts.isError()) continue;
// print out all device information
for (int d=0;;d++) {
PXCMCapture.DeviceInfo dinfo=new PXCMCapture.DeviceInfo();
sts=capture.QueryDeviceInfo(d, dinfo);
if (sts.isError()) break;
System.out.printf("

Device[%d]: %d%n", d, dinfo.name);

}
capture.close();
}
[C#/UWP]

Use the FindAllAsync function to enumerate available camera devices, as illustrated in


Example 28.
The FindAllAsync function is an asynchronous function thus you must wait until its
completion.
Example 28: Enumerate Video Devices

using Intel.RealSense;
// sm is a SenseManager instance
Device[] devices=await Device.FindAllAsync(sm);

69

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.7.2

Getting/Setting Device Properties


[C++]

You can get and set device properties through the Device interface member functions.
Example 29 shows how to get/set device properties.
It is not recommended to change any device settings. Doing so could impact other
applications that share the same physical device.
Example 29: Get/Set Device Properties

// device is a PXCCapture::Device instance


// Retrieve camera color and depth field of view
PXCPointF32 color_fov=device->QueryColorFieldOfView();
PXCPointF32 depth_fov=device->QueryDepthFieldOfView()
// Turn off auto exposure and set manual exposure
device->SetColorAutoExposure(false);
device->SetColorExposure(0);
[C#]

You can get and set device properties through the Device interface member functions.
Example 30 shows how to get/set device properties.
It is not recommended to change any device settings. Doing so could impact other
applications that share the same physical device.
Example 30: Get/Set Device Properties

// device is a PXCMCapture.Device instance


// Retrieve camera color & depth field of view
PXCMPointF32 color_fov=device.QueryColorFieldOfView();
PXCMPointF32 depth_fov=device.QueryDepthFieldOfView();
// Turn off auto exposure and set manual exposure
device.SetColorAutoExposure(false);
device.SetColorExposure(0);
[Java]

You can get and set device properties through the Device interface member functions.
Example 31 shows how to get/set device properties.
It is not recommended to change any device settings. Doing so could impact other
applications that share the same physical device.
Example 31: Get/Set Device Properties

// device is a PXCMCapture.Device instance

70

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

// Retrieve camera color & depth field of view


PXCMPointF32 color_fov=device.QueryColorFieldOfView();
PXCMPointF32 depth_fov=device.QueryDepthFieldOfView();
// Turn off auto exposure and set manual exposure
device.SetColorAutoExposure(false);
device.SetColorExposure(0);
[C#/UWP]

You can use Windows.Devices.Perception functions to get/set device properties. Example


32 show how to get/set device properties.
See the Property enumerator for the definition of all supported device properties.
It is not recommended to change any device settings. Doing so could impact other
applications that share the same physical device.
All device property values must convert to float before setting them.
Example 32: Get/Set Device Properties

using Intel.RealSense;
using Windows.Devices.Perception;
// device is a Device instance
// Get the color source
auto color=device.Sources[StreamType.STREAM_TYPE_COLOR];
// Get the device property
float value=(float)color.Properties["Intel.RealSense.ColorExposure"];
// Set the device property
using (auto pcs=color.AcquireControlSesseion())
{
await pcs.TrySetPropertyAsync("Intel.RealSense.ColorExposure", 0.2f);
}

See Also
Coexisting with Other Applications

2.7.3

Enumerating Streams
Each SDK device may have multiple streams. The stream information is part of the
DeviceInfo structure. Use the QueryDeviceInfo function (or the deviceInfo property) to
retrieve the stream information. Example 33 shows how to enumerate the stream
information.
Example 33: Enumerate Device Streams

[C++]

71

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

// device is a PXCCapture::Device instance


PXCCapture::DeviceInfo dinfo={};
device->QueryDeviceInfo(&dinfo);
if (dinfo.streams&PXCCapture::STREAM_TYPE_COLOR) {
wprintf_s(L"COLOR STREAM\n");
}
if (dinfo.streams&PXCCapture::STREAM_TYPE_DEPTH) {
wprintf_s(L"DEPTH STREAM\n");
}
[C#]
// device is a PXCMCapture.Device instance
PXCMCapture.DeviceInfo dinfo;
device.QueryDeviceInfo(out dinfo);
if ((dinfo.streams&PXCMCapture.StreamType.STREAM_TYPE_COLOR)!=0) {
Console.WriteLn("COLOR STREAM");
}
if ((dinfo.streams&PXCMCapture.StreamType.STREAM_TYPE_DEPTH)!=0) {
Console.WriteLn("DEPTH STREAM");
}
[Java]
// device is a PXCMCapture.Device instance
PXCMCapture.DeviceInfo dinfo=new PXCMCapture.DeviceInfo();
device.QueryDeviceInfo(dinfo);
if ((dinfo.streams.contains(PXCMCapture.StreamType.STREAM_TYPE_COLOR)) {
System.out.printf("COLOR STREAM%n");
}
if ((dinfo.streams.contains(PXCMCapture.StreamType.STREAM_TYPE_DEPTH)) {
System.out.printf("DEPTH STREAM%n");
}
[C#/UWP]
using Intel.RealSense;
// device is a Device instance
DeviceInfo dinfo=device.deviceInfo;
if ((dinfo.streams.contains(StreamType.STREAM_TYPE_COLOR)) {
System.out.printf("COLOR STREAM%n");
}
if ((dinfo.streams.contains(StreamType.STREAM_TYPE_DEPTH)) {
System.out.printf("DEPTH STREAM%n");
}

72

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.7.4

Enumerating Stream Configurations


Each stream may have multiple configurations (color format, resolution and frame rate). You
can enumerate the configurations on individual streams(, or multiple streams).
Certain stream combination may not be supported due to device constraints. For example,
the configuration of an inferred stream may be tied to the corresponding depth stream. Use
the IsStreamProfileSetValid function to validate multiple stream configurations.
[C++]

Use the QueryStreamProfileSet function to enumerate the stream configurations. When


enumerating multiple stream configurations, the QueryStreamProfileSet function returns
the unique combinations of all valid stream configurations. Example 34 shows how to
enumerate the stream configurations.
Example 34: Enumerate the Stream Configurations

// device is a PXCCapture::Device instance


PXCCapture::StreamType streams=PXCCapture::STREAM_TYPE_COLOR|
PXCCapture::STREAM_TYPE_DEPTH;
for (int p=0;;p++) {
PXCCapture::Device::StreamProfileSet profiles={};
pxcStatus sts=device->QueryStreamProfileSet(streams, p, &profiles);
if (sts<PXC_STATUS_NO_ERROR) break;
wprintf_s(L"color[%d]: %dx%d\n", p, profiles.color.imageInfo.width,
profiles.color.imageInfo.height);
wprintf_s(L"depth[%d]: %dx%d\n", p, profiles.depth.imageInfo.width,
profiles.depth.imageInfo.height);
}
[C#]

Use the QueryStreamProfileSet function to enumerate the stream configurations. When


enumerating multiple stream configurations, the QueryStreamProfileSet function returns
the unique combinations of all valid stream configurations. Example 35 shows how to
enumerate the stream configurations.
Example 35: Enumerate the Stream Configurations

// device is a PXCMCapture.Device instance


PXCMCapture.StreamType streams=PXCMCapture.StreamType.STREAM_TYPE_COLOR|
PXCCapture.StreamType.STREAM_TYPE_DEPTH;
for (int p=0;;p++) {
PXCMCapture.Device.StreamProfileSet profiles;
pxcmStatus sts=device.QueryStreamProfileSet(streams, p, out profiles);
if (sts.IsError()) break;
Console.WriteLn("color[{0}]: {1}x{2}", p,
profiles.color.imageInfo.width, profiles.color.imageInfo.height);

73

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Console.WriteLn("depth[{0}]: {1}x{2}", p,
profiles.depth.imageInfo.width, profiles.depth.imageInfo.height);
}
[Java]

Use the QueryStreamProfileSet function to enumerate the stream configurations. When


enumerating multiple stream configurations, the QueryStreamProfileSet function returns
the unique combinations of all valid stream configurations. Example 36 shows how to
enumerate the stream configurations.
Example 36: Enumerate the Stream Configurations

// device is a PXCMCapture.Device instance


EnumSet<PXCMCapture.StreamType>
streams=EnumSet.of(PXCMCapture.StreamType.STREAM_TYPE_COLOR,PXCCapture.Stre
amType.STREAM_TYPE_DEPTH);
for (int p=0;;p++) {
PXCMCapture.Device.StreamProfileSet profiles=new
PXCMCapture.Device.StreamProfileSet();
pxcmStatus sts=device.QueryStreamProfileSet(streams, p, profiles);
if (sts.isError()) break;
System.out.printf("color[%d]: %dx%d%n", p,
profiles.color.imageInfo.width, profiles.color.imageInfo.height);
System.out.printf("depth[%d]: %dx%d%n", p,
profiles.depth.imageInfo.width, profiles.depth.imageInfo.height);
}
[C#/UWP]

Use the SupportedVideoProfiles property of the respective sources,


PerceptionColorFrameSource, PerceptionDepthFrameSource, or
PerceptionInfraredFrameSource to retrieve the supported configurations. Example 37
shows how to enumerate the stream configurations.
Example 37: Enumerate the Stream Configurations

using Intel.RealSense;
// device is a Device instance
// Get the color source
auto color=device.Sources[StreamType.STREAM_TYPE_COLOR];
auto profiles=color.SupportedVideoProfiles;

2.7.5

Working with Peripheral Devices


This section addresses special handling required to work with the SR300 peripheral camera
devices.

74

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Enumerating Devices
There may be multiple peripheral devices connected to the system. See Enumerating Devices
for how to enumerate multiple camera devices.
If the system is equipped with both integrated and peripheral cameras, the order of
enumeration is: peripheral camera first, and the integrated camera last.
Identifying Peripheral Devices
The DeviceInfo structure describes the details of the camera device. Use the
QueryDeviceInfo function (or the deviceInfo property) to retrieve the device information,
then the connectionType field to distinguish between an integrated camera and a peripheral
camera.
Handling Device Disconnection
When a peripheral camera unplugs, the SenseManager pipeline terminates with the
PXC_STATUS_DEVICE_LOST status code as follows:
If you use the SenseManager polling mechanism, the AcquireFrame function returns the
PXC_STATUS_DEVICE_LOST status code, which breaks the streaming loop.
If you use the SenseManager event mechanism, the stream loop terminates after an
OnStatus callback with the PXC_STATUS_DEVICE_LOST status code as the input argument.
Listening for Device Changes
You can monitor any camera device changes, for example, if the camera has been
reconnected, by subscribing to the OnDeviceListChanged event.
The OnDeviceListChanged event is device type specific. For example, the camera SR300
capture module reports changes only from the camera SR300 devices. Thus if you need to
monitor both camera SR300 and R200 changes, subscribe to the events of both the camera
Capture interfaces.
See Enumerating Devices for how to enumerate and create camera instances.
Checking Camera Connection State
During application installation or in other cases where the SDK is not accessible, you can
check the camera connection state as follows:
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Intel\RSDCM\SR300]
"CameraConnected"=dword:00000001

The registry key is set to value 1 if and only if there is at least 1 peripheral camera plugged
into the system.

75

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.8

Coordinate Systems
The SDK uses the following two types of coordinate system definitions: Image and Camera.
See Configuring Coordinate System for details of configuring the camera coordinate system.
The Image Coordinate System
The coordinates refer to the pixel location (x,y) in the color
or depth pictures, where x is in the range of 0 to w-1, (w is the
image width), and y is in the range of 0 to h-1, (h is the image
height). See Figure 7. From the camera point of view, the
origin (0,0) is at the top left; the X axis points to the right;
and the Y axis points down.

Figure 7: Image Coordinate System

The Camera Coordinate System


The coordinates are 3D coordinates (x,y,z). The origin (0,0,0) is at the center of the depth
camera. Values are in meters, if not explicitly specified.
[C++][C#][Java][JavaScript]

76

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

For front facing cameras (the cameras face towards


the user), the default camera coordinate system (see
Figure 8) is defined as the X axis pointing to the right
(camera view), the Y axis up and the Z axis towards
the user. This is also referred to as the left handed
system. The camera coordinate system definition
does not change with the camera mirror mode.

Figure 8: Front Facing Default Coordinate System

For rear facing cameras (the cameras face towards


the scene), the default camera coordinate system is
the right handed system as the X axis pointing to
the right of the user, the Y axis up and the Z axis
towards the user. The reference does not change
with the camera mirror mode. The camera
coordinates values are in meters, if not explicitly
specified.
The scene in Figure 9 has negative Z values.

Figure 9: Rear Facing Default Coordinate System

An alternative for rear facing cameras is the OpenCV*


coordinate system which facilitates working with OpenCV
algorithms. Illustrated in Figure 10, the OpenCV camera
coordinate system is defined as the X axis pointing to the
cameras right, the Y axis down and the Z axis towards the
scene.

77

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016
Intel Corporation
Figure 10: Rear Facing OpenCV
Coordinate
System

[C#/UWP]

For front facing cameras (the cameras face towards


the user), the default camera coordinate system
(see Figure 11) is defined as the X axis pointing to
the left (camera view), the Y axis up and the Z axis
towards the user. This is also referred to as the right
handed system.

Figure 11: Front Facing Default Coordinate System

For rear facing cameras (the cameras face towards the


scene), the default camera coordinate system is the right
handed system as the X axis pointing to the right of the user,
the Y axis up and the Z axis towards the user. The reference
does not change with the camera mirror mode. The camera
coordinates values are in meters, if not explicitly specified.
The scene in Figure 12 has negative Z values.

Figure 12: Rear Facing Default Coordinate System

2.8.1

Configuring Coordinate System


[C++][C#][Java]

Upon SDK session initialization, the SDK sets the coordinates (front and rear) to default
values. Use the QueryCoordinateSystem function to retrieve the current coordinate system
setting. Note that the function returns a bit mask of coordinate system values of both front
and rear cameras. Thus if you need to use check the coordinate bit mask for a specific camera
orientation, as illustrated in Example 38.
Example 38: Checking Coordinate System Setting

[C++]
// Create a SenseManager instance.
PXCSenseManager *sm=PXCSenseManager::CreateInstance();
// get the coordinate system setting
PXCSession *session=sm->QuerySession();
78

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

PXCSession::CoordinateSystem cs=session->QueryCoordinateSystem();
// check the coordinate system for rear facing camera
if (cs & PXCSession::COORDINATE_SYSTEM_OPENCV) {
....
}
// Clean up
sm->Release();
[C#]
// Create a SenseManager instance.
PXCMSenseManager sm=PXCMSenseManager.CreateInstance();
// get the coordinate system setting
PXCMSession session=sm.session;
PXCMSession.CoordinateSystem cs=session.QueryCoordinateSystem();
// check the coordinate system for rear facing camera
if (cs.HasFlag(PXCMSession.CoordinateSystem.COORDINATE_SYSTEM_OPENCV)) {
....
}
// Clean up
sm.Dispose();
[Java]
// Create a SenseManager instance.
PXCMSenseManager sm=PXCMSenseManager.CreateInstance();
// get the coordinate system setting
PXCMSession session=sm.QuerySession();
EnumSet<PXCMSession.CoordinateSystem> cs=session.QueryCoordinateSystem();
// check the coordinate system for rear facing camera
if (cs.contains(PXCMSession.CoordinateSystem.COORDINATE_SYSTEM_OPENCV)) {
....
}
// Clean up
sm.close();

Use the SetCoordinateSystem function to change the coordinate system setting. Each SDK
module reads the coordinate system setting (from the session) during the module
initialization. You must set the coordinate system before any SDK module (algorithm) is
initialized, to ensure all modules work with the same coordinate system. The SenseManager
initializes algorithm modules in the EnableXXX functions and the I/O module in the Init
function. Thus you need to set the coordinate system before those functions. See Example
39 for an example of setting the coordinate system.
Example 39: Set to the OpenCV Coordinate System

[C++]

79

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

// Create a SenseManager instance.


PXCSenseManager *sm=PXCSenseManager::CreateInstance();
// Set the coordinate system
PXCSession *session=sm->QuerySession();
session->SetCoordinateSystem(PXCSession::COORDINATE_SYSTEM_OPENCV);
...
// Clean up
sm->Release();
[C#]
// Create a SenseManager instance.
PXCMSenseManager sm=PXCMSenseManager.CreateInstance();
// Set the coordinate system
PXCMSession session=sm.session;
session.SetCoordinateSystem(PXCMSession.CoordinateSystem.COORDINATE_SYSTEM_
OPENCV);
...
// Clean up
sm.Dispose();
[Java]
// Create a SenseManager instance.
PXCMSenseManager sm=PXCMSenseManager.CreateInstance();
// Set the coordinate system
PXCMSession session=sm.QuerySession();
session.SetCoordinateSystem(PXCMSession.CoordinateSystem.COORDINATE_SYSTEM_
OPENCV);
...
// Clean up
sm.close();

2.8.2

Coordinates Mapping
Due to the differences in a camera's physical location, lens size, and field of view, color and
depth coordinates do not map 1:1 to each other.
[C++][C#][Java]

Use the Projection function to map or project coordinates. Use the CreateProjection
function to retrieve an instance of the Projection interface.

80

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The Projection function provides the following mappings or projections:


Map between color and depth image coordinates:
Project among color and depth image coordinates, and world coordinates.
Create spatially and size aligned color and depth images.
Example 40 shows how to map depth to color coordinates using the UV map.
Example 40: Map Depth to Color Coordinates using UV Mapping

[C++]
// Create the PXCProjection instance.
PXCProjection *projection=device->CreateProjection();
// color and depth image size.
PXCImage::ImageInfo dinfo=depth->QueryInfo();
PXCImage::ImageInfo cinfo=color->QueryInfo();
// Calculate the UV map.
PXCPointF32 *uvmap=new PXCPointF32[dinfo.width*dinfo.height];
projection->QueryUVMap(depth, uvmap);
// Translate depth points uv[] to color ij[]
for (int i=0;i<npoints;i++) {
ij[i].x=uvmap[(int)uv[i].y*dinfo.width+(int)uv[i].x].x*cinfo.width;
ij[i].y=uvmap[(int)uv[i].y*dinfo.width+(int)uv[i].x].y*cinfo.height;
}
// Clean up
delete[] uvmap;
projection->Release();
[C#]
// Create the PXCMProjection instance.
PXCMProjection projection=device.CreateProjection();
// color and depth image size.
PXCMImage.ImageInfo dinfo=depth.info;
PXCMImage.ImageInfo cinfo=color.info;
// Calculate the UV map.
PXCMPointF32[] uvmap=new PXCMPointF32[dinfo.width*dinfo.height];
projection.QueryUVMap(depth, uvmap);
// Translate depth points uv[] to color ij[]
for (int i=0;i<uv.Length;i++) {
ij[i].x=uvmap[(int)uv[i].y*dinfo.width+(int)uv[i].x].x*cinfo.width;
ij[i].y=uvmap[(int)uv[i].y*dinfo.width+(int)uv[i].x].y*cinfo.height;
}

81

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

// Clean up
projection.Dispose();
[Java]
// Create the PXCMProjection instance.
PXCMProjection projection=device.CreateProjection();
// color and depth image size.
PXCMImage.ImageInfo dinfo=depth.QueryInfo();
PXCMImage.ImageInfo cinfo=color.QueryInfo();
// Calculate the UV map.
PXCMPointF32[] uvmap=new PXCMPointF32[dinfo.width*dinfo.height];
projection.QueryUVMap(depth, uvmap);
// Translate depth points uv[] to color ij[]
for (int i=0;i<uv.Length;i++) {
ij[i].x=uvmap[(int)uv[i].y*dinfo.width+(int)uv[i].x].x*cinfo.width;
ij[i].y=uvmap[(int)uv[i].y*dinfo.width+(int)uv[i].x].y*cinfo.height;
}
// Clean up
projection.close();

[C#/UWP]

Use the Windows.Devices.Perception.PerceptionDepthCorrelatedCoordinateMapper


interface to map the coordinates between color and depth streams.

2.9

Working with Camera SR300


Starting with SDK 2016 R2, the SDK supports the new Intel RealSense Camera, model
SR300, the successor of the F200 model. The SR300 model provides a set of improvements
over the F200 model as follows (not a complete list):
Increased range and lateral speed.
Improved color quality under low-light performance conditions.
Improved color and depth stream synchronization.
Decreased power consumption.
For more details about the camera model SR300, please see the SR300 technical disclosure.
This document addresses the SDK compatibility and provides as a guide to migrate existing
SDK applications to the new camera.

82

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.9.1

Activating F200 Compatibility Mode


The Intel RealSense Depth Camera Manager (DCM) implements a F200 compatibility mode
to smooth the transition to camera model SR300. In the F200 compatibility mode, the DCM
emulates the F200 behaviors (including the device information, stream configurations, sensor
response, and device properties etc) so that existing SDK applications can work seamlessly on
camera model SR300.
Single Application Behavior
The F200 compatibility mode is activated when a streaming request comes from any
application compiled with an SDK version earlier than SDK R<%
SDK_VERSION_COMPATIBLE_MODE%> <%SDK_YEAR_COMPATIBLE_MODE%> release (or
the pre-R<%SDK_VERSION_COMPATIBLE_MODE%> application). The application sees the
camera as "F200" (DEVICE_MODEL_F200). The DCM translates any F200 streaming requests to
SR300 ones. Most applications should work as is without noticing much difference. SR300
just becomes a better F200 in this case.
It is recommended that application upgrades to SDK R<%
SDK_VERSION_COMPATIBLE_MODE%> <%SDK_YEAR_COMPATIBLE_MODE%> or later to
take advantage of any new features in the camera model SR300. A streaming request coming
from any application compiled with SDK R<%SDK_VERSION_COMPATIBLE_MODE%> <%
SDK_YEAR_COMPATIBLE_MODE%> or later (or the post-R<%
SDK_VERSION_COMPATIBLE_MODE%> application) deactivates the F200 compatibility
mode. The application works directly with the SR300 features.
Multiple Application Behavior
The following behavior applies when multiple applications are running at the same time on
the system:
If the first application is a pre-R<%SDK_VERSION_COMPATIBLE_MODE%> application, the
F200 compatibility mode is activated. Any subsequent streaming requests see the camera
as "F200".
If the first application is a post-R<%SDK_VERSION_COMPATIBLE_MODE%> application,
the F200 compatibility mode is deactivated. Any subsequent post-R<%
SDK_VERSION_COMPATIBLE_MODE%> application can see the camera as SR300, while
any subsequent pre-R<%SDK_VERSION_COMPATIBLE_MODE%> application will not see
any workable camera on the system.

2.9.2

SDK Interface Compatibility


You can expect to use the same SDK interfaces to program camera model SR300 as with
camera model F200 or R200. Use the SenseManager interface to control the data flow and
the SDK algorithm specific interfaces (such as FaceModule and HandModule) to configure the
algorithms or to retrieve the algorithm data.

83

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Module Interface Compatibility


Use the SDK algorithm modules to achieve the maximum application portability. No code
change is needed if you use the algorithm modules, and/or simple color and depth streaming
for visualization purpose.
Although fully compatible, the algorithms supporting camera model SR300 may be at
different maturity levels in terms of the amount of optimization done with the camera model.
See the SDK release notes for the module maturity levels.
Stream Interface Compatibility
No code change is needed if you use the SenseManager to read raw streams, without hardcoding any stream resolutions or pixel formats. For example, the following programming
practices are recommended:
Enable color streaming without specifying the stream configuration (resolution, frame rate,
or pixel format.) Instead, let the SenseManager pick any available stream configuration and
pixel format. See Example 41.
Example 41: Read a Color Stream

[C++]
// sm is a SenseManager instance
// Enable a Color Stream
sm->EnableStream(PXCCapture::STREAM_TYPE_COLOR);
...
[C#]
// sm is a SenseManager instance
// Enable a Color Stream
sm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_COLOR);
...
[Java]
// sm is a SenseManager instance
// Enable a Color Stream
sm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_COLOR);
...
[JavaScript]
// JavaScript does not support streaming raw images to protect user
privacy.
[C#/UWP]
// sm is a SenseManager instance
// Create a StreamReader instance
SampleReader sr=SampleReader.Activate(sm);
// Enable a Color Stream
sr.EnableStream(StreamType.STREAM_TYPE_COLOR);
84

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

...

When reading image data, use the Image functions (such as AcquireAccess and
ExportData) to force pixel format conversion to your desired pixel format, or if you prefer
to use the native pixel format, handle all cases. See Example 42.
Example 42: Force Conversion to Known Pixel Format

[C++]
// image is a PXCImage instance
PXCImage::ImageData data;
image->AcquireAccess(PXCImage::ACCESS_READ, PXCImage::PIXEL_FORMAT_RGB32,
&data);
...
image->ReleaseAccess(&data);
[C#]
// image is a PXCMImage instance
PXCMImage.ImageData data;
image.AcquireAccess(PXCMImage.Access.ACCESS_READ,
PXCMImage.PixelFormat.PIXEL_FORMAT_RGB32, out data);
...
image.ReleaseAccess(data);
[Java]
// image is a PXCMImage instance
PXCMImage.ImageData data=new PXCMImage.ImageData();
image.AcquireAccess(PXCMImage.Access.ACCESS_READ,
PXCMImage.PixelFormat.PIXEL_FORMAT_RGB32, data);
...
image.ReleaseAccess(data);
[JavaScript]
// JavaScript does not expose raw or processed images to protect user
privacy.
[C#/UWP]
// SoftewareBitmap is the UWP data type for images.
public SoftwareBitmapToWriteableBitmap(SoftwareBitmap bitmap,
WriteableBitmap bitmap2)
{
switch (bitmap.BitmapPixelFormat)
{
default:
using (var converted = SoftwareBitmap.Convert(bitmap,
BitmapPixelFormat.Rgba8))
converted.CopyToBuffer(bitmap2.PixelBuffer);
break;
case BitmapPixelFormat.Bgra8:
bitmap.CopyToBuffer(bitmap2.PixelBuffer);
break;
case BitmapPixelFormat.Gray16:
{
// See the UWP StreamViewer sample for all the code.
85

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

....
break;
}
}
}

When accessing the camera device properties, use those device neutral device properties
as listed in Device Neutral Device Properties.

2.9.3

SDK Interface Incompatibility


If you use any of the following stream related features, expect some incompatibilities. Follow
the mitigation steps as follows to write camera independent code that works for any camera:
The camera model SR300 friendly name string and the device model value are different
from that of the camera model F200.
Recommendations:
o Do not use the device friendly name for anything other than showing it to the user. Do
not use it for any camera identification purpose.
o Use the device model to perform operations specific to the camera only. If you need to
identify front facing camera vs. rear facing camera, use the device orientation value
instead.
See Also DeviceInfo.
Significant improvement is made in the SNR (Signal Noise Ratio) of the SR300 IR sensors.
The IR relative mode (pixel format IR_RELATIVE) is no longer necessary thus not exposed.
Use the regular IR instead (pixel format Y16). The IR sensor native data type is now 10-bit
(pixel format Y16). As a comparison, the F200 IR is 8-bit (pixel format Y8).
Recommendation: Use the AcquireAccess function to force pixel format conversion to Y16
when accessing the IR stream data.
The depth stream native data representation is 1/8mm in camera model SR300, as is 1/32mm
in camera model F200. If you access the native depth data representation with pixel format
DEPTH_RAW, you need to use the proper scaling factor. The data precision is still 1mm. This
change does not affect any applications that use the pixel format DEPTH to access the depth
data.
Recommendation: Use the QueryDepthUnit function to retrieve the scaling factor, or the
AcquireAccess function to force pixel format conversion to DEPTH when accessing the
depth stream data.
If you use any camera specific device properties such as those listed in Member Functions:
F200 & SR300 Functions, observe the following differences (not a complete list):
o There is minor difference in the filter option definition table. See the filter option table in

86

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

QueryIVCAMFilterOption or SetIVCAMFilterOption.

o If you use SetIVCAMAccuracy, it is recommended that you only use FINEST. Other
accuracy modes may actually impact the depth quality.
Recommendation: Avoid using device specific properties as much as possible, or your
application is impacted by any camera level feature changes. Specifically, if you use the SDK
algorithm modules only, you do not need to change any camera settings. The SDK
automatically sets the best settings for the algorithm(s).
During your application installation, if you use any camera specific options (see Installer
Options) to force checking a specific camera model, such as F200, your application will be
forced to install only when the specified camera is available on the platform.
Recommendation: Use the option "-front" if your application works with any front-facing
camera and "-rear" if your application works with any rear-facing camera. Do not force a
camera model if your application is not tied to the camera model.
Similarly, for JavaScript applications, if you specify the camera model in the
detectPlatform function in your application landing page (see Designing the Landing
Page), your application will be limited to the platform equipped with the specified camera
model only.
Recommendation: Use "front" if your application works with any front-facing camera and
"rear" if your application works with any rear-facing camera. Do not force a camera model if
your application is not tied to the camera model.

2.9.4

Writing Camera Specific Code [Advanced]


Your application may be installed on a platform equipped with any camera model, F200 or
SR300. In general, it is recommended that you write camera independent code. For example,
use the SDK provided algorithms for optimized performance and quality. If you need to
stream camera data, use the color and depth streams. This maximizes compatibility across
different camera product lines and reduces the chance of having to adapt your application to
new cameras.
If your application is not camera agnostic, you can use the QueryDeviceInfo function (or the
DeviceInfo property) to check the camera model at run time, as illustrated in Example 43,
and then branch to camera model specific code.
The device information is only valid after the Init function of the SenseManager interface.
Example 43: Check Camera Model

[C++]
// Create a SenseManager instance
PXCSenseManager *sm=PXCSenseManager::CreateInstance();
// Other SenseManager configuration (say, enable streams or modules)
...
87

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

// Initialize for starting streaming.


sm->Init();
// Get the camera info
PXCCapture::DeviceInfo dinfo={};
sm->QueryCaptureManager()->QueryDevice()->QueryDeviceInfo(&dinfo);
printf_s("camera model = %d\n", dinfo.model);
// Clean up
sm->Release();
[C#]
// Create a SenseManager instance
PXCMSenseManager sm=PXCMSenseManager.CreateInstance();
// Other SenseManager configuration (say, enable streams or modules)
...
// Initialize for starting streaming.
sm.Init();
// Get the camera info
PXCMCapture.DeviceInfo dinfo=sm.captureManager.device.deviceInfo;
Console.WriteLine("camera model = {0}", dinfo.model);
// Clean up
sm.Dispose();
[Java]
// Create a SenseManager instance
PXCMSenseManager sm=PXCMSenseManager.CreateInstance();
// Other SenseManager configuration (say, enable streams or modules)
...
// Initialize for starting streaming.
sm.Init();
// Get the camera info
PXCMCapture.DeviceInfo dinfo=new PXCMCapture.DeviceInfo();
sm.QueryCaptureManager().QueryDevice().QueryDeviceInfo(dinfo);
System.out.printf("camera model = %s%n", dinfo.model.toString());
// Close down
sm.close();
[JavaScript]
// name space short cuts
var rs=intel.realsense;
var rsb=intel.realsense.blob;
// Create a SenseManager instance
88

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

var sm;
rs.SenseManager.createInstance().then(function(instance) {
sm=instance;
// Create a blob instance
return rsb.BlobModule.createInstance(sm).then(function(bm)) {
// blob configuration: omitted here for simplicity.
....
// Initialize SenseManager
return sm.Init().then(function(result) {
// Check the Camera Model
document.write("camera model = " +
sm.captureManager.device.deviceInfo.model);
});
});
});
[C#/UWP]
using Intel.RealSense;
// Create a SenseManager instance
SenseManager sm=SenseManager.CreateInstance();
// Other SenseManager configuration
...
// Initialize
await sm.InitAsync();
// Get camera model
DeviceModel model=sm.CaptureManager.Device.DeviceInfo.model;
// Clean up
sm.Dispose();

2.10

Working with the R200 Enhanced Mode


The Intel RealSense camera, model R200, provides a special mode to work with certain
qualified rear-facing camera on the platform (or the platform camera) for better color sensing
quality. This mode is called the R200 Enhanced mode. The SDK exposes a virtual camera
device (with the device model DEVICE_MODEL_R200_Enhanced) that aggregates the color
stream from the platform camera and the depth stream from the camera, model R200. You
can use this device for features such as streaming (preview) and taking photos (snapshot) as
well as importing the samples into a Photo instance for any Depth Enabled Photography and
Videography operations.
The R200 Enhanced mode works only on specific OEM (Original Equipment Manufacturer)

89

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

systems and the quality varies with the layout and characteristics of the actual platform
cameras.
Use the following samples to test the R200 Enhanced mode features:
RawStreams: Use this sample to see color and depth streaming.
Projection: Check this sample to see how projection works.
EnhancedPhotography: Refer to this sample on how Depth Enabled Photography and
Videography works.

2.10.1 Checking R200 Enhanced


Before any SDK runtime is installed, you can check the qualification of your platform camera
with the following registry key.
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Intel\RSSDK\Components
\dcmservice_r200]
"R200EnhancedAvailable"=dword:00000001

If this 32-bit registry key exists and the value is non-zero, your platform camera is calibrated
to work with camera model R200.
See Also
Checking SDK, Camera Driver, and Algorithm Versions

2.10.2 Selecting R200 Enhanced


If there is a qualified platform camera on your system, you should see an additional camera
device enumerated after the camera model R200. The additional device carries the device
model DEVICE_MODEL_R200_ENHANCED.
The camera model R200 has precedence in the enumeration so as not to impact any
algorithms that are not sensitive to the color stream quality.
You can use the FilterByDeviceInfo function to select the R200 Enhanced device out of
available camera devices, as illustrated in Example 44. Do this before the Init function. If the
R200 Enhanced device is not available, the Init function returns an error.
Example 44: Selecting the R200 Enhanced Device

[C++]
// Create a SenseManager instance
PXCSenseManager* sm=PXCSenseManager::CreateInstance();
// Select the R200 Enhanced device
PXCCapture::DeviceInfo dinfo={};
dinfo.model=PXCCapture::DEVICE_MODEL_R200_ENHANCED;
sm->QueryCaptureManager()->FilterByDeviceInfo(&dinfo);

90

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

// The rest SenseManager configurations: activate a stream or an algorithm


// sm->EnableStream(PXCCapture::STREAM_TYPE_COLOR,0,0,0,
//
PXCCapture::Device::STREAM_OPTION_UNRECTIFIED);
....
// Initialize SenseManager
sm->Init();
// Do something here.
....
// Clean up
sm->Release();
[C#]
// Create a SenseManager instance
PXCMSenseManager sm=PXCMSenseManager.CreateInstance();
// Select the R200 Enhanced device
PXCMCapture.DeviceInfo dinfo=new PXCMCapture.DeviceInfo();
dinfo.model=PXCMCapture.DeviceModel.DEVICE_MODEL_R200_ENHANCED;
sm.captureManager.FilterByDeviceInfo(dinfo);
// The rest SenseManager configurations: activate a stream or an algorithm
// sm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_COLOR,0,0,0,
//
PXCMCapture.Device.StreamOption.STREAM_OPTION_UNRECTIFIED);
....
// Initialize SenseManager
sm.Init();
// Do something here.
....
// Clean up
sm.Dispose();
[Java]
// Create a SenseManager instance
PXCMSenseManager sm=PXCMSenseManager.CreateInstance();
// Select the R200 Enhanced device
PXCMCapture.DeviceInfo dinfo=new PXCMCapture.DeviceInfo();
dinfo.model=PXCMCapture.DeviceModel.DEVICE_MODEL_R200_ENHANCED;
sm.captureManager.FilterByDeviceInfo(dinfo);
// The rest SenseManager configurations: activate a stream or an algorithm
// sm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_COLOR,0,0,0,
//
PXCMCapture.Device.StreamOption.STREAM_OPTION_UNRECTIFIED);
....
// Initialize SenseManager
sm.Init();
91

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

// Do something here.
....
// Clean up
sm.close();

See Also
Checking R200 Enhanced During Installation

2.10.3 Streaming with R200 Enhanced


Streaming with the R200 Enhanced device is the same as any other camera devices, except
that you have to use the stream option STREAM_OPTION_UNRECTIFIED to initiate any color
stream request or to retrieve the color stream calibration data.
See Capturing Individual Color or Depth Stream for general procedures on streaming color
and depth samples. Example 13 shows how to initiate color and depth streams from the
R200 Enhanced device.
Example 45: Streaming Color and Depth From the R200 Enhanced Device

[C++]
// Create a SenseManager instance
PXCSenseManager* sm=PXCSenseManager::CreateInstance();
// Select the R200 Enhanced device
PXCCapture::DeviceInfo dinfo={};
dinfo.model=PXCCapture::DEVICE_MODEL_R200_ENHANCED;
sm->QueryCaptureManager()->FilterByDeviceInfo(&dinfo);
// Enable Color and Depth
sm>EnableStream(PXCCapture::STREAM_TYPE_COLOR,0,0,0,PXCCapture::Device::STREA
M_OPTION_UNRECTIFIED);
sm->EnableStream(PXCCapture::STREAM_TYPE_DEPTH,0,0,0);
// Initialize SenseManager
sm->Init();
// sm->AcquireFrame/ReleaseFrame for polling the samples or
// sm->StreamFrames for event callback when sample is ready.
....
// Clean up
sm->Release();
[C#]
// Create a SenseManager instance
PXCMSenseManager sm=PXCMSenseManager.CreateInstance();
// Select the R200 Enhanced device
PXCMCapture.DeviceInfo dinfo=new PXCMCapture.DeviceInfo();
92

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

dinfo.model=PXCMCapture.DeviceModel.DEVICE_MODEL_R200_ENHANCED;
sm.captureManager.FilterByDeviceInfo(dinfo);
// The rest SenseManager configurations: activate a stream or an algorithm
sm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_COLOR,0,0,0,
PXCMCapture.Device.StreamOption.STREAM_OPTION_UNRECTIFIED);
sm.EnableStream(PXCMCapture.StreamType.STERAM_TYPE_DEPTH,0,0,0);
// Initialize SenseManager
sm.Init();
// sm.AcquireFrame/ReleaseFrame for polling the samples or
// sm.StreamFrames for event callback when sample is ready.
....
// Clean up
sm.Dispose();
[Java]
// Create a SenseManager instance
PXCMSenseManager sm=PXCMSenseManager.CreateInstance();
// Select the R200 Enhanced device
PXCMCapture.DeviceInfo dinfo=new PXCMCapture.DeviceInfo();
dinfo.model=PXCMCapture.DeviceModel.DEVICE_MODEL_R200_ENHANCED;
sm.captureManager.FilterByDeviceInfo(dinfo);
// The rest SenseManager configurations: activate a stream or an algorithm
sm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_COLOR,0,0,0,
PXCMCapture.Device.StreamOption.STREAM_OPTION_UNRECTIFIED);
sm.EnableStream(PXCMCapture.StreamType.STERAM_TYPE_DEPTH,0,0,0);
// Initialize SenseManager
sm.Init();
// sm.AcquireFrame/ReleaseFrame for polling the samples or
// sm.StreamFrames for event callback when sample is ready.
....
// Clean up
sm.close();

2.10.4 Taking Photo


You can use the PlatformCameraControl interface to take a snapshot photo with the
platform camera.
To retrieve the PlatformCameraControl instance, use the QueryInstance function on an
active Device instance, as illustrated in Example 46.
You should not release the resulting PlatformCameraControl instance as the

93

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

QueryInstance function returns the Device object instance directly.


Example 46: Retrieve the PXCPlatformCameraControl Instance

[C++]
// sm is the SenseManager instance
PXCCapture::Device *device=sm->QueryCaptureManager()->QueryDevice();
PXCPlatformCameraControl *pcc=device>QueryInstance<PXCPlatformCameraControl>();
[C#]
// sm is the SenseManager instance
PXCMCapture.Device device=sm.captureManager.device;
PXCMPlatformCameraControl
pcc=device.QueryInstance<PXCMPlatformCameraControl>();
[Java]
// sm is the SenseManager instance
PXCMCapture.Device device=sm.QueryCaptureManager().QueryDevice();
PXCMPlatformCameraControl pcc=(PXCMPlatformCameraControl)
device.QueryInstance(PXCMPlatformCameraControl.CUID);

Use the EnumPhotoprofile function to enumerate available the snapshot configurations,


and the TakePhoto function to perform the snapshot operation. The photo taking operation
takes some time thus the TakePhoto function uses the Handler callback to deliver the
snapshot sample when it is ready. Example 47 shows how to take a snapshot photo.
Once you get the snapshot sample, you can import it to a Photo instance for any Depth
Enabled Photography and Videography operations. See also Accessing Photo.
Use the CreatePhotoProjection function to create a Projection instance for any
coordinate conversions specific to the taken photo. Note that the Projection instance
created from the Device interface is different from the one created from the
CreatePhotoProjection function. The former is specific to the streaming sample, while the
latter is specific to the photo sample. The two samples may be of different profile
configurations.
Example 47: Take a Snapshot Photo

[C++]
class MyHandler: public PXCPlatformCameraControl::Handler {
public:
virtual void PXCAPI OnPlatformCameraSample(PXCCapture::Sample& sample)
{
}
virtual void PXCAPI OnPlatformCameraError() {
}
};
// pcc is a PXCPlatformCameraControl interface
94

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

// Retrieve the photo configuration


PXCCapture::Device::StreamProfile profile={};
pcc->EnumPhotoProfile(0, &profile);
// Take a photo
MyHandler handler;
pcc->TakePhoto(profile, &hanlder);
[C#]
static void OnPlatformCameraSample(PXCMCapture.Sample sample) {
}
static void OnPlatformCameraError() {
}
// pcc is a PXCMPlatformCameraControl interface
// Retrieve the photo configuration
PXCMCapture.Device.StreamProfile profile;
pcc.EnumPhotoProfile(0, out profile);
// Take a photo
PXCMPlatformCameraHandler handler=new PXCMPlatformCameraHandler() {
onPlatformCameraSample=OnPlatformCameraSample,
onPlatformCameraError=OnPlatformCameraError
};
pcc.TakePhoto(profile, hanlder);
[Java]
class MyHandler impements PXCMPlatformCameraControl.Handler {
public void OnPlatformCameraSample(PXCMCapture.Sample sample) {
}
public void OnPlatformCameraError() {
}
};
// pcc is a PXCMPlatformCameraControl interface
// Retrieve the photo configuration
PXCMCapture.Device.StreamProfile profile=new
PXCMCapture.Device.StreamProfile();
pcc.EnumPhotoProfile(0, profile);
// Take a photo
MyHandler handler=new MyHandler();
pcc.TakePhoto(profile, hanlder);

2.11

Interface Reference
This section describes the Intel RealSense SDK essential interfaces and their operations for
application development.
In each interface description, only commonly used status codes are documented. The

95

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

function may return additional status codes in certain cases. See the Status enumerator for a
list of all status codes.
Naming Conventions
For C++, C# and Java, this manual uses [M] (where M stands for "managed") in the interface
names to represent interfaces that are available in a managed environment (such as C# and
Java). For example, Capture represents the C++ interface PXCCapture and the C#, and Java
interface PXCMCapture.
The manual uses additional markings after the interface or method names as follows:
Marking

Example

Comment

None

Base

Common for all languages and


frameworks, except JavaScript and
UWP interfaces. JavaScript and UWP
interfaces or methods are listed
separately.

(C++)

PXCBase.Release

C++ specific interface or methods.

(C#)

PXCMBase.Dispose

C# and Unity C# specific interface or


methods.

(C#.NET4)

PXCMImage.ImageData.ToBitmap

C# .NET4 specific interface or


methods. Not available in Unity C#.

(Unity)

PXCMImage.ImageData.ToTexture2 Unity C# specific interface or methods.


D
Not available in C#.

(Java)

PXCMBase.close

Java and Processing specific interface


or methods.

(Processing) PXCMImage.ImageData.ToPImage

Processing specific interface or


methods. Not available in Java.

(JS)

PXCMSession.QueryImpls

JavaScript specific interface or


methods.

(+JS)

PXCMSession.QueryModelDesc

Emphasize that the JavaScript


language is part of this function along
with other language interfaces.

(UWP)

SampleReader.EnableStream[s]

UWP specific interface or methods.

(+UWP)

SenseManager.CreateInstance

Emphasize that the UWP interface is


part of this function along with other
language interfaces.

2.11.1 AddRef
Namespace Hierarchy
96

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C++]
PXCAddRef
[C#]
PXCMAddRef
[Java]
PXCMAddRef

Description
The AddRef interface increases an object reference count. This is usually used to
preserve an object instance without making a copy.
The following object additionally exposes the AddRef interface:
Audio
Image
Photo

Reference
[C++]
pxcaddref.h
[C#/.NET4]
libpxcclr.cs.dll
[C#/Unity]
libpxcclr.unity.dll
[Java]
libpxcclr.java.jar
[Processing]
libpxcclr_processing

Runtime
[C++][C#][Java]

Install SDK runtime: core


See Also
Constants
Member Functions

97

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.1.1 Constants

The AddRef interface exposes the following constants:


Constant

Description

CUID

The interface identifier.

2.11.1.2 Member Functions

The AddRef interface exposes the following member functions:


Member Functions

Description

AddRef

Add the reference counter of an instance.

2.11.1.2.1 AddRef

Namespace Hierarchy
[C++]
PXCAddRef::AddRef
[C#]
PXCMAddRef.AddRef
[Java]
PXCMAddRef.AddRef

Syntax
[C++]
pxcI32 AddRef(void);
[C#]
Int32 AddRef();
[Java]
int AddRef();

Parameters
None

Description
The AddRef function increases the object reference counter.

98

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Return Status
The reference counter before the increment.
Example
Example 48 shows how to increase the reference counter of an Image instance.
Example 48: Increase the Reference Counter of an Image Object

[C++]
// image is a PXCImage instance;
image->QueryInstance<PXCAddRef>()->AddRef();
[C#]
// image is a PXCMImage instance;
image.QueryInstance<PXCMAddRef>().AddRef();
[Java]
// image is a PXCMImage instance;
image.QueryInstance<PXCMAddRef>().AddRef();

2.11.2 Base
Namespace Hierarchy
[C++]
PXCBase
[C#]
PXCMBase
[Java]
PXCMBase

Description
The Base interface is the base class of all SDK interface definitions.
[C++]

The interface overrides the class delete operator with the Release function to work
with the SDK dispatching mechanism and provides a QueryInstance mechanism to
replace the dynamic_cast operation, which relies on compilerspecific, run-time type
checking.
[C#]

99

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The interface provides the Dispose function to release any unmanaged memory
objects, and a QueryInstance function to retrieve any other interface that an SDK
module might implement.XCMBase
[Java]

The interface provides the close function to release any unmanaged memory objects,
and a QueryInstance function to retrieve any other interface that an SDK module might
implement.
Reference
[C++]
pxcbase.h
[C#/.NET4]
libpxcclr.cs.dll
[C#/Unity]
libpxcclr.unity.dll
[Java]
libpxcclr.java.jar
[Processing]
libpxcclr_processing

Runtime
[C++][C#][Java]

Install SDK runtime: core


See Also
Constants
Member Functions
2.11.2.1 Constants

The Base interface exposes the following constants:


Constant

Description

CUID

The interface identifier.

2.11.2.2 Member Functions

The Base interface exposes the following member functions.

100

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Member Functions

Description

QueryInstance

Query additional interface support

Release (C++)

Release this class instance.

Dispose (C#)

Release the class instance.

close (Java)

Release the class instance.

2.11.2.2.1 close (Java)

Namespace Hierarchy
PXCMBase.close

Syntax
void close();

Parameters
None

Description
The close function releases any unmanaged memory objects that the SDK interface
might hold.
Return Status
None

2.11.2.2.2 Dispose (C#)

Namespace Hierarchy
PXCMBase.Dispose

Syntax
void Dispose();

101

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Parameters
None
Description
The Dispose function releases any unmanaged memory objects that the SDK interface
might hold.
Return Status
None
2.11.2.2.3 QueryInstance

Namespace Hierarchy
[C++]
PXCBase::QueryInstance
[C#]
PXCMBase.QueryInstance
[Java]
PXCMBase.QueryInstance

Syntax
[C++]
void* QueryInstance(pxcUID cuid);
[C#]
PXCMBase QueryInstance(Int32 cuid);
[Java]
PXCMBase QueryInstance(int cuid);

Parameters
cuid

The interface identifier. For any SDK interface X, the


interface identifier is X::CUID (C++) or X.CUID
(C#,Java).

Description

102

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The QueryInstance function returns the instance of the requested interface if the
implementation supports such interface, or NULL/null if the implementation does not
support the requested interface.
The application should not release the returned instance, which is internally
managed.
Return Status
None
Remarks
[C++]

For simplicity, the application can use the QueryInstance<T> template. For example,
the following statement casts to a Y interface from an X interface: Y *y=x>QueryInstance<Y>();
[C#]

For simplicity, the application can use the QueryInstance<T> template. For example,
the following statement casts to a Y interface from an X interface: Y
y=x.QueryInstance<Y>();

Example
Example 49 shows how to retrieve the Metadata interface from the Session instance.
Example 49: Retrieve the Metadata interface

[C++]
PXCMetadata *meta_data=session->QueryInstance<PXCMetadata>();
[C#]
PXCMMetadata meta_data=session.QueryInstance<PXCMMetadata>();
[Java]
PXCMMetadata meta_data=(PXCMMetadata)
session.QueryInstance(PXCMMetadata.CUID);
2.11.2.2.4 Release (C++)

Namespace Hierarchy
PXCBase::Release

103

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Syntax
void Release(void);

Parameters
None

Description
The Release function releases the instance of the PXCBase interface.
Return Status
None

2.11.3 Calibration
Namespace Hierarchy
[C++]
PXCCalibration
[C#]
PXCMCalibration
[Java]
PXCMCalibration

Description
The Calibration interface provides functions to retrieve the device calibration
parameters.
You can use the QueryInstance function to retrieve an instance of the Calibration
interface from the Projection instance.
Reference
[C++]
pxccalibration.h
[C#/.NET4]
libpxcclr.cs.dll

104

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C#/Unity]
libpxcclr.unity.dll
[Java]
libpxcclr.java.jar
[Processing]
libpxcclr_processing

Runtime
[C++][C#][Java]

Install SDK runtime: core


Example
Example 50 shows how to create a calibration instance.
Example 50: Create a Projection Instance

[C++]
/* device is an instance of the PXCCapture::Device interface */
PXCProjection *projection=device->CreateProjection();
/* Get a calibration instance */
PXCCalibration *calib=projection->QueryInstance<PXCCalibration>();
...
/* Release the interface */
projection->Release();
[C#]
/* device is an instance of the PXCMCapture.Device interface */
PXCMProjection projection=device.CreateProjection();
/* Get a calibration instance */
PXCMCalibration calib=projection.QueryInstance<PXCCalibration>();
...
/* Dispose the interface */
projection.Dispose();
[Java]
/* device is an instance of the PXCMCapture.Device interface */
PXCMProjection projection=device.CreateProjection();
/* Get a calibration instance */
PXCMCalibration calib=(PXCMCalibration)
projection.QueryInstance(PXCMCalibration.CUID);
...
/* Release the interface */

105

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

projection.close();

See Also
Constants
Member Functions
2.11.3.1 Constants

The Calibration interface exposes the following constants:


Constant

Description

CUID

The interface identifier.

2.11.3.2 Member Functions

The Calibration interface exposes the following member functions:


Member Functions

Description

QueryStreamProjectionParameters

Get the calibration and transformation parameters


of the specified stream type.

QueryStreamProjectionParametersEx Get the calibration and transformation parameters

of the specified stream type and stream options.


2.11.3.2.1 QueryStreamProjectionParameters

Namespace Hierarchy
[C++]
PXCCalibration::QueryStreamProjectionParameters
[C#]
PXCMCalibration.QueryStreamProjectionParameters
[Java]
PXCMCalibration.QueryStreamProjectionParameters

Syntax
[C++]
pxcStatus QueryStreamProjectionParameters(StreamType streamType,
StreamCalibration *clibration, StreamTransform *transformation);
[C#]
pxcmStatus QueryStreamProjectionParameters(StreamType streamType, out
StreamCalibration clibration, out StreamTransform transformation);
[Java]
106

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

pxcmStatus QueryStreamProjectionParameters(StreamType streamType,


StreamCalibration clibration, StreamTransform transformation);

Parameters
streamType

The stream type; see the StreamType enumerator


for definitions.

calibration

The stream calibration parameters, to be returned.

transformation

The stream transformation parameters, to be


returned.

Description
The QueryStreamProjectionParameters function returns the calibration and
transformation parameters of the specified stream type.
Return Status
STATUS_NO_ERROR

The function returned successfully.

2.11.3.2.2 QueryStreamProjectionParametersEx

Namespace Hierarchy
[C++]
PXCCalibration::QueryStreamProjectionParametersEx
[C#]
PXCMCalibration.QueryStreamProjectionParametersEx
[Java]
PXCMCalibration.QueryStreamProjectionParametersEx

Syntax
[C++]
pxcStatus QueryStreamProjectionParametersEx(StreamType streamType,
StreamOption options, StreamCalibration *clibration, StreamTransform
*transformation);
[C#]
pxcmStatus QueryStreamProjectionParameters(StreamType streamType,
StreamOption options, out StreamCalibration clibration, StreamOption
options, out StreamTransform transformation);

107

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[Java]
pxcmStatus QueryStreamProjectionParameters(StreamType streamType,
StreamOption options, StreamCalibration clibration, StreamOption options,
StreamTransform transformation);

Parameters
streamType

The stream type; see the StreamType enumerator


for definitions.

options

The stream options; see the StreamOption


enumerator for definitions.

calibration

The stream calibration parameters, to be returned.

transformation

The stream transformation parameters, to be


returned.

Description
The QueryStreamProjectionParametersEx function returns the calibration and
transformation parameters of the specified stream type and options.
Return Status
STATUS_NO_ERROR

The function returned successfully.

2.11.4 Capture (+JS)


Namespace Hierarchy
[C++]
PXCCapture
[C#]
PXCMCapture
[Java]
PXCMCapture
[JavaScript]
intel.realsense.Capture

Description
108

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The Capture interface provides member functions to query video capture devices
and create an instance of the capture device.
The application can use the QueryCapture function (or the capture property) to
retrieve an instance of the Capture interface.
Reference
[C++]
pxccapture.h
[C#/.NET4]
libpxcclr.cs.dll
[C#/Unity]
libpxcclr.unity.dll
[Java]
libpxcclr.java.jar
[Processing]
libpxcclr_processing
[JavaScript]
realsense.js

Runtime
[C++][C#][Java][JavaScript]

Install SDK runtime: core


Example
Example 51 shows how to create a capture object.
Example 51: Enumerate Video Capture Modules

[C++]
PXCSession::ImplDesc desc={};
desc.group=PXCSession::IMPL_GROUP_SENSOR;
desc.subgroup=PXCSession::IMPL_SUBGROUP_VIDEO_CAPTURE;
for (int i=0;;i++) {
PXCSession::ImplDesc desc1;
pxcStatus sts=session->QueryImpl(&desc,i,&desc1);
if (sts<PXC_STATUS_NO_ERROR) break;
PXCCapture *capture;
sts=session->CreateImpl<PXCCapture>(&desc1,&capture);
if (sts<PXC_STATUS_NO_ERROR) continue;

109

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

....
capture->Release();
}
[C#]
PXCMSession.ImplDesc desc=new PXCMSession.ImplDesc() {
group=PXCMSession.ImplGroup.IMPL_GROUP_SENSOR,
subgroup=PXCMSession.ImplSubgroup.IMPL_SUBGROUP_VIDEO_CAPTURE,
};
for (uint i=0;;i++) {
PXCMSession.ImplDesc desc1;
pxcmStatus sts=session.QueryImpl(desc,i,out desc1);
if (sts.IsError()) break;
PXCMCapture capture;
sts=session->CreateImpl<PXCMCapture>(desc1, out capture);
if (sts.IsError()) continue;
....
capture.Dispose();
}
[Java]
PXCMSession.ImplDesc desc=new PXCMSession.ImplDesc();
desc.group=EnumSet.of(PXCMSession.ImplGroup.IMPL_GROUP_SENSOR);
desc.subgroup=EnumSet.of(PXCMSession.ImplSubgroup.IMPL_SUBGROUP_VIDEO_CAPTU
RE);
for (uint i=0;;i++) {
PXCMSession.ImplDesc desc1=new PXCMSession.ImplDesc();
pxcmStatus sts=session.QueryImpl(desc,i,desc1);
if (sts.isError()) break;
PXCMCapture capture=new PXCMCapture();
sts=session.CreateImpl<PXCMCapture>(desc1, capture);
if (sts.isError()) continue;
....
capture.close();
}
[JavaScript]
// In JavaScript, the capture devices are managed by the SenseManager
// sm is a SenseManager instance
// use sm.captureManager.capture for the Capture instance

See Also

110

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Callbacks and Delegates


Constants
Member Functions
Static Functions

111

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.4.1 Callbacks and Delegates

The Capture interface provides the following callback functions/delegates:


Callback/Delegate

Description

Handler

Callbacks and delegates from camera devices.

2.11.4.1.1 Handler

Namespace Hierarchy
[C++]
PXCCapture::Handler
[C#]
PXCMCapture.Handler
[Java]
PXCMCapture.Handler

Description
The Handler interface is a set of callback functions/delegates to be used to receive
camera events. The application must implement the interface.
Examples
Example 52 shows how to create a handler.
Example 52: Create a Handler

[C++]
class MyHandler: public PXCCapture::Handler {
public:
virtual void PXCAPI OnDeviceListChanged(void) {
....
}
};
// capture is a PXCCapture instance.
MyHandler handler;
capture->SubscribeCaptureCallbacks(&handler);
....
capture->UnsubscribeCaptureCallbacks(&handler);
[C#]
static void OnDeviceListChanged() {
....
}

112

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

// capture is a PXCMCapture instance


PXCMCapture.Handler handler=new PXCMCapture.Handler();
handler.onDeviceListChanged=OnDeviceListChanged;
capture.SubscribeCaptureCallbacks(handler);
....
capture.UnsubscribeCaptureCallbacks(handler);
[Java]
class MyHandler impements PXCMCapture.Handler {
public void OnDeviceListChanged() {
....
}
};
// capture is a PXCMCapture instance
MyHandler handler=new MyHandler();
capture.SubscribeCaptureCallbacks(handler);
....
capture.UnsubscribeCaptureCallbacks(handler);

See Also
Member Functions

113

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.4.1.1.1 Member Functions

The Handler interface provides the following callback functions/delegates:


Callback/Delegate

Description

OnDeviceListChanged

Events occur when there is a change in the device


list.

Namespace Hierarchy
[C++]
PXCCapture::Handler::OnDeviceListChanged
[C#]
PXCMCapture.Handler.OnDeviceListChanged
[Java]
PXCMCapture.Handler.OnDeviceListChanged

Syntax
[C++]
void OnDeviceListChanged(void);
[C#]
void OnDeviceListChanged();
[Java]
void OnDeviceListChanged();

Parameters
None

Description
The OnDeviceListChanged function is invoked when there is a change in the device
list. Use QueryDeviceInfo to enumerate the device list.
You should not perform any lengthy operation in the callback function.
Return Status
None

114

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.4.2 Constants

The Capture interface exposes the following constants:


Constant

Description

CUID

The interface identifier.

STREAM_LIMIT

The max number of streams supported by the interface.

PROPERTY_VALUE_INVALID

The special value to indicate that the property setting is


invalid.

2.11.4.3 Member Functions

The Capture interface exposes the following member functions:


Member Functions

Description

CreateDevice

Create an instance of the capture device.

QueryDeviceNum

Return the number of available devices.

QueryDeviceInfo

Query information of a capture device by index.

SubscribeCaptureCallbacks

Register for camera device events.

UnsubscribeCaptureCallbacks

Unregister the callbacks.

2.11.4.3.1 CreateDevice

Namespace Hierarchy
[C++]
PXCCapture::CreateDevice
[C#]
PXCMCapture.CreateDevice
[Java]
PXCMCapture.CreateDevice

Syntax
[C++]
Device* CreateDevice(pxcI32 didx);
[C#]
Device CreateDevice(Int32 didx);
[Java]
Device CreateDevice(int didx);

115

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Parameters
didx

The zero-based capture device index.

Description
The CreateDevice function creates a Device interface instance for the given capture
device.
Return Status
The capture device instance, or NULL/null if there is any error.
2.11.4.3.2 QueryDeviceInfo

Namespace Hierarchy
[C++]
PXCCapture::QueryDeviceInfo
[C#]
PXCMCapture.QueryDeviceInfo
[Java]
PXCMCapture.QueryDeviceInfo

Syntax
[C++]
pxcStatus QueryDeviceInfo(pxcI32 didx, DeviceInfo *dinfo);
[C#]
pxcmStatus QueryDeviceInfo(Int32 didx, out DeviceInfo dinfo);
[Java]
pxcmStatus QueryDeviceInfo(int didx, DeviceInfo dinfo);

Parameters
didx

Zero-based capture device index.

dinfo

The device information to be returned.

Description
116

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The QueryDeviceInfo function returns the capture device information by index. The
number of available capture devices and their order may change over time, thus the
application should not assume any particular value or order of the capture device
index. The SDK enumerates available capture devices in the system when the
application creates the Capture instance.
Return Status
STATUS_NO_ERROR

The function returned successfully.

STATUS_ITEM_UNAVAILABLE

No capture device found with the given index.

2.11.4.3.3 QueryDeviceNum

Namespace Hierarchy
[C++]
PXCCapture::QueryDeviceNum
[C#]
PXCMCapture.QueryDeviceNum
[Java]
PXCMCapture.QueryDeviceNum

Syntax
[C++]
pxcI32 QueryDeviceNum(void);
[C#]
Int32 QueryDeviceNum();
[Java]
int QueryDeviceNum();

Parameters
None
Description
The QueryDeviceNum function returns the number of capture devices.
Return Status
117

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The capture device number.


2.11.4.3.4 SubscribeCaptureCallbacks

Namespace Hierarchy
[C++]
PXCCapture::SubscribeCaptureCallbacks
[C#]
PXCMCapture.SubscribeCaptureCallbacks
[Java]
PXCMCapture.SubscribeCaptureCallbacks

Syntax
[C++]
pxcStatus SubscribeCaptureCallbacks(Handler *handler);
[C#]
pxcmStatus SubscribeCaptureCallbacks(Handler handler);
[Java]
pxcmStatus SubscribeCaptureCallbacks(Handler handler);

Parameters
handler

The set of callback or delegate functions.

Description
The SubscribeCaptureCallbacks function registers the set of callback functions for
any camera device events.
Return Status
STATUS_NO_ERROR

The function returned successfully.

2.11.4.3.5 UnsubscribeCaptureCallbacks

Namespace Hierarchy
[C++]
PXCCapture::UnsubscribeCaptureCallbacks

118

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C#]
PXCMCapture.UnsubscribeCaptureCallbacks
[Java]
PXCMCapture.UnsubscribeCaptureCallbacks

Syntax
[C++]
pxcStatus UnsubscribeCaptureCallbacks(Handler *handler);
[C#]
pxcmStatus UnsubscribeCaptureCallbacks(Handler handler);
[Java]
pxcmStatus UnsubscribeCaptureCallbacks(Handler handler);

Parameters
handler

The set of callback or delegate functions.

Description
The UnsubscribeCaptureCallbacks function unregisters the callback functions,
which must be previously registered via the SubscribeCaptureCallbacks function.
Return Status
STATUS_NO_ERROR

The function returned successfully.

2.11.4.4 Static Functions

The Capture interface exposes the following static functions:


Static Function

Description

StreamTypeToString

Get the string representation of the stream type.

StreamTypeFromIndex Get the stream type from the stream index.


StreamTypeToIndex

Get the stream index from the stream type.

2.11.4.4.1 StreamTypeFromIndex

Namespace Hierarchy
[C++]

119

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

PXCCapture::StreamTypeFromIndex
[C#]
PXCMCapture.StreamTypeFromIndex
[Java]
PXCMCapture.StreamTypeFromIndex

Syntax
[C++]
StreamType StreamTypeFromIndex(pxcI32 index);
[C#]
StreamType StreamTypeFromIndex(Int32 index);
[Java]
StreamType StreamTypeFromIndex(int index);

Parameters
index

The zero-based stream index.

Description
The StreamTypeFromIndex function returns the stream type of a specific stream
specified by the stream index.
Return Status
The stream type; see the StreamType enumerator.
2.11.4.4.2 StreamTypeToIndex

Namespace Hierarchy
[C++]
PXCCapture::StreamTypeToIndex
[C#]
PXCMCapture.StreamTypeToIndex
[Java]
PXCMCapture.StreamTypeToIndex

Syntax

120

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C++]
pxcI32 StreamTypeToIndex(StreamType type);
[C#]
Int32 StreamTypeToIndex(StreamType type);
[Java]
int StreamTypeToIndex(StreamType type);

Parameters
type

The stream type; see the StreamType


enumerator.

Description
The StreamTypeToIndex function returns the stream index of the specified stream
type.
Return Status
The zero-based stream index.
2.11.4.4.3 StreamTypeToString

Namespace Hierarchy
[C++]
PXCCapture::StreamTypeToString
[C#]
PXCMCapture.StreamTypeToString
[Java]
PXCMCapture.StreamTypeToString

Syntax
[C++]
const pxcCHAR *StreamTypeToString(StreamType stream);
[C#]
String StreamTypeToString(StreamType stream);
[Java]
string StreamTypeToString(StreamType stream);

121

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Parameters
stream

The stream type; see the StreamType


enumerator.

Description
The StreamTypeToString function returns the string representation of the stream
type.
Return Status
The string representation.
Remarks
[C#]

The C# application can also use the ToString type extension.


[Java]

The Java application can also use the ToString type extension.

2.11.5 CaptureManager (+JS,+UWP)


Namespace Hierarchy
[C++]
PXCCaptureManager
[C#]
PXCMCaptureManager
[Java]
PXCMCaptureManager
[JavaScript]
intel.realsense.CaptureManager
[C#/UWP]
Intel.RealSense.CaptureManager

Description

122

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The CaptureManager interface is a helper interface (on top of the Capture interface)
for creating complex pipelines. The general concept is that there are a set of
processing modules (each with a unique identifier.) The CaptureManager interface
provides a set of functions to help consolidate the input needs of these processing
modules and locate the right I/O device that can provide data to satisfy all input
needs.
You can use the QueryCaptureManager function (or the captureManager property)
to retrieve an instance of the CaptureManager interface.
Reference
[C++]
pxccapturemanager.h
[C#/.NET4]
libpxcclr.cs.dll
[C#/Unity]
libpxcclr.unity.dll
[Java]
libpxcclr.java.jar
[Processing]
libpxcclr_processing
[JavaScript]
realsense.js
[C#/UWP]
Intel.RealSense

Runtime
[C++][C#][Java][JavaScript]

Install SDK runtime: core


Example
Example 53 shows how to retrieve an instance of the CaptureManager instance.
Example 53: Retrieve a CaptureManager Instance

[C++]
// sm is a PXCSenseManager instance
PXCCaptureManager *cm=sm->QueryCaptureManager();
...
[C#]
123

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

// sm is a PXCMSenseManager instance
PXCMCaptureManager cm=sm.captureManager;
...
[Java]
// sm is a PXCMSenseManager instance
PXCMCaptureManager cm=sm.QueryCaptureManager();
...
[JavaScript]
// sm is a SenseManager instance
var cm=sm.captureManager;
...
[C#/UWP]
using Intel.RealSense;
// sm is a SenseManager instance
CaptureManager cm=sm.captureManager;
...

See Also
Constants
Callbacks and Delegates
Member Functions
Properties

124

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.5.1 Constants

The CaptureManager interface exposes the following constants:


Constant

Description

CUID

The interface identifier.

2.11.5.2 Callbacks and Delegates

The CaptureManager interface provides the following callback functions/delegates:


Callback/Delegate

Description

Handler

Callbacks and delegates for the LocateStreams


function.

2.11.5.2.1 Handler

Namespace Hierarchy
[C++]
PXCCaptureManager::Handler
[C#]
PXCMCaptureManager.Handler
[Java]
PXCMCaptureManager.Handler

Description
The Handler interface is a set of callback functions/delegates for the LocateStreams
function as illustrated in Figure 13. The application must implement the interface.

125

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Figure 13: PXCCaptureManager::LocateStreams Callback Functions

Examples
Example 54 shows how to create a handler.
Example 54: Create a Handler

[C++]
class MyHandler: public PXCCaptureManager::Handler {
public:
virtual pxcStatus PXCAPI OnCreateDevice(PXCSession::ImplDesc *mdesc,
PXCCapture::Device *device) {
return PXC_STATUS_NO_ERROR;
}
};
// cm is a PXCCaptureManager instance.
MyHandler handler;
cm->LocateStreams(&handler);
[C#]
static pxcmStatus OnCreateDevice(PXCMSession.ImplDesc mdesc,
PXCMCapture.Device device) {
return pxcmStatus.PXCM_STATUS_NO_ERROR;
}
// cm is a PXCMCaptureManager instance
PXCMCaptureManager.Handler handler=new PXCMCaptureManager.Handler();
handler.onCreateDevice=OnCreateDevice;
cm.LocateStreams(handler);

126

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[Java]
class MyHandler implements PXCMCaptureManager.Handler {
public:
public pxcmStatus OnCreateDevice(PXCMSession.ImplDesc mdesc,
PXCMCapture.Device device) {
return pxcmStatus.PXCM_STATUS_NO_ERROR;
}
};
// cm is a PXCMCaptureManager instance.
MyHandler handler=new MyHandler();
cm.LocateStreams(handler);

See Also
Member Functions

127

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.5.2.1.1 Member Functions

The Handler interface provides the following callback functions/delegates:


Callback/Delegate

Description

OnCreateDevice

Event for device creation.

OnSetupStreams

Event for video stream setup.

OnNextDevice

Event when continue onto next device.

Namespace Hierarchy
[C++]
PXCCaptureManager::Handler::OnCreateDevice
[C#]
PXCMCaptureManager.Handler.onCreateDevice
[Java]
PXCMCaptureManager.Handler.OnCreateDevice

Syntax
[C++]
pxcStatus OnCreateDevice(PXCSession::ImplDesc* mdesc, PXCCapture::Device
*device);
[C#]
delegate pxcmStatus OnCreateDeviceDelegate(PXCSession::ImplDesc mdesc,
PXCMCapture.Device device);
[Java]
pxcmStatus OnCreateDevice(PXCSession::ImplDesc mdesc, PXCMCapture.Device
device);

Parameters

128

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

mdesc

The device implementation descriptor.

device

The device instance.

Description
The OnCreateDevice function is invoked after creating a device. The application can
use this function to query the device information, accept or reject the device.
The application should not perform any lengthy operation in the callback function.
Return Status
STATUS_NO_ERROR

Accept the current device and continue.

Any error code

Reject the current device and search next device.

Remarks
The device instance is an object that CaptureManager internally manages. Do not
release the device instance.

Namespace Hierarchy
[C++]
PXCCaptureManager::Handler::OnSetupStreams
[C#]
PXCMCaptureManager.Handler.onSetupStreams
[Java]
PXCMCaptureManager.Handler.OnSetupStreams

Syntax
[C++]
pxcStatus OnSetupVideoStream(PXCCapture::Device *device, StreamType
types);
[C#]
delegate pxcmStatus OnSetupStreams(PXCMCapture.Device device, StreamType
types);
[Java]
pxcmStatus OnSetupStreams(PXCMCapture.Device device, StreamType types);

129

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Parameters
device

The device instance.

types

The bit-OR'ed value of all streams in configuration.

Description
The OnSetupStreams function is invoked after all streams are fully configured. The
application can use this function to query the stream configurations, accept or reject
the streams.
The application should not perform any lengthy operation in the callback function.
Return Status
STATUS_NO_ERROR

Accept the current video stream and continue.

Any error code

Reject the current video stream and search next


stream.

Remarks
The device instance is an object that CaptureManager internally manages. Do not
release the device instance.

Namespace Hierarchy
[C++]
PXCCaptureManager::Handler::OnNextDevice
[C#]
PXCMCaptureManager.Handler.onNextDevice
[Java]
PXCMCaptureManager.Handler.OnNextDevice

Syntax
[C++]
pxcStatus OnNextDevice(PXCCapture::Device *device);
[C#]
delegate pxcmStatus OnNextDeviceDelegate(PXCMCapture.Device device);
130

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[Java]
pxcmStatus OnNextDevice(PXCMCapture.Device device);

Parameters
device

The current device instance.

Description
The OnNextDevice function is invoked after CaptureManager has checked the
current device, and the current device does not qualify. If the function returns any
failure, CaptureManager repeats checking the current device again. Otherwise,
CaptureManager continues onto checking the next device.
This function is used to check multiple configurations on the same device. The
application should return PXC_STATUS_NO_ERROR after checking all configurations on
the current device.
The application should not perform any lengthy operation in the callback function.
Return Status
STATUS_NO_ERROR

Continue onto checking the next device.

Any error code

Repeat checking the current device again.

Remarks
The device instance is an object that CaptureManager internally manages. Do not
release the device instance.
2.11.5.3 Member Functions

The CaptureManager interface provides the following member functions:

131

Member Functions

Description

FilterByDeviceInfo (+UWP)

Set an I/O device parameter filter to filter the


results during LocateStreams.

FilterByStreamProfiles

Set a stream configuration filter to filter the results


during LocateStreams.

LocateStreams

Consolidate all input requests. Find a device that

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

matches them.
CloseStreams

Close all active streams.

QueryCapture

Return the PXCCapture instance.

QueryDevice

Return the Device instance.

QueryImageSize

Return the image size of the specified stream.

ReadModuleStreamsAsync

Read image samples for the specified processing


module.

SetFileName

Set file recording or playback.

SetMask

Select the streams for recording.

SetPause

Pause or resume file recording or playback.

SetRealtime

Set real time playback mode.

SetFrameByIndex
QueryFrameByIndex

Random access during playback using the frame


index.

SetFrameByTimeStamp
QueryFrameByTimeStamp

Random access during playback using time stamps.

QueryNumberOfFrames

Return the number of frames in a playback file.

2.11.5.3.1 CloseStreams

Namespace Hierarchy
[C++]
PXCCaptureManager::CloseStreams
[C#]
PXCMCaptureManager.CloseStreams
[Java]
PXCMCaptureManager.CloseStreams

Syntax
[C++]
void CloseStreams(void);
[C#]
void CloseStreams();
[Java]
void CloseStreams();

132

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Parameters
None

Description
The CloseStreams function closes all open streams and any file associated for
recording or playback.
Return Status
None

2.11.5.3.2 FilterByDeviceInfo (+UWP)

Namespace Hierarchy
[C++]
PXCCaptureManager::FilterByDeviceInfo
[C#]
PXCMCaptureManager.FilterByDeviceInfo
[Java]
PXCMCaptureManager.FilterByDeviceInfo
[C#/UWP]
Intel.RealSense.CaptureManager.FilterByDeviceInfo

Syntax
[C++]
void FilterByDeviceInfo(DeviceInfo *dinfo);
void FilterByDeviceInfo(pxcCHAR *name, pxcCHAR *did, pxcI32 didx);
[C#]
void FilterByDeviceInfo(DeviceInfo dinfo);
void FilterByDeviceInfo(String name, String did, Int32 didx);
[Java]
void FilterByDeviceInfo(DeviceInfo dinfo);
void FilterByDeviceInfo(string name, string did, int didx);
[C#/UWP]
void FilterByDeviceInfo(DeviceInfo dinfo);

133

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Parameters
dinfo

If not NULL/null, add a device filter to match any


non-zero values in the specified DeviceInfo
structure.

name

If not NULL/null, add a device filter to match the


device friendly name.

did

If not NULL/null, add a device filter to match the


device unique identifier string.

didx

If not zero, add a device filter to match the device


index value.

Description
The FilterByDeviceInfo function saves a list of device filters to be used later in the
LocateStreams function for searching the right I/O device.
If dinfo is NULL/null, the function cleans any previously saved device filters.
Return Status
None

2.11.5.3.3 FilterByStreamProfiles

Namespace Hierarchy
[C++]
PXCCaptureManager::FilterByStreamProfiles
[C#]
PXCMCaptureManager.FilterByStreamProfiles
[Java]
PXCMCaptureManager.FilterByStreamProfiles

Syntax
[C++]
void FilterByStreamProfiles(StreamProfileSet *profiles);
void FilterByStreamProfiles(StreamType stream, pxcI32 width, pxcI32
height, pxcF32 fps);

134

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C#]
void FilterByStreamProfiles(StreamProfileSet profiles);
void FilterByStreamProfiles(StreamType stream, Int32 width, Int32 height,
Single fps);
[Java]
void FilterByStreamProfiles(StreamProfileSet profiles);
void FilterByStreamProfiles(StreamType stream, int width, int height,
float fps);

Parameters
profiles

The stream configuration parameters, or NULL/null


to remove all stream configuration filter.

stream

The stream type. See the StreamType enumerator for


definitions.

width

The optional width value, if non-zero.

height

The optional height value, if non-zero.

fps

The optional frame rate, if non-zero.

Description
The FilterByStreamProfiles function saves a list of stream configuration filters to
be used later in the LocateStreams function for searching the right I/O device.
If profiles is NULL/null, the function cleans any previously saved stream
configuration filters.
Return Status
None
2.11.5.3.4 LocateStreams

Namespace Hierarchy
[C++]
PXCCaptureManager::LocateStreams
[C#]
PXCMCaptureManager.LocateStreams

135

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[Java]
PXCMCaptureManager.LocateStreams

Syntax
[C++]
pxcStatus
pxcStatus

LocateStreams(Handler *handler);
LocateStreams(void);

[C#]
pxcmStatus LocateStreams(Handler handler);
pxcmStatus LocateStreams();
[Java]
pxcmStatus LocateStreams(Handler handler);
pxcmStatus LocateStreams();

Parameters
handler

A set of optional callback functions/delegates.


See the Handler interface for details.

Description
The LocateStreams function consolidates input requests from prior RequestStreams
functions, and locates an input device that can provide the data. The function
searches the input devices by the order of I/O modules listed in the SDK session
(higher merit modules take precedence.) The input device is fully configured for
streaming after the function returns.
The qualifying input device must be able to stream video streams that match the
requested color format, resolutions and any mandated device properties.
After a successful return, the function overwrites the input requests with:
1. The values of requested device properties.
2. The actual resolution of requested streams.
3. The actual device information.
Return Status

136

STATUS_NO_ERROR

The function returned successfully.

STATUS_ITEM_UNAVAILABLE

The function failed to locate an input device.

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.5.3.5 QueryCapture

Namespace Hierarchy
[C++]
PXCCaptureManager::QueryCapture
[C#]
PXCMCaptureManager.QueryCapture
[Java]
PXCMCaptureManager.QueryCapture

Syntax
[C++]
PXCCapture *QueryCapture(void)
[C#]
PXCMCapture QueryCapture()
[Java]
PXCMCapture QueryCapture()

Parameters
None
Description
The QueryCapture function returns the Capture instance.
Return Status
The Capture instance, or NULL/null if not available.
Remarks
[C++]

The returned instance is a CaptureManager internally managed object. Do not release


it.
[C#]

The returned instance is a CaptureManager internally managed object. Do not release


it.

137

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The C# application can also use property capture.


[Java]

The returned instance is a CaptureManager internally managed object. Do not release


it.

2.11.5.3.6 QueryDevice

Namespace Hierarchy
[C++]
PXCCaptureManager::QueryDevice
[C#]
PXCMCaptureManager.QueryDevice
[Java]
PXCMCaptureManager.QueryDevice

Syntax
[C++]
Device *QueryDevice(void);
[C#]
Device QueryDevice();
[Java]
Device QueryDevice();

Parameters
None
Description
The QueryDevice function returns the Capture::Device instance found by the
LocateStreams function.
Return Status
The Device instance, or NULL/null if not available.
Remarks

138

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C++]

The returned instance is a CaptureManager internally managed object. Do not release


it.
[C#]

The returned instance is a CaptureManager internally managed object. Do not release


it.
The C# application can also use property device.
[Java]

The returned instance is a CaptureManager internally managed object. Do not release


it.

2.11.5.3.7 QueryFrameByIndex

Namespace Hierarchy
[C++]
PXCCaptureManager::QueryFrameByIndex
[C#]
PXCMCaptureManager.QueryFrameByIndex
[Java]
PXCMCaptureManager.QueryFrameByIndex

Syntax
[C++]
pxcI32 QueryFrameByIndex(void);
[C#]
Int32 QueryFrameByIndex();
[Java]
int QueryFrameByIndex();

Parameters
None

Description

139

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The QueryFrameByIndex function returns the frame index of the frame closest to the
current playback position. The frame index is zero-based.
Return Status
The frame index, or -1 if the playback position is at the end of the file.
2.11.5.3.8 QueryNumberOfFrames

Namespace Hierarchy
[C++]
PXCCaptureManager::QueryNumberOfFrames
[C#]
PXCMCaptureManager.QueryNumberOfFrames
[Java]
PXCMCaptureManager.QueryNumberOfFrames

Syntax
[C++]
pxcI32 QueryNumberOfFrames(void);
[C#]
Int32 QueryNumberOfFrames();
[Java]
int QueryNumberOfFrames();

Parameters
None

Description
The QueryNumberOfFrames function returns the number of frames in a playback file.
Return Status
The frame number, or 0 if it is not in a playback mode.

140

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.5.3.9 QueryFrameByTimeStamp

Namespace Hierarchy
[C++]
PXCCaptureManager::QueryFrameByTimeStamp
[C#]
PXCMCaptureManager.QueryFrameByTimeStamp
[Java]
PXCMCaptureManager.QueryFrameByTimeStamp

Syntax
[C++]
pxcI64 QueryFrameByTimeStamp(void);
[C#]
Int64 QueryFrameByTimeStamp();
[Java]
long QueryFrameByTimeStamp();

Parameters
None

Description
The QueryFrameByTimeStamp function returns the time stamp of the closest frame to
the current playback position.
Return Status
The closest frame time stamp, or 0 if the playback position is at the end of the file.
2.11.5.3.10 QueryImageSize (+JavaScript)

Namespace Hierarchy
[C++]
PXCCaptureManager::QueryImageSize
[C#]
PXCMCaptureManager.QueryImageSize
[Java]
141

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

PXCMCaptureManager.QueryImageSize
[JavaScript]
intel.realsense.CaptureManager.QueryImageSize

Syntax
[C++]
PXCSizeI32 QueryImageSize(StreamType stream);
[C#]
PXCMSizeI32 QueryImageSize(StreamType stream);
[Java]
PXCMSizeI32 QueryImageSize(StreamType stream);
[JavaScript]
function queryImageSize(stream);

Parameters
stream

The stream type as specified in the StreamType


enumerator.

Description
The QueryImageSize function returns the resolution of the specified stream. The
resolution information is available only after the pipeline is initialized.
Return Status
[C++]

The image resolution or (0,0) if the image resolution is not available.


[C#]

The image resolution or (0,0) if the image resolution is not available.


[Java]

The image resolution or (0,0) if the image resolution is not available.


[JavaScript]

The returned promise object contains:


sts

142

The status code, as defined in the Status enumerator.

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

size

The image resolution { width, height }.


See also SizeI32.

2.11.5.3.11 ReadModuleStreamsAsync

Namespace Hierarchy
[C++]
PXCCaptureManager::ReadModuleStreamsAsync
[C#]
PXCMCaptureManager.ReadModuleStreamsAsync
[Java]
PXCMCaptureManager.ReadModuleStreamsAsync

Syntax
[C++]
pxcStatus ReadModuleStreamsAsync(pxcUID mid, Sample *sample, PXCSyncPoint
**sp);
[C#]
pxcmStatus ReadModuleStreamsAsync(Int32 mid, Sample sample, out
PXCMSyncPoint sp);
[Java]
pxcmStatus ReadModuleStreamsAsync(Int32 mid, Sample sample, out
PXCMSyncPoint sp);

Parameters
mid

The module identifier, or 0 to read directly from the I/


O device.

sample

The image samples, to be returned.

sp

The SP, to be returned.

Description

143

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The ReadModuleStreamsAsync function reads the set of image samples from the I/O
device for the specified processing module.
This is an asynchronous function. The image samples are invalid until the SP is
signaled.
If the processing module requests more than a single stream, the function
synchronizes the stream reads so that they are time aligned.
The function maps video streams at the I/O device to the specified processing
module, before reading samples. For example, if the I/O device serves a color stream
and a depth stream, in that order, and the processing module needs a depth stream
only, the function reads the depth stream only from the I/O device and serves to the
processing module.
When there are multiple processing modules, the function buffers the reads to each
stream so that each processing module will get a chance to read the samples without
skipping any samples.
If mid=0, the function reads directly from the I/O device.
Return Status
STATUS_NO_ERROR

The function returned successfully.

STATUS_ITEM_UNAVAILABLE

The I/O device has reached end of file.

STATUS_DEVICE_LOST

The I/O device has been disconnected.

2.11.5.3.12 RequestStreams

Namespace Hierarchy
[C++]
PXCCaptureManager::RequestStreams
[C#]
PXCCaptureManager::RequestStreams
[Java]
PXCMCaptureManager.RequestStreams

Syntax
[C++]
pxcStatus RequestStreams(pxcUID mid, DataDesc *input);
[C#]
144

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

pxcmStatus RequestVideoStreams(Int32 mid, DataDesc input);


[Java]
pxcmStatus RequestVideoStreams(Int32 mid, DataDesc input);

Parameters
input

The input request, as described in the


DataDesc structure, from a processing module.

mid

A arbitrary non-zero unique identifier for the


processing module.

Description
The RequestStreams function saves the input requests from an algorithm module.
The function returns failed if the current request conflicts with any previous input
requests.
The module identifier mid can be any non-zero values that uniquely identifies each
processing module.
If input=zero, the function clears any previously saved input requests.
Return Status
STATUS_NO_ERROR

The function returned successfully.

STATUS_ITEM_UNAVAILABLE

The current input request conflicts with any


previous requests.

2.11.5.3.13 SetFileName

Namespace Hierarchy
[C++]
PXCCaptureManager::SetFileName
[C#]
PXCMCaptureManager.SetFileName
[Java]
PXCMCaptureManager.SetFileName

Syntax

145

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C++]
pxcStatus SetFileName(pxcCHAR *file, pxcBool record);
[C#]
pxcmStatus SetFileName(String file, Boolean record);
[Java]
pxcmStatus SetFileName(string file, boolean record);

Parameters
file

The full path of the file to playback or to be


recorded.

record

If true, set the recording mode. Otherwise, set


the playback mode.

Description
The SetFileName function sets mode for file playback or recording.
For file playback, the SDK immediately creates the Capture instance (using the
QueryCapture function), so that the application can query the capabilities of the
recorded content.
Return Status
STATUS_NO_ERROR

The function returned successfully.

2.11.5.3.14 SetFrameByIndex

Namespace Hierarchy
[C++]
PXCCaptureManager::SetFrameByIndex
[C#]
PXCMCaptureManager.SetFrameByIndex
[Java]
PXCMCaptureManager.SetFrameByIndex

Syntax
[C++]
pxcStatus SetFrameByIndex(pxcI32 index);

146

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C#]
pxcmStatus SetFrameByIndex(Int32 index);
[Java]
pxcmStatus SetFrameByIndex(int index);

Parameters
index

The zero-based frame index.

Description
The SetFrameByIndex function sets the playback position to be the beginning of the
specified frame.
Return Status
STATUS_NO_ERROR

The function returned successfully.

2.11.5.3.15 SetFrameByTimeStamp

Namespace Hierarchy
[C++]
PXCCaptureManager::SetFrameByTimeStamp
[C#]
PXCMCaptureManager.SetFrameByTimeStamp
[Java]
PXCMCaptureManager.SetFrameByTimeStamp

Syntax
[C++]
pxcStatus SetFrameByTimeStamp(pxcI64 ts);
[C#]
pxcmStatus SetFrameByTimeStamp(Int64 ts);
[Java]
pxcmStatus SetFrameByTimeStamp(long ts);

Parameters

147

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

ts

The time stamp, in 100 ns.

Description
The SetFrameByTimeStamp function sets the file playback position to be closest to
the specified time stamp.
2.11.5.3.16 SetMask

Namespace Hierarchy
[C++]
PXCCaptureManager::SetMask
[C#]
PXCMCaptureManager.SetMask
[Java]
PXCMCaptureManager.SetMask

Syntax
[C++]
pxcStatus SetMask(StreamType streams);
[C#]
pxcmStatus SetMask(StreamType streams);
[Java]
pxcmStatus SetMask(StreamType streams);

Parameters
streams

The stream selector. See StreamType for


definitions.

Description
The SetMask function selects certain video streams during recording.
The function does not affect playback.
Return Status

148

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

STATUS_NO_ERROR

The function returned successfully.

2.11.5.3.17 SetPause

Namespace Hierarchy
[C++]
PXCCaptureManager::SetPause
[C#]
PXCMCaptureManager.SetPause
[Java]
PXCMCaptureManager.SetPause

Syntax
[C++]
pxcStatus SetPause(pxcBool pause);
[C#]
pxcmStatus SetPause(Boolean pause);
[Java]
pxcmStatus SetPause(boolean pause);

Parameters
pause

If true, pause playback or recording. Otherwise,


resume playback or recording.

Description
The SetPause function pauses or resumes playback or recording.
If playback is paused, the application will get the same frame at the current playback
position.
If recording is paused, no frame will be written to the disk.
Return Status
STATUS_NO_ERROR

149

Intel RealSense SDK 2016 R2 Reference Manual

The function returned successfully.

2010-2016 Intel Corporation

2.11.5.3.18 SetRealtime

Namespace Hierarchy
[C++]
PXCCaptureManager::SetRealtime
[C#]
PXCMCaptureManager.SetRealtime
[Java]
PXCMCaptureManager.SetRealtime

Syntax
[C++]
pxcStatus SetRealtime(pxcBool realtime);
[C#]
pxcmStatus SetRealtime(Boolean realtime);
[Java]
pxcmStatus SetRealtime(Boolean realtime);

Parameters
realtime

A boolean value to indicate the real time


playback mode.

Description
The SetRealtime function sets the real time playback mode.
In the real time playback mode, the application retrieves the frames in the same time
span as they are recorded to the disk. If the real time mode is not set, the application
retrieves the frames as fast as possible from the disk.
The default mode is realtime=true. This means that the capture module will deliver
the samples at an interval that is related to their presentation time.
Although the real time mode is good for visually checking if recording is done right,
playing back a file in the real time mode is not repeatable, depending largely on the
current system workload. If repeatability is needed, use realtime=false.
Return Status

150

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

STATUS_NO_ERROR

The function returned successfully.

2.11.5.4 Properties

The PXCMCaptureManager interface provides the following properties:


Property

Description

capture (C#,JS)

Return the PXCMCapture instance.

device (C#,JS,UWP)

Return the Device instance.

2.11.5.4.1 capture (C#,JS)

Namespace Hierarchy
[C#]
PXCMCaptureManager.capture
[JavaScript]
intel.realsense.CaptureManager.capture

Syntax
[C#]
PXCMCapture capture {
get;
}
[JavaScript]
Data Type

{
capture

Capture

Description
The capture property returns the Capture instance.
Remarks
[C#]

The C# application can also use the function QueryCapture.

151

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.5.4.2 device (C#,JS,UWP)

Namespace Hierarchy
[C#]
PXCMCaptureManager.device
[JavaScript]
intel.realsense.CaptureManager.device
[C#/UWP]
Intel.RealSense.CaptureManager.device

Syntax
[C#]
Device device {
get;
}
[JavaScript]
Data Type

{
device

Device

}
[C#/UWP]
Device Device {
get;
}

Description
The device property returns the Device instance.
Remarks
[C#]

The C# application can also use the function QueryDevice.

2.11.6 Device (+JS,+UWP)


Namespace Hierarchy
[C++]
PXCCapture::Device
[C#]
152

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

PXCMCapture.Device
[Java]
PXCMCapture.Device
[JavaScript]
intel.realsense.Device
[C#/UWP]
Intel.RealSense.Device

Description
The Device interface provides member functions to enumerate capture video device
stream information and create an instance of a video stream.
You can use the QueryDevice function (or the device property) retrieve an instance
of the Device interface.
See Also
Constants
Member Functions: Device Neutral
Member Functions: F200 Functions
Member Functions: SR300 Functions
Member Functions: R200 Functions
Properties
Static Functions
2.11.6.1 Constants

The Device interface exposes the following constants:


Constant

Description

CUID

The interface identifier

PROPERTY_VALUE_INVALID

The value to indicate an error in the device property value.

2.11.6.2 Member Functions: Device Neutral

The Device interface exposes the following device neutral member functions:
General Functions

153

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Member Functions

Description

QueryDeviceInfo

Get the device information.

QueryStreamProfileSetNum

Get the number of unique configurations.

QueryStreamProfileSet

Get the unique configuration for selected streams.

IsStreamProfileSetValid (+UWP)

Validate if the configuration is valid.

SetStreamProfileSet

Set the active configuration for all streams.

ReadStreamsAsync

Read stream samples asynchronously.

ReadStreams

Read stream samples synchronously.

CreateProjection

Create a Projection instance.

Device Property Control


Member Functions

Description

ResetProperties (+JS)

Reset device properties to factory defaults.

RestorePropertiesUponFocus (+JS)

Restore device properties upon receiving


window focus.

Device Property Access


Member Functions

Description

QueryColorBackLightCompensationInfo Access to the back light compensation mode.


QueryColorBackLightCompensation
SetColorBackLightCompensation

154

QueryColorBrightnessInfo
QueryColorBrightness
SetColorBrightness

Access to the color brightness value.

QueryColorContrastInfo
QueryColorContrast
SetColorContrast

Access to the color contrast value.

QueryColorExposureInfo
QueryColorExposure
SetColorExposure
QueryColorAutoExposure
SetColorAutoExposure

Access to the color exposure value and mode.

QueryColorHueInfo
QueryColorHue
SetColorHue

Access to the color hue value.

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

QueryColorGainInfo
QueryColorGain
SetColorGain

Access to the color gain value.

QueryColorGammaInfo
QueryColorGamma
SetColorGain

Access to the color gamma value.

QueryColorPowerLineFrequencyDefault Access to the power line frequency value.


Value
QueryColorPowerLineFrequency
QueryColorAutoPowerLineFrequency
SetColorPowerLineFrequency
SetColorAutoPowerLineFrequency

155

QueryColorSaturationInfo
QueryColorSaturation
SetColorSaturation

Access to the color saturation value.

QueryColorSharpnessInfo
QueryColorSharpness
SetColorSharpness

Access to the color sharpness value.

QueryColorWhiteBalanceInfo
QueryColorWhiteBalance
SetColorWhiteBalance
QueryColorAutoWhiteBalance
SetColorAutoWhiteBalance

Access to the color white balance value.

QueryColorFieldOfView
QueryDepthFieldOfView

Get the sensor field of view parameters.

QueryColorFocalLength
QueryColorFocalLengthMM
QueryDepthFocalLength
QueryDepthFocalLengthMM

Get the sensor focal length parameters.

QueryColorPrincipalPoint
QueryDepthPrincipalPoint

Get the sensor principal point parameters.

QueryDepthSensorRange

Get the sensor range parameters.

QueryDepthConfidenceThresholdInfo
QueryDepthConfidenceThreshold
SetDepthConfidenceThreshold

Access to the depth confidence threshold value.

QueryDeviceAllowProfileChange
SetDeviceAllowProfileChange

Access to the resolution change mode.

QueryMirrorMode
SetMirrorMode

Access to the mirrored mode.

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

QueryDepthUnit
SetDepthUnit

Get/set the native depth precision.

QueryDepthLowConfidenceValue

Get/set the special values for low confidence


pixels.

2.11.6.2.1 CreateProjection

Namespace Hierarchy
[C++]
PXCCapture::Device::CreateProjection
[C#]
PXCMCapture.Device.CreateProjection
[Java]
PXCMCapture.Device.CreateProjection

Syntax
[C++]
PXCProjection* CreateProjection(void);
[C#]
PXCMProjection CreateProjection();
[Java]
PXCMProjection CreateProjection();

Parameters
None
Description
The CreateProjection function returns the Projection instance, which maps
coordinates between color and depth images.
Projection requires an active streaming configuration. Use this function after the
Init function of the SenseManager interface (or the SetStreamProfileSet function
if you use the Capture interface directly.)
Return Status

156

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The Projection instance, or NULL/null if the interface is not available.

157

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.2.2 IsStreamProfileSetValid (+UWP)

Namespace Hierarchy
[C++]
PXCCapture::Device::IsStreamProfileSetValid
[C#]
PXCMCapture.Device.IsStreamProfileSetValid
[Java]
PXCMCapture.Device.IsStreamProfileSetValid
[C#/UWP]
Intel.RealSense.Device.IsStreamProfileSetValid

Syntax
[C++]
pxcBool IsStreamProfileSetValid(StreamProfileSet* profiles);
[C#]
Boolean IsStreamProfileSetValid(StreamProfileSet profiles);
[Java]
boolean IsStreamProfileSetValid(StreamProfileSet profiles);
[C#/UWP]
Boolean IsStreamProfileSetValid(IReadOnlyDictionary<StreamType,
PerceptionVideoProfile> profiles);

Parameters
profiles

The stream configuration parameters, to be validated.

Description
The IsStreamProfileSetValid function validates the stream configuration
parameters and returns true if the device accepts the configuration parameters.
Return Status

158

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

true

The device is able to stream with the specified


parameters.

false

The device is unable to accept the


configuration parameters.

2.11.6.2.3 QueryColorAutoExposure

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryColorAutoExposure
[C#]
PXCMCapture.Device.QueryColorAutoExposure
[Java]
PXCMCapture.Device.QueryColorAutoExposure

Syntax
[C++]
pxcBool QueryColorAutoExposure(void);
[C#]
Boolean QueryColorAutoExposure();
[Java]
boolean QueryColorAutoExposure();
[JavaScript]
N/A
[C#/UWP]
N/A

Parameters
None

Description
The QueryColorAutoExposure function returns the color exposure auto mode.
Return Status

159

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The color exposure auto mode.

160

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.2.4 QueryColorAutoPowerLineFrequency

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryColorAutoPowerLineFrequency
[C#]
PXCMCapture.Device.QueryColorAutoPowerLineFrequency
[Java]
PXCMCapture.Device.QueryColorAutoPowerLineFrequency

Syntax
[C++]
pxcBool QueryColorAutoPowerLineFrequency(void);
[C#]
Boolean QueryColorAutoPowerLineFrequency();
[Java]
boolean QueryColorAutoPowerLineFrequency();

Parameters
None

Description
The QueryColorAutoPowerLineFrequency function returns the power line
frequency auto mode.
Return Status
The power line frequency auto mode.

161

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.2.5 QueryColorAutoWhiteBalance

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryColorAutoWhiteBalance
[C#]
PXCMCapture.Device.QueryColorAutoWhiteBalance
[Java]
PXCMCapture.Device.QueryColorAutoWhiteBalance

Syntax
[C++]
pxcBool QueryColorAutoWhiteBalance(void);
[C#]
Boolean QueryColorAutoWhiteBalance();
[Java]
boolean QueryColorAutoWhiteBalance();

Parameters
None

Description
The QueryColorAutoWhiteBalance function returns the color white balance auto
mode.
Return Status
The color white balance auto mode.

162

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.2.6 QueryColorBackLightCompensation

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryColorBackLightCompensation
[C#]
PXCMCapture.Device.QueryColorBackLightCompensation
[Java]
PXCMCapture.Device.QueryColorBackLightCompensation

Syntax
[C++]
pxcI32 QueryColorBackLightCompensation(void);
[C#]
pxcI32 QueryColorBackLightCompensation();
[Java]
pxcI32 QueryColorBackLightCompensation();

Parameters
None

Description
The QueryColorBackLightCompensation function returns the status of back ground
light compensation.
Return Status
Non-zero if back light compensation is enabled, zero if it is disabled, or
PROPERTY_VALUE_INVALID if there is any error in retrieving the value.

163

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.2.7 QueryColorBackLightCompensationInfo

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryColorBackLightCompensationInfo
[C#]
PXCMCapture.Device.QueryColorBackLightCompensationInfo
[Java]
PXCMCapture.Device.QueryColorBackLightCompensationInfo

Syntax
[C++]
PropertyInfo QueryColorBackLightCompensationInfo(void);
[C#]
PropertyInfo QueryColorBackLightCompensationInfo();
[Java]
PropertyInfo QueryColorBackLightCompensationInfo();

Parameters
None

Description
The QueryColorBackLightCompensationInfo function returns the property value
range and other useful information. See the PropertyInfo structure for details.
Return Status
The PropertyInfo structure instance. If any error, the structure is filled with
PROPERTY_VALUE_INVALID.

164

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.2.8 QueryColorBrightness

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryColorBrightness
[C#]
PXCMCapture.Device.QueryColorBrightness
[Java]
PXCMCapture.Device.QueryColorBrightness

Syntax
[C++]
pxcI32 QueryColorBrightness(void);
[C#]
Int32 QueryColorBrightness();
[Java]
int QueryColorBrightness();

Parameters
None

Description
The QueryColorBrightness function returns the color brightness value, from 10,000 (pure black) to 10,000 (pure white).
Return Status
The color brightness value, or PROPERTY_VALUE_INVALID if there is any error in
retrieving the value.

165

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.2.9 QueryColorBrightnessInfo

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryColorBrightnessInfo
[C#]
PXCMCapture.Device.QueryColorBrightnessInfo
[Java]
PXCMCapture.Device.QueryColorBrightnessInfo

Syntax
[C++]
PropertyInfo QueryColorBrightnessInfo(void);
[C#]
PropertyInfo QueryColorBrightnessInfo();
[Java]
PropertyInfo QueryColorBrightnessInfo();

Parameters
None

Description
The QueryColorBrightnessInfo function returns the property value range and
other useful information. See the PropertyInfo structure for details.
Return Status
The PropertyInfo structure instance. If any error, the structure is filled with
PROPERTY_VALUE_INVALID.

166

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.2.10 QueryColorContrast

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryColorContrast
[C#]
PXCMCapture.Device.QueryColorContrast
[Java]
PXCMCapture.Device.QueryColorContrast

Syntax
[C++]
pxcI32 QueryColorContrast(void);
[C#]
Int32 QueryColorContrast();
[Java]
int QueryColorContrast();

Parameters
None

Description
The QueryColorContrast function returns the color contrast value, from 0 (lowest
contrast) to 10,000 (highest contrast).
Return Status
The color contrast value, or PROPERTY_VALUE_INVALID if there is any error in
retrieving the value.

167

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.2.11 QueryColorContrastInfo

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryColorContrastInfo
[C#]
PXCMCapture.Device.QueryColorContrastInfo
[Java]
PXCMCapture.Device.QueryColorContrastInfo

Syntax
[C++]
PropertyInfo QueryColorContrastInfo(void);
[C#]
PropertyInfo QueryColorContrastInfo();
[Java]
PropertyInfo QueryColorContrastInfo();

Parameters
None

Description
The QueryColorContrastInfo function returns the property value range and other
useful information. See the PropertyInfo structure for details.
Return Status
The PropertyInfo structure instance. If any error, the structure is filled with
PROPERTY_VALUE_INVALID.

168

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.2.12 QueryColorExposure

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryColorExposure
[C#]
PXCMCapture.Device.QueryColorExposure
[Java]
PXCMCapture.Device.QueryColorExposure

Syntax
[C++]
pxcI32 QueryColorExposure(void);
[C#]
Int32 QueryColorExposure();
[Java]
int QueryColorExposure();

Parameters
None

Description
The QueryColorExposure function returns the color exposure value, in log base 2
seconds.
Return Status
The color exposure value, or PROPERTY_VALUE_INVALID if there is any error in
retrieving the value.

169

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.2.13 QueryColorExposureInfo

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryColorExposureInfo
[C#]
PXCMCapture.Device.QueryColorExposureInfo
[Java]
PXCMCapture.Device.QueryColorExposureInfo

Syntax
[C++]
PropertyInfo QueryColorExposureInfo(void);
[C#]
PropertyInfo QueryColorExposureInfo();
[Java]
PropertyInfo QueryColorExposureInfo();

Parameters
None

Description
The QueryColorExposureInfo function returns the property value range and other
useful information. See the PropertyInfo structure for details.
Return Status
The PropertyInfo structure instance. If any error, the structure is filled with
PROPERTY_VALUE_INVALID.

170

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.2.14 QueryColorHue

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryColorHue
[C#]
PXCMCapture.Device.QueryColorHue
[Java]
PXCMCapture.Device.QueryColorHue

Syntax
[C++]
pxcI32 QueryColorHue(void);
[C#]
Int32 QueryColorHue();
[Java]
int QueryColorHue();

Parameters
None

Description
The QueryColorHue function returns the color hue value, from -18,000 to 18,000
(representing -180 to 180 degrees.)
Return Status
The color hue value, or PROPERTY_VALUE_INVALID if there is any error in retrieving
the value.

171

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.2.15 QueryColorHueInfo

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryColorHueInfo
[C#]
PXCMCapture.Device.QueryColorHueInfo
[Java]
PXCMCapture.Device.QueryColorHueInfo

Syntax
[C++]
PropertyInfo QueryColorHueInfo(void);
[C#]
PropertyInfo QueryColorHueInfo();
[Java]
PropertyInfo QueryColorHueInfo();

Parameters
None

Description
The QueryColorHueInfo function returns the property value range and other useful
information. See the PropertyInfo structure for details.
Return Status
The PropertyInfo structure instance. If any error, the structure is filled with
PROPERTY_VALUE_INVALID.

172

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.2.16 QueryColorFieldOfView

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryColorFieldOfView
[C#]
PXCMCapture.Device.QueryColorFieldOfView
[Java]
PXCMCapture.Device.QueryColorFieldOfView

Syntax
[C++]
PXCPointF32 QueryColorFieldOfView(void);
[C#]
PXCMPointF32 QueryColorFieldOfView();
[Java]
PXCMPointF32 QueryColorFieldOfView();

Parameters
None

Description
The QueryColorFieldOfView function returns the color sensor field of view, in
degrees, horizontally and vertically.
The property value is the model fixed value, and not the device instance calibrated
value.
Return Status
The color sensor field of view in degrees. If any error, the structure is filled with
PROPERTY_VALUE_INVALID.

173

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.2.17 QueryColorFocalLength

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryColorFocalLength
[C#]
PXCMCapture.Device.QueryColorFocalLength
[Java]
PXCMCapture.Device.QueryColorFocalLength

Syntax
[C++]
PXCPointF32 QueryColorFocalLength(void);
[C#]
PXCMPointF32 QueryColorFocalLength();
[Java]
PXCMPointF32 QueryColorFocalLength();

Parameters
None

Description
The QueryColorFocalLength function returns the color sensor focal length, in pixels,
along the horizontal and virtual axises. The parameters vary with the color stream
resolution setting.
The property value is the model fixed value, and not the device instance calibrated
value.
Return Status
The color sensor focal length, in pixels. If any error, the structure is filled with
PROPERTY_VALUE_INVALID.

174

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.2.18 QueryColorFocalLengthMM

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryColorFocalLengthMM
[C#]
PXCMCapture.Device.QueryColorFocalLengthMM
[Java]
PXCMCapture.Device.QueryColorFocalLengthMM

Syntax
[C++]
pxcF32 QueryColorFocalLengthMM(void);
[C#]
Single QueryColorFocalLengthMM();
[Java]
float QueryColorFocalLengthMM();

Parameters
None

Description
The QueryColorFocalLengthMM function returns the color sensor focal length, in
millimeters.
The property value is the model fixed value, and not the device instance calibrated
value.
Return Status
The color sensor focal length, in millimeters.
Remarks
This property is not supported by camera model R200.

175

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.2.19 QueryColorGain

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryColorGain
[C#]
PXCMCapture.Device.QueryColorGain
[Java]
PXCMCapture.Device.QueryColorGain

Syntax
[C++]
pxcI32 QueryColorGain(void);
[C#]
Int32 QueryColorGain();
[Java]
int QueryColorGain();

Parameters
None

Description
The QueryColorGain function returns the color gain value, with negative values
darker, positive values brighter, and zero as normal.
Return Status
The color gain value, or PROPERTY_VALUE_INVALID if there is any error in retrieving
the value.

176

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.2.20 QueryColorGainInfo

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryColorGainInfo
[C#]
PXCMCapture.Device.QueryColorGainInfo
[Java]
PXCMCapture.Device.QueryColorGainInfo

Syntax
[C++]
PropertyInfo QueryColorGainInfo(void);
[C#]
PropertyInfo QueryColorGainInfo();
[Java]
PropertyInfo QueryColorGainInfo();

Parameters
None

Description
The QueryColorGainInfo function returns the property value range and other useful
information. See the PropertyInfo structure for details.
Return Status
The PropertyInfo structure instance. If any error, the structure is filled with
PROPERTY_VALUE_INVALID.

177

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.2.21 QueryColorGamma

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryColorGamma
[C#]
PXCMCapture.Device.QueryColorGamma
[Java]
PXCMCapture.Device.QueryColorGamma

Syntax
[C++]
pxcI32 QueryColorGamma(void);
[C#]
Int32 QueryColorGamma();
[Java]
int QueryColorGamma();

Parameters
None

Description
The QueryColorGamma function returns the color gamma value, from 1 to 500.
Return Status
The color gamma value, or PROPERTY_VALUE_INVALID if there is any error in
retrieving the value.

178

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.2.22 QueryColorGammaInfo

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryColorGammaInfo
[C#]
PXCMCapture.Device.QueryColorGammaInfo
[Java]
PXCMCapture.Device.QueryColorGammaInfo

Syntax
[C++]
PropertyInfo QueryColorGammaInfo(void);
[C#]
PropertyInfo QueryColorGammaInfo();
[Java]
PropertyInfo QueryColorGammaInfo();

Parameters
None

Description
The QueryColorGammaInfo function returns the property value range and other
useful information. See the PropertyInfo structure for details.
Return Status
The PropertyInfo structure instance. If any error, the structure is filled with
PROPERTY_VALUE_INVALID.

179

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.2.23 QueryColorPowerLineFrequency

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryColorPowerLineFrequency
[C#]
PXCMCapture.Device.QueryColorPowerLineFrequency
[Java]
PXCMCapture.Device.QueryColorPowerLineFrequency

Syntax
[C++]
PowerLineFrequency QueryColorPowerLineFrequency(void);
[C#]
PowerLineFrequency QueryColorPowerLineFrequency();
[Java]
PowerLineFrequency QueryColorPowerLineFrequency();

Parameters
None

Description
The QueryColorPowerLineFrequency function returns the power line frequency
value, in Hz.
Return Status
The power line frequency value, as defined in the PowerLineFrequency
enumerator.

180

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.2.24 QueryColorPowerLineFrequencyDefaultValue

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryColorPowerLineFrequencyDefaultValue
[C#]
PXCMCapture.Device.QueryColorPowerLineFrequencyDefaultValue
[Java]
PXCMCapture.Device.QueryColorPowerLineFrequencyDefaultValue

Syntax
[C++]
PowerLineFrequency QueryColorPowerLineFrequencyDefaultValue(void);
[C#]
PowerLineFrequency QueryColorPowerLineFrequencyDefaultValue();
[Java]
PowerLineFrequency QueryColorPowerLineFrequencyDefaultValue();

Parameters
None

Description
The QueryColorPowerLineFrequencyDefaultValue function returns the default
value of the power line frequency setting.
Return Status
The power line frequency value, as defined in the PowerLineFrequency
enumerator.

181

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.2.25 QueryColorPrincipalPoint

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryColorPrincipalPoint
[C#]
PXCMCapture.Device.QueryColorPrincipalPoint
[Java]
PXCMCapture.Device.QueryColorPrincipalPoint

Syntax
[C++]
PXCPointF32 QueryColorPrincipalPoint(void);
[C#]
PXCMPointF32 QueryColorPrincipalPoint();
[Java]
PXCMPointF32 QueryColorPrincipalPoint();

Parameters
None

Description
The QueryColorPrincipalPoint function returns the color sensor principal point, in
pixels, horizontally and vertically. The parameters vary with the color stream
resolution setting.
The property value is the model fixed value, and not the device instance calibrated
value.
Return Status
The color sensor principal point in pixels. If any error, the structure is filled with
PROPERTY_VALUE_INVALID.

182

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.2.26 QueryColorSaturation

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryColorSaturation
[C#]
PXCMCapture.Device.QueryColorSaturation
[Java]
PXCMCapture.Device.QueryColorSaturation

Syntax
[C++]
pxcI32 QueryColorSaturation(void);
[C#]
Int32 QueryColorSaturation();
[Java]
int QueryColorSaturation();

Parameters
None

Description
The QueryColorSaturation function returns the color saturation value, from 0 to
10,000.
Return Status
The color saturation value, or PROPERTY_VALUE_INVALID if there is any error in
retrieving the value.

183

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.2.27 QueryColorSaturationInfo

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryColorSaturationInfo
[C#]
PXCMCapture.Device.QueryColorSaturationInfo
[Java]
PXCMCapture.Device.QueryColorSaturationInfo

Syntax
[C++]
PropertyInfo QueryColorSaturationInfo(void);
[C#]
PropertyInfo QueryColorSaturationInfo();
[Java]
PropertyInfo QueryColorSaturationInfo();

Parameters
None

Description
The QueryColorSaturationInfo function returns the property value range and
other useful information. See the PropertyInfo structure for details.
Return Status
The PropertyInfo structure instance. If any error, the structure is filled with
PROPERTY_VALUE_INVALID.

184

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.2.28 QueryColorSharpness

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryColorSharpness
[C#]
PXCMCapture.Device.QueryColorSharpness
[Java]
PXCMCapture.Device.QueryColorSharpness

Syntax
[C++]
pxcI32 QueryColorSharpness(void);
[C#]
Int32 QueryColorSharpness();
[Java]
int QueryColorSharpness();

Parameters
None

Description
The QueryColorSharpness function returns the color sharpness value, from 0
(lowest sharpness) to 100 (highest sharpness).
Return Status
The color sharpness value, or PROPERTY_VALUE_INVALID if there is any error in
retrieving the value.

185

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.2.29 QueryColorSharpnessInfo

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryColorSharpnessInfo
[C#]
PXCMCapture.Device.QueryColorSharpnessInfo
[Java]
PXCMCapture.Device.QueryColorSharpnessInfo

Syntax
[C++]
PropertyInfo QueryColorSharpnessInfo(void);
[C#]
PropertyInfo QueryColorSharpnessInfo();
[Java]
PropertyInfo QueryColorSharpnessInfo();

Parameters
None

Description
The QueryColorSharpnessInfo function returns the property value range and other
useful information. See the PropertyInfo structure for details.
Return Status
The PropertyInfo structure instance. If any error, the structure is filled with
PROPERTY_VALUE_INVALID.

186

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.2.30 QueryColorWhiteBalance

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryColorWhiteBalance
[C#]
PXCMCapture.Device.QueryColorWhiteBalance
[Java]
PXCMCapture.Device.QueryColorWhiteBalance

Syntax
[C++]
pxcI32 QueryColorWhiteBalance(void);
[C#]
Int32 QueryColorWhiteBalance();
[Java]
int QueryColorWhiteBalance();

Parameters
None

Description
The QueryColorWhiteBalance function returns the color white balance value, as the
color temperature in degrees Kevin.
Return Status
The color white balance value, or PROPERTY_VALUE_INVALID if there is any error in
retrieving the value.

187

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.2.31 QueryColorWhiteBalanceInfo

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryColorWhiteBalanceInfo
[C#]
PXCMCapture.Device.QueryColorWhiteBalanceInfo
[Java]
PXCMCapture.Device.QueryColorWhiteBalanceInfo

Syntax
[C++]
PropertyInfo QueryColorWhiteBalanceInfo(void);
[C#]
PropertyInfo QueryColorWhiteBalanceInfo();
[Java]
PropertyInfo QueryColorWhiteBalanceInfo();

Parameters
None

Description
The QueryColorWhiteBalanceInfo function returns the property value range and
other useful information. See the PropertyInfo structure for details.
Return Status
The PropertyInfo structure instance. If any error, the structure is filled with
PROPERTY_VALUE_INVALID.

188

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.2.32 QueryDepthConfidenceThreshold

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryDepthConfidenceThreshold
[C#]
PXCMCapture.Device.QueryDepthConfidenceThreshold
[Java]
PXCMCapture.Device.QueryDepthConfidenceThreshold

Syntax
[C++]
pxcI16 QueryDepthConfidenceThreshold(void);
[C#]
Int16 QueryDepthConfidenceThreshold();
[Java]
short QueryDepthConfidenceThreshold();

Parameters
None

Description
The QueryDepthConfidenceThreshold function returns the depth stream
confidence threshold value. Any depth pixels whose confidence score below this
threshold will be set to the low confidence pixel value, retrievable via the
QueryDepthLowConfidenceValue function.
Return Status
The depth stream confidence threshold value, or PROPERTY_VALUE_INVALID if there
is any error in retrieving the value.

189

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.2.33 QueryDepthConfidenceThresholdInfo

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryDepthConfidenceThresholdInfo
[C#]
PXCMCapture.Device.QueryDepthConfidenceThresholdInfo
[Java]
PXCMCapture.Device.QueryDepthConfidenceThresholdInfo

Syntax
[C++]
PropertyInfo QueryDepthConfidenceThresholdInfo(void);
[C#]
PropertyInfo QueryDepthConfidenceThresholdInfo();
[Java]
PropertyInfo QueryDepthConfidenceThresholdInfo();

Parameters
None

Description
The QueryDepthConfidenceThresholdInfo function returns the property value
range and other useful information. See the PropertyInfo structure for details.
Return Status
The PropertyInfo structure instance. If any error, the structure is filled with
PROPERTY_VALUE_INVALID.

190

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.2.34 QueryDepthFieldOfView

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryDepthFieldOfView
[C#]
PXCMCapture.Device.QueryDepthFieldOfView
[Java]
PXCMCapture.Device.QueryDepthFieldOfView

Syntax
[C++]
PXCPointF32 QueryDepthFieldOfView(void);
[C#]
PXCMPointF32 QueryDepthFieldOfView();
[Java]
PXCMPointF32 QueryDepthFieldOfView();

Parameters
None

Description
The QueryDepthFieldOfView function returns the depth sensor field of view, in
degrees, horizontally and vertically.
The property value is the model fixed value, and not the device instance calibrated
value.
Return Status
The depth sensor field of view in degrees. If any error, the structure is filled with
PROPERTY_VALUE_INVALID.

191

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.2.35 QueryDepthFocalLength

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryDepthFocalLength
[C#]
PXCMCapture.Device.QueryDepthFocalLength
[Java]
PXCMCapture.Device.QueryDepthFocalLength

Syntax
[C++]
PXCPointF32

QueryDepthFocalLength(void);

[C#]
PXCMPointF32 QueryDepthFocalLength();
[Java]
PXCMPointF32 QueryDepthFocalLength();

Parameters
None

Description
The QueryDepthFocalLength function returns the depth sensor focal length, in
pixels, along the horizontal and virtual axises. The parameters vary with the depth
stream resolution setting.
The property value is the model fixed value, and not the device instance calibrated
value.
Return Status
The depth sensor focal length, in pixels. If any error, the structure is filled with
PROPERTY_VALUE_INVALID.

192

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.2.36 QueryDepthFocalLengthMM

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryDepthFocalLengthMM
[C#]
PXCMCapture.Device.QueryDepthFocalLengthMM
[Java]
PXCMCapture.Device.QueryDepthFocalLengthMM

Syntax
[C++]
pxcF32 QueryDepthFocalLengthMM(void);
[C#]
Single QueryDepthFocalLengthMM();
[Java]
float QueryDepthFocalLengthMM();

Parameters
None

Description
The QueryDepthFocalLengthMM function returns the depth sensor focal length, in
millimeters.
The property value is the model fixed value, and not the device instance calibrated
value.
Return Status
The depth sensor focal length, in millimeters, or PROPERTY_VALUE_INVALID if there
is any error in retrieving the value.
Remarks
This property is not supported by camera model R200.

193

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.2.37 QueryDepthLowConfidenceValue

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryDepthLowConfidenceValue
[C#]
PXCMCapture.Device.QueryDepthLowConfidenceValue
[Java]
PXCMCapture.Device.QueryDepthLowConfidenceValue

Syntax
[C++]
pxcU16 QueryDepthLowConfidenceValue(void);
[C#]
UInt16 QueryDepthLowConfidenceValue();
[Java]
short QueryDepthLowConfidenceValue();

Parameters
None

Description
The QueryDepthLowConfidenceValue function returns the special depth value for
low-confidence depth pixels. Any low-confidence depth pixels are set to this special
value during the thresholding process. The following cases may result in lowconfidence depth pixels:
Objects are too close to the camera.
Objects are too far away from the camera.
Objects have low infrared reflectivity.
Return Status
The special depth value for low-confidence depth pixels, or
PROPERTY_VALUE_INVALID if there is any error in retrieving the value.

194

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.2.38 QueryDepthPrincipalPoint

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryDepthPrincipalPoint
[C#]
PXCMCapture.Device.QueryDepthPrincipalPoint
[Java]
PXCMCapture.Device.QueryDepthPrincipalPoint

Syntax
[C++]
PXCPointF32 QueryDepthPrincipalPoint(void);
[C#]
PXCMPointF32 QueryDepthPrincipalPoint();
[Java]
PXCMPointF32 QueryDepthPrincipalPoint();

Parameters
None

Description
The QueryDepthPrincipalPoint function returns the depth sensor principal point,
in pixels, horizontally and vertically. The parameters vary with the depth stream
resolution setting.
The property value is the model fixed value, and not the device instance calibrated
value.
Return Status
The depth sensor principal point in pixels. If any error, the structure is filled with
PROPERTY_VALUE_INVALID.

195

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.2.39 QueryDepthSensorRange

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryDepthSensorRange
[C#]
PXCMCapture.Device.QueryDepthSensorRange
[Java]
PXCMCapture.Device.QueryDepthSensorRange

Syntax
[C++]
PXCRangeF32 QueryDepthSensorRange(void);
[C#]
PXCMRangeF32 QueryDepthSensorRange();
[Java]
PXCMRangeF32 QueryDepthSensorRange();

Parameters
None

Description
The QueryDepthSensorRange function returns the depth sensor sensing distance, in
mm.
The property value is the model fixed value, and not the device instance calibrated
value.
Return Status
The depth sensor sensing distance values. If any error, the structure is filled with
PROPERTY_VALUE_INVALID.
Remarks
This property is not supported by camera model R200.

196

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.2.40 QueryDeviceAllowProfileChange

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryDeviceAllowProfileChange
[C#]
PXCMCapture.Device.QueryDeviceAllowProfileChange
[Java]
PXCMCapture.Device.QueryDeviceAllowProfileChange

Syntax
[C++]
pxcBool QueryDeviceAllowProfileChange(void);
[C#]
Boolean QueryDeviceAllowProfileChange();
[Java]
boolean QueryDeviceAllowProfileChange();

Parameters
None

Description
The QueryDeviceAllowProfileChange function returns the status whether the
capture device exposes any resolution change events. If true, the capture device
permits stream resolution change. Otherwise, the capture device will forbid any
resolution change (in the multiple application access scenario.)
Return Status
The resolution change notification status.

197

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.2.41 QueryDeviceInfo

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryDeviceInfo
[C#]
PXCMCapture.Device.QueryDeviceInfo
[Java]
PXCMCapture.Device.QueryDeviceInfo

Syntax
[C++]
void QueryDeviceInfo(DeviceInfo *dinfo);
[C#]
void QueryDeviceInfo(out DeviceInfo dinfo);
[Java]
void QueryDeviceInfo(DeviceInfo dinfo);

Parameters
dinfo

The capture device information to be returned.

Description
The QueryDeviceInfo function returns the capture device information.
Return Status
None

Remarks
C#

The C# application can also use the property deviceInfo.

2.11.6.2.42 QueryDepthUnit

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryDepthUnit

198

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C#]
PXCMCapture.Device.QueryDepthUnit
[Java]
PXCMCapture.Device.QueryDepthUnit

Syntax
[C++]
pxcF32 QueryDepthUnit(void);
[C#]
Single QueryDeviceInfo();
[Java]
float QueryDeviceInfo();

Parameters
None

Description
The QueryDepthUnit function returns the precision, in micrometers or m, of native
depth pixels.
Return Status
The native depth pixel precision in micrometers or m, or
PROPERTY_VALUE_INVALID if there is any error in retrieving the value.
2.11.6.2.43 QueryMirrorMode

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryMirrorMode
[C#]
PXCMCapture.Device.QueryMirrorMode
[Java]
PXCMCapture.Device.QueryMirrorMode

Syntax

199

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C++]
MirrorMode QueryMirrorMode(void);
[C#]
MirrorMode QueryMirrorMode();
[Java]
MirrorMode QueryMirrorMode();

Parameters
None

Description
The QueryMirrorMode function returns the orientation of the camera images of the
Intel RealSense Camera.
Return Status
The orientation of the camera images, as defined in the MirrorMode enumerator.

200

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.2.44 QueryStreamProfileSet

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryStreamProfileSet
[C#]
PXCMCapture.Device.QueryStreamProfileSet
[Java]
PXCMCapture.Device.QueryStreamProfileSet

Syntax
[C++]
pxcStatus QueryStreamProfileSet(StreamType scope, pxcI32 pidx,
StreamProfileSet* profiles);
pxcStatus QueryStreamProfileSet(StreamProfileSet* profiles);
[C#]
pxcmStatus QueryStreamProfileSet(StreamType scope, Int32 pidx, out
StreamProfileSet profiles);
pxcmStatus QueryStreamProfileSet(out StreamProfileSet profiles);
[Java]
pxcmStatus QueryStreamProfileSet(StreamType scope, int pidx,
StreamProfileSet profiles);
pxcmStatus QueryStreamProfileSet(StreamProfileSet profiles);

Parameters
scope

The bit-OR'ed value of all interested streams.

pidx

The zero-based index to retrieve all available configurations.

profiles

The configuration parameters, to be returned.

Description

201

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The QueryStreamProfileSet function returns the unique configuration parameters


for the selected streams.
If multiple configurations are available, the application calls this function multiple
times with an increasing pidx value to retrieve all configurations.
If multiple streams are selected, they may have internal dependencies that limit
certain configuration combination. For example, a depth stream may have two
configurations: 320x240 and 640x480, and an IR stream also has two configurations:
320x240 and 640x480. If the application must stream both streams, the
configurations must match the resolution of the two streams. Thus there are only two
unique configurations: 320x240 (depth and IR) and 640x480 (depth and IR). The
function returns the unique configurations for the selected streams.
If scope and pidx are omitted, the function returns the current working configuration
parameters.
Return Status
STATUS_NO_ERROR

The function was successful.

STATUS_ITEM_UNAVAILABLE

There is no more configuration parameters.

2.11.6.2.45 QueryStreamProfileSetNum

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryStreamProfileSetNum
[C#]
PXCMCapture.Device.QueryStreamProfileSetNum
[Java]
PXCMCapture.Device.QueryStreamProfileSetNum

Syntax
[C++]
pxcI32 QueryStreamProfileSetNum(StreamType scope);
[C#]
Int32 QueryStreamProfileSetNum(StreamType scope);
[Java]
int QueryStreamProfileSetNum(StreamType scope);

202

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Parameters
scope

The bit-OR'ed value of all interested streams.

Description
The QueryStreamProfileSetNum function returns the number of unique
configurations for the selected streams.
Return Status

The number of unique configurations.


2.11.6.2.46 ReadStreams

Namespace Hierarchy
[C++]
PXCCapture::Device::ReadStreams
[C#]
PXCMCapture.Device.ReadStreams
[Java]
PXCMCapture.Device.ReadStreams

Syntax
[C++]
pxcStatus ReadStreams(StreamType scope, Sample *sample);
[C#]
pxcmStatus ReadStreams(StreamType scope, Sample sample);
[Java]
pxcmStatus ReadStreams(StreamType scope, Sample sample);

Parameters
scope

The bit-OR'ed value of streams to be requested.

sample

The sample structure to return the sample images.

Description
203

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The ReadStreams function reads one or multiple streams (specified by the scope
parameter) from the capture device.
In the case of reading multiple streams, the function synchronizes the stream reads
and delivers the data together. You must configure the streams to have the same
frame rate. Otherwise, the function returns STATUS_PARAM_UNSUPPORTED.
Use single stream read or multiple-stream synchronized read. The behavior is not
defined if you mix the two modes.
This function is a synchronous function. The function blocks until all sample data are
available. After use, the application must release the images, by using the
ReleaseImages function.
Return Status
STATUS_NO_ERROR

The function returned successfully.

STATUS_TIME_GAP

There is a time stamp gap in delivering the


video sequences.

STATUS_PARAM_UNSUPPORTED

The device does not support streaming the


specified streams synchronously.

2.11.6.2.47 ReadStreamsAsync

Namespace Hierarchy
[C++]
PXCCapture::Device::ReadStreamsAsync
[C#]
PXCMCapture.Device.ReadStreamsAsync
[Java]
PXCMCapture.Device.ReadStreamsAsync

Syntax
[C++]
pxcStatus ReadStreamsAsync(StreamType scope, Sample *sample, PXCSyncPoint
**sp);
pxcStatus ReadStreamsAsync(Sample *sample, PXCSyncPoint **sp);
[C#]
pxcmStatus ReadStreamsAsync(StreamType scope, Sample sample, out
PXCMSyncPoint sp);

204

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

pxcmStatus ReadStreamsAsync(Sample sample, out PXCMSyncPoint sp);


[Java]
pxcmStatus ReadStreamsAsync(StreamType scope, Sample sample,
PXCMSyncPoint sp);
pxcmStatus ReadStreamsAsync(Sample sample, PXCMSyncPoint sp);

Parameters
scope

The bit-OR'ed value of streams to be requested.

sample

The sample structure to return the sample images.

sp

The SP to be returned.

Description
The ReadStreamsAsync function reads one or multiple streams (specified by the
scope parameter) from the capture device.
In the case of reading multiple streams, the function synchronizes the stream reads
and delivers the data together. You must configure the streams to have the same
frame rate. Otherwise, the function returns STATUS_PARAM_UNSUPPORTED.
Use single stream read or multiple-stream synchronized read. The behavior is not
defined if you mix the two modes.
This function is an asynchronous function. The function returns immediately after
allocating the image resources. The sample data may not be ready at this time. The
application must synchronize the SP before accessing the captured images. After use,
the application must release the images, by using the ReleaseImages function.
Return Status

205

STATUS_NO_ERROR

The function returned successfully.

STATUS_TIME_GAP

There is a time stamp gap in delivering the


video sequences.

STATUS_PARAM_UNSUPPORTED

The device does not support streaming the


specified streams synchronously.

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.2.48 ResetProperties (+JS)

Namespace Hierarchy
[C++]
PXCCapture::Device::ResetProperties
[C#]
PXCMCapture.Device.ResetProperties
[Java]
PXCMCapture.Device.ResetProperties
[JavaScript]
intel.realsense.Device.ResetProperties

Syntax
[C++]
void ResetProperties(StreamType streams);
[C#]
void ResetProperties(StreamType streams);
[Java]
void ResetProperties(StreamType streams);
[JavaScript]
function resetProperties(streams);

Parameters
streams

The bit-OR'ed value of streams to be requested.

Description
The ResetProperties function resets the device properties of the specified streams
to their factory default values.
If streams=STREAM_TYPE_ANY, the function resets all available streams.
Return Status
None

206

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.2.49 RestorePropertiesUponFocus (+JS)

Namespace Hierarchy
[C++]
PXCCapture::Device::RestorePropertiesUponFocus
[C#]
PXCMCapture.Device.RestorePropertiesUponFocus
[Java]
PXCMCapture.Device.RestorePropertiesUponFocus
[JavaScript]
intel.realsense.Device.RestorePropertiesUponFocus

Syntax
[C++]
void RestorePropertiesUponFocus(void);
[C#]
void RestorePropertiesUponFocus();
[Java]
void RestorePropertiesUponFocus();
[JavaScript]
function restorePropertiesUponFocus();

Parameters
None

Description
The RestorePropertiesUponFocus function restores the device properties to the
values that the application set previously.
When multiple SDK applications running on the same system, these applications may
set different device properties thus impact each other in experience. The guideline is
that when an application receives the windows focus, the application should
immediately call the RestorePropertiesUponFocus function to restore any device
properties that the application previously set. The function keeps a record of all
device properties changes internally.
See Coexisting with Other Applications for more details.

207

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Return Status
None

2.11.6.2.50 SetColorAutoExposure

Namespace Hierarchy
[C++]
PXCCapture::Device::SetColorAutoExposure
[C#]
PXCMCapture.Device.SetColorAutoExposure
[Java]
PXCMCapture.Device.SetColorAutoExposure

Syntax
[C++]
pxcStatus SetColorAutoExposure(pxcBool auto);
[C#]
pxcmStatus SetColorAutoExposure(Boolean auto);
[Java]
pxcmStatus SetColorAutoExposure(boolean auto);

Parameters
auto

The boolean value to set the auto exposure


mode.

Description
The SetColorAutoExposure function sets the auto exposure mode.
Return Status

208

STATUS_NO_ERROR

The function was successful.

STATUS_ITEM_UNAVAILABLE

The device does not support this feature.

STATUS_DEVICE_FAILED

The device failed to set the value.

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.2.51 SetColorAutoWhiteBalance

Namespace Hierarchy
[C++]
PXCCapture::Device::SetColorAutoWhiteBalance
[C#]
PXCMCapture.Device.SetColorAutoWhiteBalance
[Java]
PXCMCapture.Device.SetColorAutoWhiteBalance

Syntax
[C++]
pxcStatus SetColorAutoWhiteBalance(pxcBool auto);
[C#]
pxcmStatus SetColorAutoWhiteBalance(Boolean auto);
[Java]
pxcmStatus SetColorAutoWhiteBalance(boolean auto);

Parameters
auto

The boolean value to set the auto white


balance mode.

Description
The SetColorAutoWhiteBalance function sets the auto white balance mode.
Return Status
STATUS_NO_ERROR

The function was successful.

STATUS_ITEM_UNAVAILABLE

The device does not support this feature.

STATUS_DEVICE_FAILED

The device failed to set the value.

2.11.6.2.52 SetColorAutoPowerLineFrequency

Namespace Hierarchy
[C++]
PXCCapture::Device::SetColorAutoPowerLineFrequency
209

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C#]
PXCMCapture.Device.SetColorAutoPowerLineFrequency
[Java]
PXCMCapture.Device.SetColorAutoPowerLineFrequency

Syntax
[C++]
pxcStatus SetColorAutoPowerLineFrequency(pxcBool auto);
[C#]
pxcmStatus SetColorAutoPowerLineFrequency(Boolean auto);
[Java]
pxcmStatus SetColorAutoPowerLineFrequency(boolean auto);

Parameters
auto

The boolean value to set the auto power line


frequency mode.

Description
The SetColorAutoPowerLineFrequency function sets the auto power line frequency
mode.
Return Status
STATUS_NO_ERROR

The function was successful.

STATUS_ITEM_UNAVAILABLE

The device does not support this feature.

STATUS_DEVICE_FAILED

The device failed to set the value.

2.11.6.2.53 SetColorBackLightCompensation

Namespace Hierarchy
[C++]
PXCCapture::Device::SetColorBackLightCompensation
[C#]
PXCMCapture.Device.SetColorBackLightCompensation
[Java]
210

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

PXCMCapture.Device.SetColorBackLightCompensation

Syntax
[C++]
pxcStatus SetColorBackLightCompensation(pxcI32 enable);
[C#]
pxcmStatus SetColorBackLightCompensation(Int32 enable);
[Java]
pxcmStatus SetColorBackLightCompensation(int enable);

Parameters
enable

Zero to disable back light compensation, and non-zero to


turn it on.

Description
The SetColorBackLightCompensation function enables/disables the color stream
back light compensation.
Return Status
STATUS_NO_ERROR

The function was successful.

STATUS_ITEM_UNAVAILABLE

The device does not support this feature.

STATUS_DEVICE_FAILED

The device failed to set the value.

2.11.6.2.54 SetColorBrightness

Namespace Hierarchy
[C++]
PXCCapture::Device::SetColorBrightness
[C#]
PXCMCapture.Device.SetColorBrightness
[Java]
PXCMCapture.Device.SetColorBrightness

Syntax

211

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C++]
pxcStatus SetColorBrightness(pxcI32 brightness);
[C#]
pxcmStatus SetColorBrightness(Int32 brightness);
[Java]
pxcmStatus SetColorBrightness(int brightness);

Parameters
brightness

The color brightness value.

Description
The SetColorBrightness function sets the color brightness value, from -10,000
(pure black) to 10,000 (pure white).
Return Status
STATUS_NO_ERROR

The function was successful.

STATUS_ITEM_UNAVAILABLE

The device does not support this feature.

STATUS_DEVICE_FAILED

The device failed to set the value.

2.11.6.2.55 SetColorContrast

Namespace Hierarchy
[C++]
PXCCapture::Device::SetColorContrast
[C#]
PXCMCapture.Device.SetColorContrast
[Java]
PXCMCapture.Device.SetColorContrast

Syntax
[C++]
pxcStatus SetColorContrast(pxcI32 contrast);
[C#]
pxcmStatus SetColorContrast(Int32 contrast);

212

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[Java]
pxcmStatus SetColorContrast(int contrast);

Parameters
contrast

The color contrast value.

Description
The SetColorContrast function sets the color contrast value, from 0 (lowest
contrast) to 10,000 (highest contrast).
Return Status
STATUS_NO_ERROR

The function was successful.

STATUS_ITEM_UNAVAILABLE

The device does not support this feature.

STATUS_DEVICE_FAILED

The device failed to set the value.

2.11.6.2.56 SetColorExposure

Namespace Hierarchy
[C++]
PXCCapture::Device::SetColorExposure
[C#]
PXCMCapture.Device.SetColorExposure
[Java]
PXCMCapture.Device.SetColorExposure

Syntax
[C++]
pxcStatus SetColorExposure(pxcI32 exposure);
[C#]
pxcmStatus SetColorExposure(Int32 exposure);
[Java]
pxcmStatus SetColorExposure(int exposure);

Parameters

213

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

exposure

The color exposure value.

Description
The SetColorExposure function sets the color exposure value, in log base 2 seconds.
Return Status
STATUS_NO_ERROR

The function was successful.

STATUS_ITEM_UNAVAILABLE

The device does not support this feature.

STATUS_DEVICE_FAILED

The device failed to set the value.

2.11.6.2.57 SetColorHue

Namespace Hierarchy
[C++]
PXCCapture::Device::SetColorHue
[C#]
PXCMCapture.Device.SetColorHue
[Java]
PXCMCapture.Device.SetColorHue

Syntax
[C++]
pxcStatus SetColorHue(pxcI32 hue);
[C#]
pxcmStatus SetColorHue(Int32 hue);
[Java]
pxcmStatus SetColorHue(int hue);

Parameters
hue

The color hue value.

Description

214

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The SetColorHue function sets the color hue value, from -18,000 to 18,000
(representing -180 to 180 degrees.)
Return Status
STATUS_NO_ERROR

The function was successful.

STATUS_ITEM_UNAVAILABLE

The device does not support this feature.

STATUS_DEVICE_FAILED

The device failed to set the value.

2.11.6.2.58 SetColorGamma

Namespace Hierarchy
[C++]
PXCCapture::Device::SetColorGamma
[C#]
PXCMCapture.Device.SetColorGamma
[Java]
PXCMCapture.Device.SetColorGamma

Syntax
[C++]
pxcStatus SetColorGamma(pxcI32 gamma);
[C#]
pxcmStatus SetColorGamma(Int32 gamma);
[Java]
pxcmStatus SetColorGamma(int gamma);

Parameters
gamma

The color gamma value.

Description
The SetColorGamma function sets the color gamma value, from 1 to 500.
Return Status

215

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

STATUS_NO_ERROR

The function was successful.

STATUS_ITEM_UNAVAILABLE

The device does not support this feature.

STATUS_DEVICE_FAILED

The device failed to set the value.

2.11.6.2.59 SetColorGain

Namespace Hierarchy
[C++]
PXCCapture::Device::SetColorGain
[C#]
PXCMCapture.Device.SetColorGain
[Java]
PXCMCapture.Device.SetColorGain

Syntax
[C++]
pxcStatus SetColorGain(pxcI32 gain);
[C#]
pxcmStatus SetColorGain(Int32 gain);
[Java]
pxcmStatus SetColorGain(int gain);

Parameters
gain

The color gain value.

Description
The SetColorGain function sets the color gain value, with negative values darker,
positive values brighter, and zero as normal.
Return Status

216

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

STATUS_NO_ERROR

The function was successful.

STATUS_ITEM_UNAVAILABLE

The device does not support this feature.

STATUS_DEVICE_FAILED

The device failed to set the value.

2.11.6.2.60 SetColorPowerLineFrequency

Namespace Hierarchy
[C++]
PXCCapture::Device::SetColorPowerLineFrequency
[C#]
PXCMCapture.Device.SetColorPowerLineFrequency
[Java]
PXCMCapture.Device.SetColorPowerLineFrequency

Syntax
[C++]
pxcStatus SetColorPowerLineFrequency(PowerLineFrequency freq);
[C#]
pxcmStatus SetColorPowerLineFrequency(PowerLineFrequency freq);
[Java]
pxcmStatus SetColorPowerLineFrequency(PowerLineFrequency freq);

Parameters
freq

The power line frequency as defined in the


PowerLineFrequency enumerator.

Description
The SetColorPowerLineFrequency function sets the property of the power line
frequency compensation value.
Return Status

217

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

STATUS_NO_ERROR

The function was successful.

STATUS_ITEM_UNAVAILABLE

The device does not support this feature.

STATUS_DEVICE_FAILED

The device failed to set the value.

2.11.6.2.61 SetColorSaturation

Namespace Hierarchy
[C++]
PXCCapture::Device::SetColorSaturation
[C#]
PXCMCapture.Device.SetColorSaturation
[Java]
PXCMCapture.Device.SetColorSaturation

Syntax
[C++]
pxcStatus SetColorSaturation(pxcI32 saturation);
[C#]
pxcmStatus SetColorSaturation(Int32 saturation);
[Java]
pxcmStatus SetColorSaturation(int saturation);

Parameters
saturation

The color saturation value.

Description
The SetColorSaturation function sets the color saturation value, from 0 to 10,000.
Return Status

218

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

STATUS_NO_ERROR

The function was successful.

STATUS_ITEM_UNAVAILABLE

The device does not support this feature.

STATUS_DEVICE_FAILED

The device failed to set the value.

2.11.6.2.62 SetColorSharpness

Namespace Hierarchy
[C++]
PXCCapture::Device::SetColorSharpness
[C#]
PXCMCapture.Device.SetColorSharpness
[Java]
PXCMCapture.Device.SetColorSharpness

Syntax
[C++]
pxcStatus SetColorSharpness(pxcI32 sharpness);
[C#]
pxcmStatus SetColorSharpness(Int32 sharpness);
[Java]
pxcmStatus SetColorSharpness(int sharpness);

Parameters
sharpness

The color sharpness value.

Description
This function sets the color sharpness value, from 0 (lowest sharpness) to 100
(highest sharpness).
Return Status

219

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

STATUS_NO_ERROR

The function was successful.

STATUS_ITEM_UNAVAILABLE

The device does not support this feature.

STATUS_DEVICE_FAILED

The device failed to set the value.

2.11.6.2.63 SetColorWhiteBalance

Namespace Hierarchy
[C++]
PXCCapture::Device::SetColorWhiteBalance
[C#]
PXCMCapture.Device.SetColorWhiteBalance
[Java]
PXCMCapture.Device.SetColorWhiteBalance

Syntax
[C++]
pxcStatus SetColorWhiteBalance(pxcI32 balance);
[C#]
pxcmStatus SetColorWhiteBalance(Int32 balance);
[Java]
pxcmStatus SetColorWhiteBalance(int balance);

Parameters
balance

The color balance value.

Description
The SetColorWhiteBalance function sets the color white balance value, as the color
temperature in degrees Kevin.
Return Status

220

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

STATUS_NO_ERROR

The function was successful.

STATUS_ITEM_UNAVAILABLE

The device does not support this feature.

STATUS_DEVICE_FAILED

The device failed to set the value.

2.11.6.2.64 SetDepthConfidenceThreshold

Namespace Hierarchy
[C++]
PXCCapture::Device::SetDepthConfidenceThreshold
[C#]
PXCMCapture.Device.SetDepthConfidenceThreshold
[Java]
PXCMCapture.Device.SetDepthConfidenceThreshold

Syntax
[C++]
pxcStatus SetDepthConfidenceThreshold(pxcI16 threshold);
[C#]
pxcmStatus SetDepthConfidenceThreshold(Int16 threshold);
[Java]
pxcmStatus SetDepthConfidenceThreshold(short threshold);

Parameters
threshold

The threshold value.

Description
The SetDepthConfidenceThreshold function sets the depth stream confidence
threshold value. Any depth pixels whose confidence score below this threshold will
be set to the low confidence pixel value, retrievable via the
QueryDepthLowConfidenceValue function.
Not supported by camera model R200.
Return Status

221

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

STATUS_NO_ERROR

The function was successful.

STATUS_ITEM_UNAVAILABLE

The device does not support this feature.

STATUS_DEVICE_FAILED

The device failed to set the value.

2.11.6.2.65 SetDepthUnit

Namespace Hierarchy
[C++]
PXCCapture::Device::SetDepthUnit
[C#]
PXCMCapture.Device.SetDepthUnit
[Java]
PXCMCapture.Device.SetDepthUnit

Syntax
[C++]
pxcStatus SetDepthUnit(pxcF32 value);
[C#]
pxcmStatus SetDepthUnit(Single value);
[Java]
pxcmStatus SetDepthUnit(float value);

Parameters
value

The depth unit in micrometre.

Description
The SetDepthUnit function sets the depth unit value, in micrometre.
Return Status

222

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

STATUS_NO_ERROR

The function was successful.

STATUS_ITEM_UNAVAILABLE

The device does not support this feature.

STATUS_DEVICE_FAILED

The device failed to set the value.

2.11.6.2.66 SetDeviceAllowProfileChange

Namespace Hierarchy
[C++]
PXCCapture::Device::SetDeviceAllowProfileChange
[C#]
PXCMCapture.Device.SetDeviceAllowProfileChange
[Java]
PXCMCapture.Device.SetDeviceAllowProfileChange

Syntax
[C++]
pxcStatus SetDeviceAllowProfileChange(pxcBool enable);
[C#]
pxcmStatus SetDeviceAllowProfileChange(Boolean enable);
[Java]
pxcmStatus SetDeviceAllowProfileChange(boolean enable);

Parameters
enable

The boolean value to enable/disable resolution change.

Description
The SetDeviceAllowProfileChange function enables/disables any resolution
change in the multiple access scenarios. If enabled, the capture device returns
STATUS_STREAM_CONFIG_CHANGED. If disabled, the capture device prohibits
any resolution change during streaming.

Return Status

223

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

STATUS_NO_ERROR

The function was successful.

STATUS_ITEM_UNAVAILABLE

The device does not support this feature.

STATUS_DEVICE_FAILED

The device failed to set the value.

2.11.6.2.67 SetMirrorMode

Namespace Hierarchy
[C++]
PXCCapture::Device::SetMirrorMode
[C#]
PXCMCapture.Device.SetMirrorMode
[Java]
PXCMCapture.Device.SetMirrorMode

Syntax
[C++]
pxcStatus SetMirrorMode(MirrorMode mode);
[C#]
pxcmStatus SetMirrorMode(MirrorMode mode);
[Java]
pxcmStatus SetMirrorMode(MirrorMode mode);

Parameters
mode

The image orientation mode, as in the MirrorMode


enumerator.

Description
The SetMirrorMode function sets the orientation of the camera images of the Intel
RealSense Camera.
Return Status

224

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

STATUS_NO_ERROR

The function was successful.

STATUS_ITEM_UNAVAILABLE

The device does not support this feature.

STATUS_DEVICE_FAILED

The device failed to set the value.

2.11.6.2.68 SetStreamProfileSet

Namespace Hierarchy
[C++]
PXCCapture::Device::SetStreamProfileSet
[C#]
PXCMCapture.Device.SetStreamProfileSet
[Java]
PXCMCapture.Device.SetStreamProfileSet

Syntax
[C++]
pxcStatus SetStreamProfileSet(StreamProfileSet* profiles);
[C#]
pxcmStatus SetStreamProfileSet(StreamProfileSet profiles);
[Java]
pxcmStatus SetStreamProfileSet(StreamProfileSet profiles);

Parameters
profiles

The configuration parameters of all streams to be streamed.

Description
The SetStreamProfileSet function configures the streams parameters. All streams
must be configured. The device streaming starts after a successful configuration.
If the device supports configuration change, a second call to the function stops the
previous streaming and starts the new configuration. If the device does not support
configuration change, the second call to the function returns an error.
Return Status

225

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

STATUS_NO_ERROR

The function was successful.

2.11.6.3 Member Functions: F200 & SR300 Functions

The Device interface exposes the following member functions specific to Intel RealSense
camera, model F200:
Device Property Access
Member Functions

Description

QueryIVCAMAccuracyDefaultValue
QueryIVCAMAccuracy
SetIVCAMAccuracy

Access to the projected pattern mode.

QueryIVCAMLaserPowerInfo
QueryIVCAMLaserPower
SetIVCAMLaserPower

Access to the laser power level.

QueryIVCAMFilterOptionInfo
QueryIVCAMFilterOption
SetIVCAMFilterOption

Access to the filter option.

QueryIVCAMMotionRangeTradeOffInfo
QueryIVCAMMotionRangeTradeOff
SetIVCAMMotionRangeTradeOff

Access to the motion vs. range trade off option.

See Also
Member Functions: SR300 Functions
2.11.6.3.1 QueryIVCAMAccuracy

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryIVCAMAccuracy
[C#]
PXCMCapture.Device.QueryIVCAMAccuracy
[Java]
PXCMCapture.Device.QueryIVCAMAccuracy

Syntax
[C++]
IVCAMAccuracy QueryIVCAMAccuracy(void);
[C#]

226

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

IVCAMAccuracy QueryIVCAMAccuracy();
[Java]
IVCAMAccuracy QueryIVCAMAccuracy();

Parameters
None

Description
The QueryIVCAMAccuracy function returns the projected pattern setting.
Return Status
The projected pattern setting, as defined in the IVCAMAccuracy enumerator.

227

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.3.2 QueryIVCAMAccuracyDefaultValue

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryIVCAMAccuracyDefaultValue
[C#]
PXCMCapture.Device.QueryIVCAMAccuracyDefaultValue
[Java]
PXCMCapture.Device.QueryIVCAMAccuracyDefaultValue

Syntax
[C++]
IVCAMAccuracy QueryIVCAMAccuracyDefaultValue(void);
[C#]
IVCAMAccuracy QueryIVCAMAccuracyDefaultValue();
[Java]
IVCAMAccuracy QueryIVCAMAccuracyDefaultValue();

Parameters
None

Description
The QueryIVCAMAccuracyDefaultValue function returns the default value of the
projected pattern setting.
Return Status
The projected pattern setting, as defined in the IVCAMAccuracy enumerator.

228

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.3.3 QueryIVCAMFilterOption

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryIVCAMFilterOption
[C#]
PXCMCapture.Device.QueryIVCAMFilterOption
[Java]
PXCMCapture.Device.QueryIVCAMFilterOption

Syntax
[C++]
pxcI32 QueryIVCAMFilterOption(void);
[C#]
Int32 QueryIVCAMFilterOption();
[Java]
int QueryIVCAMFilterOption();

Parameters
None

Description
The QueryIVCAMFilterOption function returns the smoothing aggressiveness
parameter of the Intel RealSense Camera. See Table 1 for the value definitions.
Return Status
The filter option value, or PROPERTY_VALUE_INVALID if there is any error in
retrieving the value.
Remarks

229

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

V
al
u
e
0

Name

Description

Skeleton

Raw

Raw +
Gradients
filter
Very
close
range
Close
range

Reports the depth data for high fidelity (high confidence) pixels only,
and all other pixels as invalid. For SR300, the depth range is up to 4m.
Raw depth image without any post-processing filters. For SR300, the
depth range is up to 4m.
Raw depth image with the gradient filter applied. For SR300, the depth
range is up to 4m.

Midrange
[Default]
Far range

Very far
range

Very low smoothing effect with high sharpness, accuracy levels, and low
noise artifacts. Good for any distances of up to 350mm for F200, and up
to 2m for SR300.
Low smoothing effect with high sharpness and accuracy levels. The
noise artifacts are optimized for distances between 350mm to 550mm
for F200, and up to 2m for SR300.
Moderate smoothing effect optimized for distances between 550mm to
850mm for F200 and up to 2m for SR300 to balance between good
sharpness level, high accuracy and moderate noise artifacts.
High smoothing effect for distances between 850mm to 1000mm for
F200 and up to 4m for SR300 bringing good accuracy with moderate
sharpness level.
Very high smoothing effect to bring moderate accuracy level for
distances above 1m for F200, and 0.8-2.5m (up to 4m) for SR300. Use
together with the MotionRangeTradeOff property to increase the
depth range.
Table 1: The Filter Option Table

230

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.3.4 QueryIVCAMFilterOptionInfo

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryIVCAMFilterOptionInfo
[C#]
PXCMCapture.Device.QueryIVCAMFilterOptionInfo
[Java]
PXCMCapture.Device.QueryIVCAMFilterOptionInfo

Syntax
[C++]
PropertyInfo QueryIVCAMFilterOptionInfo(void);
[C#]
PropertyInfo QueryIVCAMFilterOptionInfo();
[Java]
PropertyInfo QueryIVCAMFilterOptionInfo();

Parameters
None

Description
The QueryIVCAMFilterOptionInfo function returns the property value range and
other useful information. See the PropertyInfo structure for details.
Return Status
The PropertyInfo structure instance. If any error, the structure is filled with
PROPERTY_VALUE_INVALID.

231

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.3.5 QueryIVCAMLaserPower

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryIVCAMLaserPower
[C#]
PXCMCapture.Device.QueryIVCAMLaserPower
[Java]
PXCMCapture.Device.QueryIVCAMLaserPower

Syntax
[C++]
pxcI32 QueryIVCAMLaserPower(void);
[C#]
Int32 QueryIVCAMLaserPower();
[Java]
int QueryIVCAMLaserPower();

Parameters
None

Description
The QueryIVCAMLaserPower function returns the laser power level from 0 (lowest) to
16 (highest) of the camera device.
Return Status
The laser power level, or PROPERTY_VALUE_INVALID if there is any error in retrieving
the value.

232

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.3.6 QueryIVCAMLaserPowerInfo

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryIVCAMLaserPowerInfo
[C#]
PXCMCapture.Device.QueryIVCAMLaserPowerInfo
[Java]
PXCMCapture.Device.QueryIVCAMLaserPowerInfo

Syntax
[C++]
PropertyInfo QueryIVCAMLaserPowerInfo(void);
[C#]
PropertyInfo QueryIVCAMLaserPowerInfo();
[Java]
PropertyInfo QueryIVCAMLaserPowerInfo();

Parameters
None

Description
The QueryIVCAMLaserPowerInfo function returns the property value range and
other useful information. See the PropertyInfo structure for details.
Return Status
The PropertyInfo structure instance. If any error, the structure is filled with
PROPERTY_VALUE_INVALID.

233

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.3.7 QueryIVCAMMotionRangeTradeOff

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryIVCAMMotionRangeTradeOff
[C#]
PXCMCapture.Device.QueryIVCAMMotionRangeTradeOff
[Java]
PXCMCapture.Device.QueryIVCAMMotionRangeTradeOff

Syntax
[C++]
pxcI32 QueryIVCAMMotionRangeTradeOff(void);
[C#]
Int32 QueryIVCAMMotionRangeTradeOff();
[Java]
int QueryIVCAMMotionRangeTradeOff();

Parameters
None

Description
The QueryIVCAMMotionRangeTradeOff function returns the motion vs range trade
off option of the Intel RealSense Camera. The value is in the range of 0 (short
exposure, short range, and better motion) to 100 (long exposure and long range.)
Return Status
The option value, or PROPERTY_VALUE_INVALID if there is any error in retrieving the
value.

234

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.3.8 QueryIVCAMMotionRangeTradeOffInfo

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryIVCAMMotionRangeTradeOffInfo
[C#]
PXCMCapture.Device.QueryIVCAMMotionRangeTradeOffInfo
[Java]
PXCMCapture.Device.QueryIVCAMMotionRangeTradeOffInfo

Syntax
[C++]
PropertyInfo QueryIVCAMMotionRangeTradeOffInfo(void);
[C#]
PropertyInfo QueryIVCAMMotionRangeTradeOffInfo();
[Java]
PropertyInfo QueryIVCAMMotionRangeTradeOffInfo();

Parameters
None

Description
The QueryIVCAMMotionRangeTradeOffInfo function returns the property value
range and other useful information. See the PropertyInfo structure for details.
Return Status
The PropertyInfo structure instance. If any error, the structure is filled with
PROPERTY_VALUE_INVALID.

235

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.3.9 SetIVCAMAccuracy

Namespace Hierarchy
[C++]
PXCCapture::Device::SetIVCAMAccuracy
[C#]
PXCMCapture.Device.SetIVCAMAccuracy
[Java]
PXCMCapture.Device.SetIVCAMAccuracy

Syntax
[C++]
pxcStatus SetIVCAMAccuracy(IVCAMAccuracy accuracy);
[C#]
pxcmStatus SetIVCAMAccuracy(IVCAMAccuracy accuracy);
[Java]
pxcmStatus SetIVCAMAccuracy(IVCAMAccuracy accuracy);

Parameters
accuracy

The projected pattern value; see the IVCAMAccuracy


enumerator.

Description
The SetIVCAMAccuracy function sets the projected pattern setting.
Return Status
STATUS_NO_ERROR

The function was successful.

STATUS_ITEM_UNAVAILABLE

The device does not support this feature.

STATUS_DEVICE_FAILED

The device failed to set the value.

2.11.6.3.10 SetIVCAMFilterOption

Namespace Hierarchy
[C++]
PXCCapture::Device::SetIVCAMFilterOption
236

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C#]
PXCMCapture.Device.SetIVCAMFilterOption
[Java]
PXCMCapture.Device.SetIVCAMFilterOption

Syntax
[C++]
pxcStatus SetIVCAMFilterOption(pxcI32 option);
[C#]
pxcmStatus SetIVCAMFilterOption(Int32 option);
[Java]
pxcmStatus SetIVCAMFilterOption(int option);

Parameters
option

The filter option value.

Description
The SetIVCAMFilterOption function sets the smoothing aggressiveness parameter
of the Intel RealSense Camera. See Table 2 for the value definitions.
Return Status
STATUS_NO_ERROR

The function was successful.

STATUS_ITEM_UNAVAILABLE

The device does not support this feature.

STATUS_DEVICE_FAILED

The device failed to set the value.

Remarks

237

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

V
al
u
e
0

Name

Description

Skeleton

Raw

Raw +
Gradients
filter
Very
close
range
Close
range

Reports the depth data for high fidelity (high confidence) pixels only,
and all other pixels as invalid. For SR300, the depth range is up to 4m.
Raw depth image without any post-processing filters. For SR300, the
depth range is up to 4m.
Raw depth image with the gradient filter applied. For SR300, the depth
range is up to 4m.

Midrange
[Default]
Far range

Very far
range

Very low smoothing effect with high sharpness, accuracy levels, and low
noise artifacts. Good for any distances of up to 350mm for F200, and up
to 2m for SR300.
Low smoothing effect with high sharpness and accuracy levels. The
noise artifacts are optimized for distances between 350mm to 550mm
for F200, and up to 2m for SR300.
Moderate smoothing effect optimized for distances between 550mm to
850mm for F200 and up to 2m for SR300 to balance between good
sharpness level, high accuracy and moderate noise artifacts.
High smoothing effect for distances between 850mm to 1000mm for
F200 and up to 4m for SR300 bringing good accuracy with moderate
sharpness level.
Very high smoothing effect to bring moderate accuracy level for
distances above 1m for F200, and 0.8-2.5m (up to 4m) for SR300. Use
together with the MotionRangeTradeOff property to increase the
depth range.
Table 2: The Filter Option Table

2.11.6.3.11 SetIVCAMLaserPower

Namespace Hierarchy
[C++]
PXCCapture::Device::SetIVCAMLaserPower
[C#]
PXCMCapture.Device.SetIVCAMLaserPower
[Java]
PXCMCapture.Device.SetIVCAMLaserPower

Syntax
[C++]
pxcStatus SetIVCAMLaserPower(pxcI32 power);

238

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C#]
pxcmStatus SetIVCAMLaserPower(Int32 power);
[Java]
pxcmStatus SetIVCAMLaserPower(int power);
[JavaScript]
N/A
[C#/UWP]
N/A

Parameters
power

The laser power level.

Description
The SetIVCAMLaserPower function sets the laser power level from 0 (lowest) to 16
(highest) of the Intel RealSense Camera.
Return Status
STATUS_NO_ERROR

The function was successful.

STATUS_ITEM_UNAVAILABLE

The device does not support this feature.

STATUS_DEVICE_FAILED

The device failed to set the value.

2.11.6.3.12 SetIVCAMMotionRangeTradeOff

Namespace Hierarchy
[C++]
PXCCapture::Device::SetIVCAMMotionRangeTradeOff
[C#]
PXCMCapture.Device.SetIVCAMMotionRangeTradeOff
[Java]
PXCMCapture.Device.SetIVCAMMotionRangeTradeOff

Syntax
[C++]
pxcStatus SetIVCAMMotionRangeTradeOff(pxcI32 option);

239

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C#]
pxcmStatus SetIVCAMMotionRangeTradeOff(Int32 option);
[Java]
pxcmStatus SetIVCAMMotionRangeTradeOff(int option);

Parameters
option

The option value.

Description
The SetIVCAMMotionRangeTradeOff function sets the motion vs range trade off
option of the Intel RealSense Camera. The value is in the range of 0 (short exposure,
short range, and better motion) to 100 (long exposure and long range.)
Return Status
STATUS_NO_ERROR

The function was successful.

STATUS_ITEM_UNAVAILABLE

The device does not support this feature.

STATUS_DEVICE_FAILED

The device failed to set the value.

2.11.6.4 Member Functions: SR300 Functions

The Device interface exposes the following member functions specific to Intel RealSense
camera, model SR300:
Device Property Access
Member Functions

Description

QuerySR300ColorExposurePriority
Access to the color exposure priority setting.
QuerySR300ColorExposurePriorityInfo
SetSR300ColorExposurePriority

See Also
Member Functions: F200 & SR300 Functions
2.11.6.4.1 QuerySR300ColorExposurePriority

Namespace Hierarchy
[C++]
PXCCapture::Device::QuerySR300ColorExposurePriority
240

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C#]
PXCMCapture.Device.QuerySR300ColorExposurePriority
[Java]
PXCMCapture.Device.QuerySR300ColorExposurePriority

Syntax
[C++]
pxcI32 QuerySR300ColorExposurePriority(void);
[C#]
Int32 QuerySR300ColorExposurePriority();
[Java]
int QuerySR300ColorExposurePriority();

Parameters
None

Description
The QuerySR300ColorExposurePriority function returns the color exposure
priority setting, which specifies constraints on the exposure time control when
automatic exposure is turned on. If the value is zero, the color frame rate must remain
constant. If the value is 1, the color frame rate may vary.
Return Status
The priority setting value.

241

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.4.2 QuerySR300ColorExposurePriorityInfo

Namespace Hierarchy
[C++]
PXCCapture::Device::QuerySR300ColorExposurePriorityInfo
[C#]
PXCMCapture.Device.QuerySR300ColorExposurePriorityInfo
[Java]
PXCMCapture.Device.QuerySR300ColorExposurePriorityInfo

Syntax
[C++]
PropertyInfo QuerySR300ColorExposurePriorityInfo(void);
[C#]
PropertyInfo QuerySR300ColorExposurePriorityInfo();
[Java]
PropertyInfo QuerySR300ColorExposurePriorityInfo();

Parameters
None

Description
The QuerySR300ColorExposurePriorityInfo function returns the property value
range and other useful information. See the PropertyInfo structure for details.
Return Status
The PropertyInfo structure instance. If any error, the structure is filled with
PROPERTY_VALUE_INVALID.

242

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.4.3 SetSR300ColorExposurePriority

Namespace Hierarchy
[C++]
PXCCapture::Device::SetSR300ColorExposurePriority
[C#]
PXCMCapture.Device.SetSR300ColorExposurePriority
[Java]
PXCMCapture.Device.SetSR300ColorExposurePriority

Syntax
[C++]
pxcStatus SetSR300ColorExposurePriority(pxcI32 value);
[C#]
pxcmStatus SetSR300ColorExposurePriority(Int32 value);
[Java]
pxcmStatus SetSR300ColorExposurePriority(int value);

Parameters
value

The setting value.

Description
The SetSR300ColorExposurePriority function sets the color exposure priority
setting, which specifies constraints on the exposure time control when automatic
exposure is turned on. If the value is zero, the color frame rate must remain constant.
If the value is 1, the color frame rate may vary.
Return Status
STATUS_NO_ERROR

The function was successful.

STATUS_ITEM_UNAVAILABLE

The device does not support this feature.

STATUS_DEVICE_FAILED

The device failed to set the value.

2.11.6.5 Member Functions: R200 Functions

The Device interface exposes the following member functions specific to Intel RealSense
243

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

camera, model R200:


Device Property Access
Member Functions

Description

QueryDSLeftRightCropping
SetDSLeftRightCropping

Access to the left/right image cropping mode.

QueryDSLeftRightExposure
QueryDSLeftRightExposureInfo
SetDSLeftRightAutoExposure
SetDSLeftRightExposure

Access to the left/right stream exposure value.

QueryDSLeftRightGain
QueryDSLeftRightGainInfo
SetDSLeftRightGain

Access to the left/right stream gain adjustment.

QueryDSEmitterEnabled
SetDSEnableEmitter

Access to the infrared emitter mode.

QueryDSDisparityOutputEnabled
SetDSEnableDisparityOutput

Access to the disparity output mode.

QueryDSDisparityMultiplier
SetDSDisparityMultiplier

Access to the disparity scale factor.

QueryDSDisparityShift
SetDSDisparityShift

Access to the disparity shift value.

QueryDSMinMaxZ
SetDSMinMaxZ

Access to the distance value range.

QueryDSColorRectificationEnabled
QueryDSDepthRectificationEnabled

Get the color/depth rectification status.

2.11.6.5.1 QueryDSColorRectificationEnabled

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryDSColorRectificationEnabled
[C#]
PXCMCapture.Device.QueryDSColorRectificationEnabled
[Java]
PXCMCapture.Device.QueryDSColorRectificationEnabled

Syntax
[C++]
244

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

pxcBool QueryDSColorRectificationEnabled(void);
[C#]
Boolean QueryDSColorRectificationEnabled();
[Java]
boolean QueryDSColorRectificationEnabled();

Parameters
None

Description
The QueryDSColorRectificationEnabled function returns the color rectification
status.
Return Status
The color rectification status.

245

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.5.2 QueryDSDepthRectificationEnabled

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryDSDepthRectificationEnabled
[C#]
PXCMCapture.Device.QueryDSDepthRectificationEnabled
[Java]
PXCMCapture.Device.QueryDSDepthRectificationEnabled

Syntax
[C++]
pxcBool QueryDSDepthRectificationEnabled(void);
[C#]
Boolean QueryDSDepthRectificationEnabled();
[Java]
boolean QueryDSDepthRectificationEnabled();

Parameters
None

Description
The QueryDSDepthRectificationEnabled function returns the depth rectification
status.
Return Status
The depth rectification status.

246

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.5.3 QueryDSDisparityMultiplier

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryDSDisparityMultiplier
[C#]
PXCMCapture.Device.QueryDSDisparityMultiplier
[Java]
PXCMCapture.Device.QueryDSDisparityMultiplier

Syntax
[C++]
pxcI32 QueryDSDisparityMultiplier(void);
[C#]
Int32 QueryDSDisparityMultiplier();
[Java]
int QueryDSDisparityMultiplier();

Parameters
None

Description
The QueryDSDisparityMultiplier function returns the disparity output scale factor.
The default value is 32.
Return Status
The disparity output scale factor, or PROPERTY_VALUE_INVALID if there is any error
in retrieving the value.

247

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.5.4 QueryDSDisparityOutputEnabled

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryDSDisparityOutputEnabled
[C#]
PXCMCapture.Device.QueryDSDisparityOutputEnabled
[Java]
PXCMCapture.Device.QueryDSDisparityOutputEnabled

Syntax
[C++]
pxcBool QueryDSDisparityOutputEnabled(void);
[C#]
Boolean QueryDSDisparityOutputEnabled();
[Java]
boolean QueryDSDisparityOutputEnabled();

Parameters
None

Description
The QueryDSDisparityOutputEnabled function returns the disparity output mode.
If true, the output is the inverse distance. Otherwise, the output is the distance (Z).
Return Status
The disparity output mode.

248

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.5.5 QueryDSDisparityShift

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryDSDisparityShift
[C#]
PXCMCapture.Device.QueryDSDisparityShift
[Java]
PXCMCapture.Device.QueryDSDisparityShift

Syntax
[C++]
pxcI32 QueryDSDisparityShift(void);
[C#]
Int32 QueryDSDisparityShift();
[Java]
int QueryDSDisparityShift();

Parameters
None

Description
The QueryDSDisparityShift function returns the disparity shift value, in millimeters.
Both the minimum depth value and the maximum depth value are shifted to enhance
the resolution of depth values in between.
Return Status
The disparity shift value, or PROPERTY_VALUE_INVALID if there is any error in
retrieving the value.

249

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.5.6 QueryDSEmitterEnabled

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryDSEmitterEnabled
[C#]
PXCMCapture.Device.QueryDSEmitterEnabled
[Java]
PXCMCapture.Device.QueryDSEmitterEnabled

Syntax
[C++]
pxcBool QueryDSEmitterEnabled(void);
[C#]
Boolean QueryDSEmitterEnabled();
[Java]
boolean QueryDSEmitterEnabled();

Parameters
None

Description
The QueryDSEmitterEnabled function returns the infrared emitter status. If true, the
emitter is enabled.
Return Status
The emitter status.

250

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.5.7 QueryDSLeftRightCropping

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryDSLeftRightCropping
[C#]
PXCMCapture.Device.QueryDSLeftRightCropping
[Java]
PXCMCapture.Device.QueryDSLeftRightCropping

Syntax
[C++]
pxcBool QueryDSLeftRightCropping(void);
[C#]
Boolean QueryDSLeftRightCropping();
[Java]
boolean QueryDSLeftRightCropping();

Parameters
None

Description
The QueryDSLeftRightCropping function returns the cropping mode for the left/
right images. If true, the left and right images are cropped to match the depth image
resolution.
Return Status
The left/right image cropping mode.

251

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.5.8 QueryDSLeftRightExposure

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryDSLeftRightExposure
[C#]
PXCMCapture.Device.QueryDSLeftRightExposure
[Java]
PXCMCapture.Device.QueryDSLeftRightExposure

Syntax
[C++]
pxcI32 QueryDSLeftRightExposure(void);
[C#]
Int32 QueryDSLeftRightExposure();
[Java]
int QueryDSLeftRightExposure();

Parameters
None

Description
The QueryDSLeftRightExposure function the left and right stream exposure value, in
milliseconds.
Return Status
The left and right stream exposure value, or PROPERTY_VALUE_INVALID if there is
any error in retrieving the value.

252

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.5.9 QueryDSLeftRightExposureInfo

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryDSLeftRightExposureInfo
[C#]
PXCMCapture.Device.QueryDSLeftRightExposureInfo
[Java]
PXCMCapture.Device.QueryDSLeftRightExposureInfo

Syntax
[C++]
pxcI32 QueryDSLeftRightExposureInfo(void);
[C#]
Int32 QueryDSLeftRightExposureInfo();
[Java]
int QueryDSLeftRightExposureInfo();

Parameters
None

Description
The QueryDSLeftRightExposureInfo function returns the property value range and
other useful information. See the PropertyInfo structure for details.
Return Status
The PropertyInfo structure instance. If any error, the structure is filled with
PROPERTY_VALUE_INVALID.

253

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.5.10 QueryDSLeftRightGain

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryDSLeftRightGain
[C#]
PXCMCapture.Device.QueryDSLeftRightGain
[Java]
PXCMCapture.Device.QueryDSLeftRightGain

Syntax
[C++]
pxcI32 QueryDSLeftRightGain(void);
[C#]
Int32 QueryDSLeftRightGain();
[Java]
int QueryDSLeftRightGain();

Parameters
None

Description
The QueryDSLeftRightGain function returns the current depth stream gain
adjustment value, with negative values darker and positive value brighter, and zero as
normal.
Return Status
The gain value, or PROPERTY_VALUE_INVALID if there is any error in retrieving the
value.

254

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.5.11 QueryDSLeftRightGainInfo

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryDSLeftRightGainInfo
[C#]
PXCMCapture.Device.QueryDSLeftRightGainInfo
[Java]
PXCMCapture.Device.QueryDSLeftRightGainInfo

Syntax
[C++]
pxcI32 QueryDSLeftRightGainInfo(void);
[C#]
Int32 QueryDSLeftRightGainInfo();
[Java]
int QueryDSLeftRightGainInfo();

Parameters
None

Description
The QueryDSLeftRightGainInfo function returns the gain value range and other
useful information. See the PropertyInfo structure for details.
Return Status
The PropertyInfo structure instance. If any error, the structure is filled with
PROPERTY_VALUE_INVALID.

255

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.5.12 QueryDSMinMaxZ

Namespace Hierarchy
[C++]
PXCCapture::Device::QueryDSMinMaxZ
[C#]
PXCMCapture.Device.QueryDSMinMaxZ
[Java]
PXCMCapture.Device.QueryDSMinMaxZ

Syntax
[C++]
PXCRangeF32 QueryDSMinMaxZ(void);
[C#]
PXCMRangeF32 QueryDSMinMaxZ();
[Java]
PXCMRangeF32 QueryDSMinMaxZ();

Parameters
None

Description
The QueryDSMinMaxZ function returns the minimum and maximum value of the
distance values.
Return Status
The distance value range, as in the RangeF32 structure. If any error, the structure is
filled with PROPERTY_VALUE_INVALID.

256

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.6.5.13 SetDSMinMaxZ

Namespace Hierarchy
[C++]
PXCCapture::Device::SetDSMinMaxZ
[C#]
PXCMCapture.Device.SetDSMinMaxZ
[Java]
PXCMCapture.Device.SetDSMinMaxZ

Syntax
[C++]
pxcStatus SetDSMinMaxZ(PXCRangeF32 range);
[C#]
pxcmStatus SetDSMinMaxZ(PXCMRangeF32 range);
[Java]
pxcmStatus SetDSMinMaxZ(PXCMRangeF32 range);

Parameters
range

The value range, specified in the RangeF32 structure.

Description
The SetDSMinMaxZ function sets the distance value minimum and maximum value
range.
Return Status
STATUS_NO_ERROR

The function was successful.

STATUS_ITEM_UNAVAILABLE

The device does not support this feature.

STATUS_DEVICE_FAILED

The device failed to set the value.

2.11.6.5.14 SetDSLeftRightAutoExposure

Namespace Hierarchy
[C++]
PXCCapture::Device::SetDSLeftRightAutoExposure
257

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C#]
PXCMCapture.Device.SetDSLeftRightAutoExposure
[Java]
PXCMCapture.Device.SetDSLeftRightAutoExposure

Syntax
[C++]
pxcStatus

SetDSLeftRightAutoExposure(pxcBool auto);

[C#]
pxcmStatus SetDSLeftRightAutoExposure(Boolean auto);
[Java]
pxcmStatus SetDSLeftRightAutoExposure(boolean auto);

Parameters
auto

The boolean value to enable/disable auto-exposure of the


left and right streams.

Description
The SetDSLeftRightAutoExposure function ensures/disables auto-exposure of the
left and right streams.
Return Status
STATUS_NO_ERROR

The function was successful.

STATUS_ITEM_UNAVAILABLE

The device does not support this feature.

STATUS_DEVICE_FAILED

The device failed to set the value.

2.11.6.5.15 SetDSLeftRightCropping

Namespace Hierarchy
[C++]
PXCCapture::Device::SetDSLeftRightCropping
[C#]
PXCMCapture.Device.SetDSLeftRightCropping
[Java]
258

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

PXCMCapture.Device.SetDSLeftRightCropping

Syntax
[C++]
pxcStatus SetDSLeftRightCropping(pxcBool enable);
[C#]
pxcmStatus SetDSLeftRightCropping(Boolean enable);
[Java]
pxcmStatus SetDSLeftRightCropping(boolean enable);

Parameters
enable

Enable/disable the cropping mode.

Description
The SetDSLeftRightCropping function sets the left/right image cropping mode. If
set to true, the left/right images are cropped to match the resolution of the depth
image.
Return Status
STATUS_NO_ERROR

The function was successful.

STATUS_ITEM_UNAVAILABLE

The device does not support this feature.

STATUS_DEVICE_FAILED

The device failed to set the value.

2.11.6.5.16 SetDSLeftRightExposure

Namespace Hierarchy
[C++]
PXCCapture::Device::SetDSLeftRightExposure
[C#]
PXCMCapture.Device.SetDSLeftRightExposure
[Java]
PXCMCapture.Device.SetDSLeftRightExposure

Syntax

259

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C++]
pxcStatus

SetDSLeftRightExposure(pxcI32 value);

[C#]
pxcmStatus SetDSLeftRightExposure(Int32 value);
[Java]
pxcmStatus SetDSLeftRightExposure(int value);

Parameters
value

The left and right stream exposure value.

Description
The SetDSLeftRightExposure function sets the left and right stream exposure value,
in milliseconds.
Return Status
STATUS_NO_ERROR

The function was successful.

STATUS_ITEM_UNAVAILABLE

The device does not support this feature.

STATUS_DEVICE_FAILED

The device failed to set the value.

2.11.6.5.17 SetDSLeftRightGain

Namespace Hierarchy
[C++]
PXCCapture::Device::SetDSLeftRightGain
[C#]
PXCMCapture.Device.SetDSLeftRightGain
[Java]
PXCMCapture.Device.SetDSLeftRightGain

Syntax
[C++]
pxcStatus SetDSLeftRightGain(pxcI32 value);
[C#]
pxcmStatus SetDSLeftRightGain(Int32 value);

260

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[Java]
pxcmStatus SetDSLeftRightGain(int value);

Parameters
value

The left and right stream gain value.

Description
The SetDSLeftRightGain function sets the left and right stream gain adjustment
value, with negative values darker and positive value brighter, and zero as normal.
Return Status
STATUS_NO_ERROR

The function was successful.

STATUS_ITEM_UNAVAILABLE

The device does not support this feature.

STATUS_DEVICE_FAILED

The device failed to set the value.

2.11.6.5.18 SetDSEnableEmitter

Namespace Hierarchy
[C++]
PXCCapture::Device::SetDSEnableEmitter
[C#]
PXCMCapture.Device.SetDSEnableEmitter
[Java]
PXCMCapture.Device.SetDSEnableEmitter

Syntax
[C++]
pxcStatus SetDSEnableEmitter(pxcBool enable);
[C#]
pxcmStatus SetDSEnableEmitter(Boolean enable);
[Java]
pxcmStatus SetDSEnableEmitter(boolean enable);

Parameters

261

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

enable

Enable/disable the infrared emitter.

Description
The SetDSEnableEmitter function enables/disables the infrared emitter.
Return Status
STATUS_NO_ERROR

The function was successful.

STATUS_ITEM_UNAVAILABLE

The device does not support this feature.

STATUS_DEVICE_FAILED

The device failed to set the value.

2.11.6.5.19 SetDSEnableDisparityOutput

Namespace Hierarchy
[C++]
PXCCapture::Device::SetDSEnableDisparityOutput
[C#]
PXCMCapture.Device.SetDSEnableDisparityOutput
[Java]
PXCMCapture.Device.SetDSEnableDisparityOutput

Syntax
[C++]
pxcStatus SetDSEnableDisparityOutput(pxcBool enable);
[C#]
pxcmStatus SetDSEnableDisparityOutput(Boolean enable);
[Java]
pxcmStatus SetDSEnableDisparityOutput(boolean enable);

Parameters
enable

Enable/disable the disparity output mode.

Description

262

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The SetDSEnableDisparityOutput function sets the disparity output mode. If set to


true, the output is the inverse distance. Otherwise, the output is the distance (Z).
Return Status
STATUS_NO_ERROR

The function was successful.

STATUS_ITEM_UNAVAILABLE

The device does not support this feature.

STATUS_DEVICE_FAILED

The device failed to set the value.

2.11.6.5.20 SetDSDisparityMultiplier

Namespace Hierarchy
[C++]
PXCCapture::Device::SetDSDisparityMultiplier
[C#]
PXCMCapture.Device.SetDSDisparityMultiplier
[Java]
PXCMCapture.Device.SetDSDisparityMultiplier

Syntax
[C++]
pxcStatus SetDSDisparityMultiplier(pxcI32 scale);
[C#]
pxcmStatus SetDSDisparityMultiplier(Int32 scale);
[Java]
pxcmStatus SetDSDisparityMultiplier(int scale);

Parameters
scale

The scale factor.

Description
The SetDSDisparityMultiplier function sets the disparity output scale factor. The
default value is 32.
Return Status
263

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

STATUS_NO_ERROR

The function was successful.

STATUS_ITEM_UNAVAILABLE

The device does not support this feature.

STATUS_DEVICE_FAILED

The device failed to set the value.

2.11.6.5.21 SetDSDisparityShift

Namespace Hierarchy
[C++]
PXCCapture::Device::SetDSDisparityShift
[C#]
PXCMCapture.Device.SetDSDisparityShift
[Java]
PXCMCapture.Device.SetDSDisparityShift

Syntax
[C++]
pxcStatus SetDSDisparityShift(pxcI32 value);
[C#]
pxcmStatus SetDSDisparityShift(Int32 value);
[Java]
pxcmStatus SetDSDisparityShift(int value);

Parameters
value

The disparity shift value.

Description
The SetDSDisparityShift function sets the disparity shift value, in millimeters. Both
the minimum depth value and the maximum depth value are shifted to enhance the
resolution of depth values in between.
Return Status

264

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

STATUS_NO_ERROR

The function was successful.

STATUS_ITEM_UNAVAILABLE

The device does not support this feature.

STATUS_DEVICE_FAILED

The device failed to set the value.

2.11.6.6 Properties

The Device interface provides the following properties:


Property

Description

deviceInfo (+JS,+UWP)

Return the current device information.

Sources (UWP)

Return available stream sources.

2.11.6.6.1 deviceInfo (+JS,+UWP)

Namespace Hierarchy
[C#]
PXCMCaptureManager.Device.deviceInfo
[JavaScript]
intel.realsense.Device.deviceInfo
[C#/UWP]
Intel.RealSense.Device.DeviceInfo

Syntax
[C#]
DeviceInfo deviceInfo {
get;
}
[JavaScript]
Data Type

{
deviceInfo

DeviceInfo

}
[C#/UWP]
DeviceInfo DeviceInfo {
get;
}

265

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Description
The deviceInfo property returns the current device information as described in the
DeviceInfo structure.
Remarks
[C#]

The C# application can also use the function QueryDeviceInfo.

2.11.6.6.2 Sources (UWP)

Namespace Hierarchy
Intel.RealSense.Device.Sources

Syntax
IReadOnlyDictionary<StreamType,Object> Sources {
get;
}

Description
The Sources property returns all available stream sources as a dictionary, indexed by
the StreamType enumerator.
For a color source, the stream source is a PerceptionColorFrameSource instance.
For a depth source, the stream source is a PerceptionDepthFrameSource instance.
For an infrared source, the stream source is a PerceptionInfraredFrameSource
instance.
2.11.6.7 Static Functions

The Device interface exposes the following static functions:


Static Function

Description

FindAllAsync (UWP)

Get the list of available devices.

2.11.6.7.1 FindAllAsync (UWP)

Namespace Hierarchy
Intel.RealSense.Device.FindAllAsync

Syntax
async Task<IReadOnlyList<Device>> FindAllAsync(SenseManager sm);
266

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Parameters
sm

The SenseManager instance.

Description
The FindAllAsync function returns all available I/O devices.
This is an asynchronous function.
Return Status
The list of available device instances.

2.11.7 Image
Namespace Hierarchy
[C++]
PXCImage
[C#]
PXCMImage
[Java]
PXCMImage

Description
The Image interface manages image buffer access. The application uses the
CreateImage function to create an instance of the Image interface.
Remarks
The Image interface implements the following interfaces:
AddRef: You may use the AddRef function to preserve the Image instance without

making a copy.
Metadata: You may use the Metadata interface to retrieve any meta information
that goes with the image. You can use the QueryInstance function to retrieve an
instance of the Metadata interface.

267

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Reference
[C++]
pxcimage.h
[C#/.NET4]
libpxcclr.cs.dll
[C#/Unity]
libpxcclr.unity.dll
[Java]
libpxcclr.java.jar
[Processing]
libpxcclr_processing

Runtime
[C++][C#][Java]

Install SDK runtime: core


Example
Example 55 shows how to create an image object.
Example 55: Create an Image Object

[C++]
PXCImage::ImageInfo iinfo;
memset(&iinfo,0,sizeof(iinfo));
iinfo.width=640;
iinfo.height=480;
iinfo.format=PXCImage::COLOR_FORMAT_RGB24;
PXCImage *image=session->CreateImage(&iinfo);
...
image->Release();
[C#]
PXCMImage.ImageInfo iinfo=new PXCMImage.ImageInfo() {
width=640, height=480, format=PXCMImage.ColorFormat.COLOR_FORMAT_RGB24
};
PXCMImage image=session.CreateImage(iinfo);
...
image.Dispose();
[Java]
PXCMImage.ImageInfo iinfo=new PXCMImage.ImageInfo();
iinfo.width=640;
iinfo.height=480;

268

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

iinfo.format=PXCMImage.ColorFormat.COLOR_FORMAT_RGB24;
PXCMImage image=session.CreateImage(iinfo);
...
image.close();

See Also
Constants
Member Functions
Properties (C#)
2.11.7.1 Constants

The Image interface exposes the following constants:


Constant

Description

CUID

The interface identifier

NUM_OF_PLANES

The number of planes in an image sample.

METADATA_DEVICE_PROPERTIES

The meta data identifier that contains a list of changed


device properties (the DeviceCap structure array).

METADATA_DEVICE_PROJECTION

The meta data identifier that contains the Projection


instance.

2.11.7.2 Member Functions

The Image interface exposes the following member functions:

269

Member Functions

Description

AcquireAccess

Lock the image storage for read/write access with format


conversion.

ReleaseAccess

Unlock the image storage.

QueryInfo

Return the image properties.

QueryOptions

Return any optional flags.

QueryTimeStamp

Return the time stamp.

QueryStreamType

Return the stream type.

SetOptions

Set the optional flags.

SetTimeStamp

Set the time stamp.

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

SetStreamType

Set the stream type.

AddRef

Increase the reference counter of the instance.

CopyImage

Copy an external image to the image.

ImportData

Copy the image from an external buffer.

ExportData

Copy the image to an external buffer.

2.11.7.2.1 AcquireAccess

Namespace Hierarchy
[C++]
PXCImage::AcquireAccess
[C#]
PXCMImage.AcquireAccess
[Java]
PXCMImage.AcquireAccess

Syntax
[C++]
pxcStatus AcquireAccess(Access access, PixelFormat format, Rotation
rotation, Option options, ImageData *data);
pxcStatus AcquireAccess(Access access, PixelFormat format, Option
options, ImageData *data);
pxcStatus AcquireAccess(Access access, PixelFormat format, ImageData
*data);
pxcStatus AcquireAccess(Access access, ImageData *data);
[C#]
pxcmStatus AcquireAccess(Access access,
rotation, Option options, out ImageData
pxcmStatus AcquireAccess(Access access,
options, out ImageData data);
pxcmStatus AcquireAccess(Access access,
data);
pxcmStatus AcquireAccess(Access access,

PixelFormat format, Rotation


data);
PixelFormat format, Option
PixelFormat format, out ImageData
out ImageData data);

[Java]
pxcmStatus AcquireAccess(Access access, PixelFormat format, Rotation
rotation, Option options, ImageData data);
pxcmStatus AcquireAccess(Access access, PixelFormat format, Option
options, ImageData data);
pxcmStatus AcquireAccess(Access access, PixelFormat format, ImageData
data);
pxcmStatus AcquireAccess(Access access, ImageData data);

270

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Parameters
access

The access type; see the Access enumerator


for details.

format

Optional pixel format. See the PixelFormat


enumerator for details.

rotation

Optional image rotation degrees. See the


Rotation enumerator for details.

options

Optional image options. See the Option


enumerator for details.

data

The output ImageData structure, to be filled.

Description
The AcquireAccess function locks the image buffer for exclusive access. If the
specified pixel format is not available for the image storage, the function creates an
internal copy that matches the pixel format. The function returns the internal data
buffer pointers in the output ImageData structure.
If the format parameter is NULL or omitted, the function returns the pixel format in
which the image was created.
Return Status
STATUS_NO_ERROR

The function returned successfully.

STATUS_DEVICE_BUSY

Failed to lock the image buffer for exclusive


access.

STATUS_PARAM_UNSUPPORTED

The specified pixel conversion is not


supported.

Example
Example 56 shows how to get access to the image data.
Example 56: Access to the Image Data

[C++]
PXCImage::ImageData data;

271

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

// Access to the image data in the RGB32 format.


image>AcquireAccess(PXCImage::ACCESS_READ,PXCImage::PIXEL_FORMAT_RGB32,&data);
...
// work on the image plane data.planes[0] with pitch data.pitches[0].
...
// Release access after use.
image->ReleaseAccess(&data);
[C#]
PXCMImage.ImageData data;
// Access to the image data in the RGB32 format.
image.AcquireAccess(PXCMImage.Access.ACCESS_READ,PXCMImage.PixelFormat.PIXE
L_FORMAT_RGB32,out data);
...
byte[] buffer=data.ToByteArray(0, data.pitches[0]*image.info.height);
...
// Release access after use.
image.ReleaseAccess(data);
[Java]
PXCMImage.ImageData data=new PXCMImage.ImageData();
// Access to the image data in the RGB32 format.
image.AcquireAccess(PXCMImage.Access.ACCESS_READ,PXCMImage.PixelFormat.PIXE
L_FORMAT_RGB32,data);
...
byte[] buffer=data.ToByteArray(0, data.pitches[0]*image.info.height);
...
// Release access after use.
image.ReleaseAccess(data);
2.11.7.2.2 AddRef

Namespace Hierarchy
[C++]
PXCImage::AddRef
[C#]
PXCMImage.AddRef
[Java]
PXCMImage.AddRef

Syntax
[C++]
void AddRef(void);
[C#]
272

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

void AddRef();
[Java]
void AddRef();

Parameters
None
Description
The AddRef function increases the reference counter of the current instance.
The application can use this function to preserve the image instance without making a
copy. Then after use, the application must release the image instance.
Return Status
None
2.11.7.2.3 CopyImage

Namespace Hierarchy
[C++]
PXCImage::CopyImage
[C#]
PXCMImage.CopyImage
[Java]
PXCMImage.CopyImage

Syntax
[C++]
pxcStatus CopyImage(PXCImage *image);
[C#]
pxcmStatus CopyImage(PXCMImage image);
[Java]
pxcmStatus CopyImage(PXCMImage image);

Parameters

273

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

image

The source image.

Description
The CopyImage function copies the source image to the image storage.
Return Status
STATUS_NO_ERROR

The function returned successfully.

STATUS_PARAM_UNSUPPORTED

Failed to copy image due to unsupported pixel


format conversion.

2.11.7.2.4 ExportData

Namespace Hierarchy
[C++]
PXCImage::ExportData
[C#]
PXCMImage.ExportData
[Java]
PXCMImage.ExportData

Syntax
[C++]
pxcStatus

ExportData(ImageData *data);

[C#]
pxcmStatus ExportData(ImageData data);
[Java]
pxcmStatus ExportData(ImageData data);

Parameters
data

The ImageData structure to specify where to


export the data.

Description

274

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The ExportData function locks the image buffer, exports the data in the described
format and to the specified buffers, and then unlocks the image buffer.
Return Status
STATUS_NO_ERROR

The function returned successfully.

STATUS_DEVICE_BUSY

Failed to lock the image buffer for exclusive


access.

STATUS_PARAM_UNSUPPORTED

The specified pixel conversion is not


supported.

2.11.7.2.5 ImportData

Namespace Hierarchy
[C++]
PXCImage::ImportData
[C#]
PXCMImage.ImportData
[Java]
PXCMImage.ImportData

Syntax
[C++]
pxcStatus ImportData(ImageData *data);
[C#]
pxcmStatus ImportData(ImageData data);
[Java]
pxcmStatus ImportData(ImageData data);

Parameters
data

The ImageData structure to specify where to


import the data.

Description

275

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The ImportData function locks the image buffer, imports the data in the described
format and from the specified buffers, and then unlocks the image buffer.
Return Status
STATUS_NO_ERROR

The function returned successfully.

STATUS_DEVICE_BUSY

Failed to lock the image buffer for exclusive


access.

STATUS_PARAM_UNSUPPORTED

The specified pixel conversion is not


supported.

2.11.7.2.6 QueryInfo

Namespace Hierarchy
[C++]
PXCImage::QueryInfo
[C#]
PXCMImage.QueryInfo
[Java]
PXCMImage.QueryInfo

Syntax
[C++]
ImageInfo QueryInfo(void);
[C#]
ImageInfo QueryInfo();
[Java]
ImageInfo QueryInfo();

Parameters
None

Description
The QueryInfo function returns the image properties.

276

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Return Status
The ImageInfo structure
Remarks
[C#]

The C# application can also use property info.

2.11.7.2.7 QueryOptions

Namespace Hierarchy
[C++]
PXCImage::QueryOptions
[C#]
PXCMImage.QueryOptions
[Java]
PXCMImage.QueryOptions

Syntax
[C++]
Option QueryOptions(void);
[C#]
Option QueryOptions();
[Java]
Option QueryOptions();

Parameters
None
Description
The QueryOptions function returns the image option flags.
Return Status
The image option flags as ImageOption.

277

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Remarks
[C#]

The C# application can also use property options.

2.11.7.2.8 QueryStreamType

Namespace Hierarchy
[C++]
PXCImage::QueryStreamType
[C#]
PXCMImage.QueryStreamType
[Java]
PXCMImage.QueryStreamType

Syntax
[C++]
StreamType QueryStreamType(void);
[C#]
StreamType QueryStreamType();
[Java]
StreamType QueryStreamType();

Parameters
None
Description
The QueryStreamType function returns the stream type of the image.
Return Status
The stream type.
Remarks
[C#]

The C# application can also use property streamType.

278

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

279

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.7.2.9 QueryTimeStamp

Namespace Hierarchy
[C++]
PXCImage::QueryTimeStamp
[C#]
PXCMImage.QueryTimeStamp
[Java]
PXCMImage.QueryTimeStamp

Syntax
[C++]
pxcI64 QueryTimeStamp(void);
[C#]
Int64 QueryTimeStamp();
[Java]
long QueryTimeStamp();

Parameters
None
Description
The QueryTimeStamp function returns the image time stamp, in 100 ns.
Return Status
The time stamp value.
Remarks
[C#]

The C# application can also use property timeStamp.

2.11.7.2.10 ReleaseAccess

Namespace Hierarchy
[C++]
PXCImage::ReleaseAccess
280

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C#]
PXCMImage.ReleaseAccess
[Java]
PXCMImage.ReleaseAccess

Syntax
[C++]
pxcStatus ReleaseAccess(ImageData *data);
[C#]
pxcmStatus ReleaseAccess(ImageData data);
[Java]
pxcmStatus ReleaseAccess(ImageData data);

Parameters
data

The ImageData structure that is used when the


application called the AcquireAccess function.

Description
The ReleaseAccess function releases the lock to the image storage.
Return Status
STATUS_NO_ERROR

The function returned successfully.

2.11.7.2.11 SetOptions

Namespace Hierarchy
[C++]
PXCImage::SetOptions
[C#]
PXCMImage.SetOptions
[Java]
PXCMImage.SetOptions

Syntax
[C++]

281

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

void SetOptions(Option option);


[C#]
void SetOptions(Option option);
[Java]
void SetOptions(Option option);

Parameters
option

The image options. See the Option enumerator for


details.

Description
The SetOptions function sets the image options.
Return Status
None
Remarks
[C#]

The C# application can also use property options.

2.11.7.2.12 SetStreamType

Namespace Hierarchy
[C++]
PXCImage::SetStreamType
[C#]
PXCMImage.SetStreamType
[Java]
PXCMImage.SetStreamType

Syntax
[C++]
void SetTimeStamp(StreamType type);
[C#]
void SetTimeStamp(StreamType type);

282

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[Java]
void SetTimeStamp(StreamType type);

Parameters
type

The stream type. See the StreamType numerator for


definitions.

Description
The SetStreamType function sets the stream type value.
Return Status
None
Remarks
[C#]

The C# application can also use property streamType.

2.11.7.2.13 SetTimeStamp

Namespace Hierarchy
[C++]
PXCImage::SetTimeStamp
[C#]
PXCMImage.SetTimeStamp
[Java]
PXCMImage.SetTimeStamp

Syntax
[C++]
void SetTimeStamp(pxcI64 ts);
[C#]
void SetTimeStamp(Int64 ts);
[Java]
void SetTimeStamp(long ts);

283

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Parameters
ts

The image time stamp, in 100 ns.

Description
The SetTimeStamp function sets the image time stamp.
Return Status
None
Remarks
[C++]

N/A
[C#]

The C# application can also use property timeStamp.


[Java]

N/A
[JavaScript]

N/A
[C#/UWP]

N/A

2.11.7.3 Properties (C#)

The Image interface exposes the following properties:

284

Property

Description

info

Access to the image dimension and format information.

options

Access to the image options.

timeStamp

Access to the image time stamp.

streamType

Access to the image stream type.

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.7.3.1 info

Namespace Hierarchy
Image.info

Syntax
ImageInfo info {
get;
}

Description
The imageInfo property gets the image data configuration information. See the
ImageInfo definition for details.
Remarks
The application can also use member function QueryInfo.

2.11.7.3.2 options

Namespace Hierarchy
Image.options

Syntax
Option options {
get; set;
}

Description
The options property gets/sets the image options. See the Option definition for
details.
Remarks
The application can also use member functions QueryOptions and SetOptions.
2.11.7.3.3 timeStamp

Namespace Hierarchy

285

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Image.timeStamp

Syntax
Int64 timeStamp {
get; set;
}

Description
The timeStamp property gets/sets the image time stamp, unit in 100ns.
Remarks
The application can also use member functions QueryTimeStamp and
SetTimeStamp.

2.11.7.3.4 streamType

Namespace Hierarchy
Image.streamType

Syntax
StreamType streamType {
get; set;
}

Description
The streamType property gets/sets the image stream type value.
Remarks
The application can also use member functions QueryStreamType and
SetStreamType.

2.11.8 NativeTexturePlugin (Unity)


Namespace Hierarchy

286

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

NativeTexturePlugin

Description
The NativeTexturePlugin interface provides member function to update
Texture2D texture with color and depth images in Unity. Unlike ToTexture2D, the
NativeTexturePlugin interface uploads BGRA image data to the GPU directly through
the graphics API.
Supports only Direct3D* 9, Direct3D* 11 and OpenGL* 2.0 in Unity 5.2.3p3 and
above.
You can use the Activate function to create an instance of the
NativeTexturePlugin interface.
Reference
libpxcclr.unity.dll
libpxccpp2c.dll (native graphics API implementation)

Examples
Example 57 shows how to update a Texture2D with a color image.
Example 57: Update the Texture2D with a Color image

// Create a NativeTexturePlugin instance


NativeTexturePlugin texturePlugin=NativeTexturePlugin.Activate();
// Create a Texture2D with TextureFormat.BGRA32 and expected width, height
(can be also obtained from PXCMImage.info)
Texture2D m_texColor = new Texture2D(320, 240, TextureFormat.BGRA32,
false);
// Assign the Texture2D to the gameobject's material.
quadGameObject.GetComponent<MeshRenderer>().material.mainTexture =
m_texColor;
// Optional: To re-orient i.e. flip and flop the texture
quadGameObject.GetComponent<MeshRenderer>().material.mainTextureScale = new
Vector2(-1,-1);
// Retrieve the native pointer to the texture
System.IntPtr texPtr = m_texColor.GetNativeTexturePtr();

287

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

// Retrieve a sample via OnModuleProcessedFrame, OnNewSample callbacks or


in between AcquireFrame/ReleaseFrame
{
// Update the Texture2D with the color image
texturePlugin.UpdateTextureNative(sample.color, texPtr);
}

See Also
Member Functions
Static Functions

288

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.8.1 Member Functions

The NativeTexturePlugin interface provides the following member functions:


Member Function

Description

UpdateTextureNative (Unity) Uploads the image to GPU directly.


2.11.8.1.1 UpdateTextureNative (Unity)

Namespace Hierarchy
NativeTexturePlugin.UpdateTextureNative

Syntax
void UpdateTextureNative(PXCMImage image, System.IntPtr
texture2DPtr);

Parameters
image

The color or depth image.

texture2DPtr

Pointer to Texture2D can be obtained from


Texture2D.GetNativeTexturePtr()

Description
The UpdateTextureNative function uploads the BGRA image data to GPU
directly through graphics API. Supports only Direct3D*9, Direct3D*11 and
OpenGL*2.0 on Unity* 5.2.3.p3 and above.
An instance of UpdateTextureNative class must be retrieved once using
Activate before calling UpdateTextureNative function.
The pointer to Texture2D passed must be of correct dimensions (width,
height) and must not change during runtime . The Texture2D must always be
created with TextureFormat.BGRA32.
Return Status
None

289

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.8.2 Static Functions


The NativeTexturePlugin interface provides the following static functions:

Static Functions

Description

Activate(Unity)

Create an instance of NativeTexturePlugin.

2.11.8.2.1 Activate (Unity)

Namespace Hierarchy
NativeTexturePlugin.Activate

Syntax
static NativeTexturePlugin Activate();

Parameters
None

Description
The Activate function creates a NativeTexturePlugin Instance.
Internally, the function creates an empty gameObject with the name
"NativeTextureHandler" during play mode and adds the
NativeTexturePlugin component to it.
Return Status
The NativeTexturePlugin instance.

2.11.9 Metadata
Namespace Hierarchy
[C++]
PXCMetadata
[C#]
PXCMMetadata
[Java]
PXCMMetadata

290

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Description
The Metadata interface manages the meta data storage. The Session, Image, Audio
and Photo implementations expose the Metadata interface.
Reference
[C++]
pxcmetadata.h
[C#/.NET4]
libpxcclr.cs.dll
[C#/Unity]
libpxcclr.unity.dll
[Java]
libpxcclr.java.jar
[Processing]
libpxcclr_processing

Runtime
[C++][C#][Java]

Install SDK runtime: core


See Also
Constants
Member Functions
Properties (C#)
2.11.9.1 Constants

The Metadata interface exposes the following constants:


Constant

Description

CUID

The interface identifier.

2.11.9.2 Member Functions

The MetaData interface exposes the following member functions:

291

Member Functions

Description

AttachBuffer

Attach a byte buffer to the metadata storage.

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

AttachSerializable

Attach a serializable interface implementation.

CreateSerializable

Recreate the interface implementation from the metadata storage.

DetachMetadata

Detach meta data from the metadata storage.

QueryBuffer

Retrieve the byte buffer from the metadata storage.

QueryBufferSize

Retrieve the size of the metadata storage.

QueryMetadata

Enumerate all metadata identifiers.

QueryUID

Return a unique identifier for metadata identification.

2.11.9.2.1 AttachBuffer

Namespace Hierarchy
[C++]
PXCMetaData::AttachBuffer
[C#]
PXCMMetaData.AttachBuffer
[Java]
PXCMMetaData.AttachBuffer

Syntax
[C++]
pxcStatus AttachBuffer(pxcUID id, pxcBYTE *buffer, pxcI32 size);
[C#]
pxcmStatus AttachBuffer(Int32 id, Byte[] buffer);
[Java]
pxcmStatus AttachBuffer(int id, byte[] buffer);

Parameters
id

The meta data identifier.

buffer

The pointer to the byte buffer.

size

The size of the byte buffer.

Description
The AttachBuffer function attaches a byte buffer to the meta data storage.

292

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Return Status
STATUS_NO_ERROR

The function returned successfully.

2.11.9.2.2 AttachSerializable

Namespace Hierarchy
[C++]
PXCMetaData::AttachSerializable
[C#]
PXCMMetaData.AttachSerializable
[Java]
PXCMMetaData.AttachSerializable

Syntax
[C++]
pxcStatus AttachSerializable(pxcUID id, PXCBase *serializable);
[C#]
pxcmStatus AttachSerializable(Int32 id, PXCMBase serializable);
[Java]
pxcmStatus AttachSerializable(int id, PXCMBase serializable);

Parameters
id

The meta data identifier.

serializable

The instance of the serializable interface.

Description
The AttachSerializable function serializes the interface implementation and
attaches the serialized data to the meta data storage. The application can later
recreate the interface implementation from the serialized data.
Return Status
STATUS_NO_ERROR

293

Intel RealSense SDK 2016 R2 Reference Manual

The function returned successfully.

2010-2016 Intel Corporation

2.11.9.2.3 CreateSerializable

Namespace Hierarchy
[C++]
PXCMetaData::CreateSerializable
[C#]
PXCMMetaData.CreateSerializable
[Java]
PXCMMetaData.CreateSerializable

Syntax
[C++]
pxcStatus CreateSerializable(pxcUID id, pxcUID cuid, void
**serializable);
[C#]
pxcmStatus CreateSerializable(Int32 id, Int32 cuid, out PXCMBase
serializable);
[Java]
pxcmStatus CreateSerializable(int id, PXCMBase serializable);

Parameters
id

The metadata identifier.

cuid

The interface identifier.

serializable

The instance of the serializable interface, to be


created.

Description
The CreateSerializable function recreates the interface implementation from the
serialized data in the metadata storage.
Return Status
STATUS_NO_ERROR

The function returned successfully.

Remarks
[C++]

294

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The application may use the CreateSerialize<T> template to enable type checking.
For example, the following statement recreates the interface Y implementation in
variable y:
pxcStatus sts=metadata->CreateSerializable<Y>(id,&y);
[C#]

The application may use the CreateSerialize<T> template to enable type checking.
For example, the following statement recreates the interface Y implementation in
variable y:
pxcmStatus sts=metadata.CreateSerializable<Y>(id, out y);
[Java]

The application must explicitly construct the returned instance using the default
constructor and then pass the instance to the function:
Y y=new Y();
pxcmStatus sts=metadata.CreateSerializable(id, y);
2.11.9.2.4 DetachMetaData

Namespace Hierarchy
[C++]
PXCMetaData::DetachMetadata
[C#]
PXCMMetaData.DetachMetadata
[Java]
PXCMMetaData.DetachMetadata

Syntax
[C++]
pxcStatus DetachMetadata(pxcUID id);
[C#]
pxcmStatus DetachMetadata(Int32 id);
[Java]
pxcmStatus DetachMetadata(int id);

Parameters
id

295

Intel RealSense SDK 2016 R2 Reference Manual

The metadata identifier.

2010-2016 Intel Corporation

Description
The DetachMetadata function detaches the identified metadata.
Return Status
STATUS_NO_ERROR

The function returned successfully.

STATUS_ITEM_UNAVAILABLE

The meta data does not exist.

2.11.9.2.5 QueryBuffer

Namespace Hierarchy
[C++]
PXCMetaData::QueryBuffer
[C#]
PXCMMetaData.QueryBuffer
[Java]
PXCMMetaData.QueryBuffer

Syntax
[C++]
pxcStatus QueryBuffer(pxcUID id, pxcBYTE *buffer, pxcI32 size);
[C#]
pxcmStatus QueryBuffer(Int32 id, out Byte[] buffer);
[Java]
pxcmStatus QueryBuffer(Int32 id, byte[] buffer);

Parameters
id

The metadata identifier.

buffer

Optional pointer to the byte buffer. Mandatory


for C#.

size

The allocated buffer size.

Description

296

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The QueryBuffer function retrieves the byte buffer content from the metadata
storage. The application must allocate the buffer. The application can use the
QueryBufferSize function to get the buffer size.
Return Status
STATUS_NO_ERROR

The function returned successfully.

STATUS_ITEM_UNAVAILABLE

The metadata does not exist.

2.11.9.2.6 QueryBufferSize

Namespace Hierarchy
[C++]
PXCMetaData::QueryBufferSize
[C#]
PXCMMetaData.QueryBufferSize
[Java]
PXCMMetaData.QueryBufferSize

Syntax
[C++]
pxcI32 QueryBufferSize(pxcUID id);
[C#]
Int32 QueryBufferSize(Int32 id);
[Java]
int QueryBufferSize(Int32 id);

Parameters
id

The metadata identifier.

Description
The QueryBufferSize function retrieves the size of the byte buffer content from the
metadata storage.
Return Status

297

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The buffer size in bytes, or 0 if there is any error.


2.11.9.2.7 QueryMetaData

Namespace Hierarchy
[C++]
PXCMetaData::QueryMetaData
[C#]
PXCMMetaData.QueryMetaData
[Java]
PXCMMetaData.QueryMetaData

Syntax
[C++]
pxcStatus QueryMetadata(pxcI32 idx, pxcUID *id);
[C#]
pxcmStatus QueryMetadata(Int32 idx, out Int32 id);
[Java]
pxcmStatus QueryMetadata(int idx, int[] id);

Parameters
idx

Zero-based index to enumerate all meta data


identifiers.

id

The meta data identifier, to be returned.

Description
The QueryMetaData function enumerates all available meta data identifiers by
returning the meta data identifier of the given index.
Return Status

298

STATUS_NO_ERROR

The function returned successfully.

STATUS_ITEM_UNAVAILABLE

The meta data does not exist.

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.9.2.8 QueryUID

Namespace Hierarchy
[C++]
PXCMetaData::QueryUID
[C#]
PXCMMetaData.QueryUID
[Java]
PXCMMetaData.QueryUID

Syntax
[C++]
pxcUID QueryUID(void);
[C#]
Int32 QueryUID();
[Java]
int QueryUID();

Parameters
None
Description
The QueryUID function returns a unique identifier for the next meta data item or zero
if the operation failed.
Return Status
The unique identifier value.
Remarks
[C++]

N/A
[C#]

The C# application can use property uid.


[Java]
299

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

N/A
[JavaScript]

N/A
[C#/UWP]

N/A

2.11.9.3 Properties (C#)

The MetaData interface exposes the following properties:


Member Functions

Description

uid

Return a unique identifier for meta data storage.

2.11.9.3.1 uid

Namespace Hierarchy
PXCMMetaData.uid

Syntax
Int32 uid {
get;
};

Description
The uid property returns a unique identifier for the next meta data item or zero if the
operation failed.
Remarks
The C# application can use function QueryUID.

2.11.10 PlatformCameraControl
Namespace Hierarchy
[C++]
PXCPlatformCameraControl

300

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C#]
PXCMPlatformCameraControl
[Java]
PXCMPlatformCameraControl

Description
The PlatformCameraControl interface provides member functions to perform the
platform camera snapshot operation.
You can use the QueryInstance function to retrieve an instance of the
PlatformCameraControl interface from an active R200 Enhanced Device instance.
You should not release the resulting PlatformCameraControl instance as the
QueryInstance function returns the Device object instance directly.
Reference
[C++]
pxcplatformcamera.h
[C#/.NET4]
libpxcclr.cs.dll
[C#/Unity]
libpxcclr.unity.dll
[Java]
libpxcclr.java.jar
[Processing]
libpxcclr_processing

Runtime
[C++][C#][Java]

Install SDK runtime: core


Examples
Example 58 shows how to create the PlatformCameraControl instance for snapshot.
Example 58: Retrieve the PXCPlatformCameraControl Instance

[C++]
// sm is the SenseManager instance
PXCCapture::Device *device=sm->QueryCaptureManager()->QueryDevice();

301

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

PXCPlatformCameraControl *pcc=device>QueryInstance<PXCPlatformCameraControl>();
[C#]
// sm is the SenseManager instance
PXCMCapture.Device device=sm.captureManager.device;
PXCMPlatformCameraControl
pcc=device.QueryInstance<PXCMPlatformCameraControl>();
[Java]
// sm is the SenseManager instance
PXCMCapture.Device device=sm.QueryCaptureManager().QueryDevice();
PXCMPlatformCameraControl pcc=(PXCMPlatformCameraControl)
device.QueryInstance(PXCMPlatformCameraControl.CUID);

See Also
Constants
Callbacks and Delegates
Member Functions

302

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.10.1 Callbacks and Delegates

The PlatformCameraControl interface provides the following callback functions/delegates:


Callback/Delegate

Description

Handler

Callbacks and delegates during the platform camera


streaming and snapshot operations.

2.11.10.1.1 Handler

Namespace Hierarchy
[C++]
PXCPlatformCameraControl::Handler
[C#]
PXCMPlatformCameraControl.Handler
[Java]
PXCMPlatformCameraControl.Handler

Description
The Handler interface defines a set of callback functions/delegates for the snapshot
operation. You must implement the interface and pass as an argument to the
TakePhoto function.
Examples
Example 59 shows how to take a snapshot photo.
Example 59: Take a Snapshot Photo

[C++]
class MyHandler: public PXCPlatformCameraControl::Handler {
public:
virtual void PXCAPI OnPlatformCameraSample(PXCCapture::Sample& sample)
{
}
virtual void PXCAPI OnPlatformCameraError() {
}
};
// pcc is a PXCPlatformCameraControl interface
// Retrieve the photo configuration
PXCCapture::Device::StreamProfile profile={};
pcc->EnumPhotoProfile(0, &profile);
// Take a photo
303

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

MyHandler handler;
pcc->TakePhoto(profile, &hanlder);
[C#]
static void OnPlatformCameraSample(PXCMCapture.Sample sample) {
}
static void OnPlatformCameraError() {
}
// pcc is a PXCMPlatformCameraControl interface
// Retrieve the photo configuration
PXCMCapture.Device.StreamProfile profile;
pcc.EnumPhotoProfile(0, out profile);
// Take a photo
PXCMPlatformCameraHandler handler=new PXCMPlatformCameraHandler() {
onPlatformCameraSample=OnPlatformCameraSample,
onPlatformCameraError=OnPlatformCameraError
};
pcc.TakePhoto(profile, hanlder);
[Java]
class MyHandler impements PXCMPlatformCameraControl.Handler {
public void OnPlatformCameraSample(PXCMCapture.Sample sample) {
}
public void OnPlatformCameraError() {
}
};
// pcc is a PXCMPlatformCameraControl interface
// Retrieve the photo configuration
PXCMCapture.Device.StreamProfile profile=new
PXCMCapture.Device.StreamProfile();
pcc.EnumPhotoProfile(0, profile);
// Take a photo
MyHandler handler=new MyHandler();
pcc.TakePhoto(profile, hanlder);

See Also
Member Functions

304

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.10.1.1.1 Member Functions

The Handler interface exposes the following member functions:

305

Member Functions

Description

OnPlatformCameraSample

Invoked when the platform camera delivers the


snapshot photo.

OnPlatformCameraError

Invoked when the platform camera encounters


any error.

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Namespace Hierarchy
[C++]
PXCPlatformCameraControl::Handler::OnPlatformCameraSample
[C#]
PXCMPlatformCameraControl.Handler.OnPlatformCameraSample
[Java]
PXCMPlatformCameraControl.Handler.OnPlatformCameraSample

Syntax
[C++]
void OnPlatformCameraSample(Sample& sample);
[C#]
delegate void OnPlatformCameraSample(Sample sample);
[Java]
delegate void OnPlatformCameraSample(Sample sample);

Parameters
sample

The available sample images .

Description
The OnPlatformCameraSample function is invoked when the platform camera
delivers the snapshot sample.
The application should not perform any lengthy operation in the callback function.
Return Status
None

Remarks
The sample instances is internally managed. Do not release the sample instance or
any image instances.

Namespace Hierarchy
[C++]
PXCPlatformCameraControl::Handler::OnPlatformCameraError
306

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C#]
PXCMPlatformCameraControl.Handler.OnPlatformCameraError
[Java]
PXCMPlatformCameraControl.Handler.OnPlatformCameraError

Syntax
[C++]
void OnPlatformCameraError(void);
[C#]
delegate void OnPlatformCameraError();
[Java]
void OnPlatformCameraError();

Parameters
None

Description
The OnPlatformCameraError function is invoked when there is any error during the
platform camera operations.
The application should not perform any lengthy operation in the callback function.
Return Status
None

2.11.10.2 Constants

The PlatformCameraControl interface exposes the following constants:

307

Constant

Description

CUID

The interface identifier.

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.10.3 Member Functions

The PlatformCameraControl interface exposes the following member functions:

308

Member Functions

Description

EnumPhotoProfile

Enumerate the snapshot configurations.

TakePhoto

Take a snapshot photo.

CreatePhotoProjection

Retrieve the Projection instance that is


corresponding to the photo sample.

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.10.3.1 CreatePhotoProjection

Namespace Hierarchy
[C++]
PXCPlatformCameraControl::CreatePhotoProjection
[C#]
PXCMPlatformCameraControl.CreatePhotoProjection
[Java]
PXCMPlatformCameraControl.CreatePhotoProjection

Syntax
[C++]
PXCProjection* CreatePhotoProjection(StreamProfile& profile);
[C#]
PXCMProjection CreatePhotoProjection(StreamProfile profile);
[Java]
PXCMProjection CreatePhotoProjection(StreamProfile profile);

Parameters
profile

The snapshot stream configuration. See the


StreamProfile structure for definitions.

Description
The CreatePhotoProjection function returns the Projection instance that is
associated with the snapshot photo(s).
You must release the Projection instance after use.
Return Status
The Projection instance or NULL/null if there is any error.
2.11.10.3.2 EnumPhotoProfile

Namespace Hierarchy
[C++]
PXCPlatformCameraControl::EnumPhotoProfile
[C#]
309

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

PXCMPlatformCameraControl.EnumPhotoProfile
[Java]
PXCMPlatformCameraControl.EnumPhotoProfile

Syntax
[C++]
pxcStatus EnumPhotoProfile(pxcI32 index, StreamProfile* profile);
[C#]
pxcmStatus EnumPhotoProfile(Int32 index, out StreamProfile profile);
[Java]
pxcmStatus EnumPhotoProfile(int index, StreamProfile profile);

Parameters
index

The zero-based index to enumerate all available


snapshot configurations.

profile

The snapshot stream configuration to be returned.


See the StreamProfile structure for definitions.

Description
The EnumPhotoProfile function enumerates all available snapshot configurations.
Return Status
STATUS_NO_ERROR

The function returned successfully.

STATUS_ITEM_UNAVAILABLE

There is no more snapshot configuration.

2.11.10.3.3 TakePhoto

Namespace Hierarchy
[C++]
PXCPlatformCameraControl::TakePhoto
[C#]
PXCMPlatformCameraControl.TakePhoto
[Java]
PXCMPlatformCameraControl.TakePhoto

310

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Syntax
[C++]
pxcStatus TakePhoto(StreamProfile& profile, Handler* handler);
[C#]
pxcmStatus TakePhoto(StreamProfile profile, Handler handler);
[Java]
pxcmStatus TakePhoto(StreamProfile profile, Handler handler);

Parameters
profile

The snapshot stream configuration. See the


StreamProfile structure for definitions.

hanlder

The snapshot callback handler. See the Handler


interface for definitions.

Description
The TakePhoto function initiates the snapshot operation. When ready, the platform
camera delivers the snapshot sample through the Handler callback.
Return Status
STATUS_NO_ERROR

The function returned successfully.

Examples
Example 60 shows how to take a snapshot photo.
Example 60: Take a Snapshot Photo

[C++]
class MyHandler: public PXCPlatformCameraControl::Handler {
public:
virtual void PXCAPI OnPlatformCameraSample(PXCCapture::Sample& sample)
{
}
virtual void PXCAPI OnPlatformCameraError() {
}
};
// pcc is a PXCPlatformCameraControl interface
// Retrieve the photo configuration
PXCCapture::Device::StreamProfile profile={};
pcc->EnumPhotoProfile(0, &profile);
311

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

// Take a photo
MyHandler handler;
pcc->TakePhoto(profile, &hanlder);
[C#]
static void OnPlatformCameraSample(PXCMCapture.Sample sample) {
}
static void OnPlatformCameraError() {
}
// pcc is a PXCMPlatformCameraControl interface
// Retrieve the photo configuration
PXCMCapture.Device.StreamProfile profile;
pcc.EnumPhotoProfile(0, out profile);
// Take a photo
PXCMPlatformCameraHandler handler=new PXCMPlatformCameraHandler() {
onPlatformCameraSample=OnPlatformCameraSample,
onPlatformCameraError=OnPlatformCameraError
};
pcc.TakePhoto(profile, hanlder);
[Java]
class MyHandler impements PXCMPlatformCameraControl.Handler {
public void OnPlatformCameraSample(PXCMCapture.Sample sample) {
}
public void OnPlatformCameraError() {
}
};
// pcc is a PXCMPlatformCameraControl interface
// Retrieve the photo configuration
PXCMCapture.Device.StreamProfile profile=new
PXCMCapture.Device.StreamProfile();
pcc.EnumPhotoProfile(0, profile);
// Take a photo
MyHandler handler=new MyHandler();
pcc.TakePhoto(profile, hanlder);

2.11.11 PowerState
Namespace Hierarchy
[C++]
PXCPowerState
[C#]
PXCMPowerState

312

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[Java]
PXCMPowerState

Description
The PowerState interface manages the SDK implementation power state. Any SDK I/
O or algorithm module implementation that is power aware exposes this interface.
The Session also exposes this interface for application-level power state control,
which you can use the CreatePowerManager function to create an instance.
Reference
[C++]
pxcpowerstate.h
[C#/.NET4]
libpxcclr.cs.dll
[C#/Unity]
libpxcclr.unity.dll
[Java]
libpxcclr.java.jar
[Processing]
libpxcclr_processing

Runtime
[C++][C#][Java]

Install SDK runtime: core


Example
The typical usage is that the application expresses its required operating power state as
illustrated in Example 61. The SDK implementations will adjust their settings accordingly.
Example 61: Specify the Application Power State

[C++]
// session is a PXCSession instance
PXCPowerState *ps=session->CreatePowerManager();
ps->SetState(PXCPowerState::STATE_BATTERY);
[C#]
// session is a PXCMSession instance
PXCMPowerState ps=session.CreatePowerManager();
ps.SetState(PXCMPowerState.PowerState.STATE_BATTERY);
[Java]
313

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

// session is a PXCMSession instance


PXCMPowerState ps=session.CreatePowerManager();
ps.SetState(PXCMPowerState.PowerState.STATE_BATTERY);

See Also
Constants
Member Functions

314

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.11.1 Constants

The PowerState interface exposes the following constants:


Constant

Description

CUID

The interface identifier.

2.11.11.2 Member Functions

The PowerState interface exposes the following member functions:


Member Functions

Description

QueryState

Query the current power state.

SetState

Set the power state.

QueryInactivityInterval

Query the inactivity interval.

SetInactivityInterval

Set the inactivity interval.

2.11.11.2.1 QueryInactivityInterval

Namespace Hierarchy
[C++]
PXCPowerState::QueryInactivityInterval
[C#]
PXCMPowerState.QueryInactivityInterval
[Java]
PXCMPowerState.QueryInactivityInterval

Syntax
[C++]
pxcI32 QueryInactivityInterval(void);
[C#]
Int32 QueryInactivityInterval();
[Java]
int QueryInactivityInterval();

Parameters
None

315

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Description
The QueryInactivityInterval function returns the currently set algorithm inactivity
internal value.
Return Status
The current inactivity internal value, in second.
2.11.11.2.2 QueryState

Namespace Hierarchy
[C++]
PXCPowerState::QueryState
[C#]
PXCMPowerState.QueryState
[Java]
PXCMPowerState.QueryState

Syntax
[C++]
State QueryState(void);
[C#]
State QueryState();
[Java]
State QueryState();

Parameters
None

Description
The QueryState function returns the current power state of an SDK module.
Return Status
The current power state mode. See the State enumerator for details.

316

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.11.2.3 SetInactivityInterval

Namespace Hierarchy
[C++]
PXCPowerState::SetInactivityInterval
[C#]
PXCMPowerState.SetInactivityInterval
[Java]
PXCMPowerState.SetInactivityInterval

Syntax
[C++]
pxcStatus SetInactivityInterval(pxcI32 interval);
[C#]
pxcmStatus SetInactivityInterval(Int32 interval);
[Java]
pxcmStatus SetInactivityInterval(int interval);

Parameters
interval

The interval value, in second.

Description
The SetInactivityInterval function sets the algorithm inactivity interval value. The
power state is switched to the power saving mode if there is extended period of
inactivity.
The inactivity definition is module specific. For example, for the hand module,
inactivity is defined as there is no hand in the scene. The SDK consolidate all running
module in-activities to determine the camera/device power state.
Return Status
STATUS_NO_ERROR

The function returned successfully.

2.11.11.2.4 SetState

Namespace Hierarchy
[C++]

317

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

PXCPowerState::SetState
[C#]
PXCMPowerState.SetState
[Java]
PXCMPowerState.SetState

Syntax
[C++]
pxcStatus SetState(State state);
[C#]
pxcmStatus SetState(State state);
[Java]
pxcmStatus SetState(State state);

Parameters
state

The desired power state. See the State


enumerator for details.

Description
The SetState function sets the module power state.
The SetState function works only when an active device is available. For the
application that uses the SenseManager interface, the application can only use the
SetState function after the Init function.
Return Status
STATUS_NO_ERROR

The function returned successfully.

STATUS_PARAM_UNSUPPORTED

The module does not support the specified


power state.

2.11.12 Projection
Namespace Hierarchy
[C++]
PXCProjection

318

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C#]
PXCMProjection
[Java]
PXCMProjection

Description
The Projection interface provides functions to map or project among color, depth
and world coordinates.
The application can use the CreateProjection function to create an instance of the
Projection interface.
The Projection interface implements the Calibration interface. You can get
device calibration and transformation parameters from the Calibration interface.
Reference
[C++]
pxcprojection.h
[C#/.NET4]
libpxcclr.cs.dll
[C#/Unity]
libpxcclr.unity.dll
[Java]
libpxcclr.java.jar
[Processing]
libpxcclr_processing

Runtime
[C++][C#][Java]

Install SDK runtime: core


Example
Example 62 shows how to create a projection instance.
Example 62: Create a Projection Instance

[C++]
/* device is an instance of the PXCCapture::Device interface */
PXCProjection *projection=device->CreateProjection();

319

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

...
/* Release the interface */
projection->Release();
[C#]
/* device is an instance of the PXCMCapture.Device interface */
PXCMProjection projection=device.CreateProjection();
...
/* Dispose the interface */
projection.Dispose();
[Java]
/* device is an instance of the PXCMCapture.Device interface */
PXCMProjection projection=device.CreateProjection();
...
/* Release the interface */
projection.close();

See Also
Constants
Member Functions

320

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.12.1 Constants

The Projection interface exposes the following constants:


Constant

Description

CUID

The interface identifier.

2.11.12.2 Member Functions

The Projection interface exposes the following member functions:


Member Functions

Description

MapColorToDepth

Map depth to color image coordinates.

MapDepthToColor

Map color to depth image coordinates.

ProjectDepthToCamera

Map depth to world coordinates.

ProjectColorToCamera

Map color to world coordinates.

ProjectCameraToDepth

Map world to depth coordinates.

ProjectCameraToColor

Map world to color coordinates.

QueryUVMap

Calculate the UV map.

QueryInvUVMap

Calculate the inverse UV map.

QueryVertices

Calculate the vertices.

CreateColorImageMappedToDepth

Create a color image that is spatially and size aligned


with the depth image.

CreateDepthImageMappedToColor

Create a depth image that is spatially and size aligned


with the color image.

SelectOption

Select the projection implementations based on


options.

2.11.12.2.1 CreateColorImageMappedToDepth

Namespace Hierarchy
[C++]
PXCProjection::CreateColorImageMappedToDepth
[C#]
PXCMProjection.CreateColorImageMappedToDepth
[Java]
PXCMProjection.CreateColorImageMappedToDepth
321

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Syntax
[C++]
PXCImage CreateColorImageMappedToDepth(PXCImage *depth, PXCImage *color);
[C#]
PXCMImage CreateColorImageMappedToDepth(PXCMImage depth, PXCMImage
color);
[Java]
PXCMImage CreateColorImageMappedToDepth(PXCMImage depth, PXCMImage
color);

Parameters
depth

The depth image instance.

color

The color image instance.

Description
The CreateColorImageMappedToDepth function creates a color image that is spatially
aligned with, and the same size as the depth image. Each input color image pixels are
mapped to the output color image.
Return Status
The created color image instance. The application must release the instance after
use.
2.11.12.2.2 CreateDepthImageMappedToColor

Namespace Hierarchy
[C++]
PXCProjection::CreateDepthImageMappedToColor
[C#]
PXCMProjection.CreateDepthImageMappedToColor
[Java]
PXCMProjection.CreateDepthImageMappedToColor

Syntax
[C++]
322

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

PXCImage CreateDepthImageMappedToColor(PXCImage *depth, PXCImage *color);


[C#]
PXCMImage CreateDepthImageMappedToColor(PXCMImage depth, PXCMImage
color);
[Java]
PXCMImage CreateDepthImageMappedToColor(PXCMImage depth, PXCMImage
color);

Parameters
depth

The depth image instance.

color

The color image instance.

Description
The CreateDepthImageMappedToColor function creates a depth image that is
spatially aligned with, and the same size as the color image. Each input depth image
pixels are mapped to the output depth image.
Return Status
The created depth image instance. The application must release the instance after
use.
2.11.12.2.3 MapColorToDepth

Namespace Hierarchy
[C++]
PXCProjection::MapColorToDepth
[C#]
PXCMProjection.MapColorToDepth
[Java]
PXCMProjection.MapColorToDepth

Syntax
[C++]
pxcStatus MapColorToDepth(PXCImage *depth, pxcI32 npoints, PXCPointF32
*pos_ij, PXCPointF32 *pos_uv);
[C#]
323

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

pxcmStatus MapColorToDepth(PXCMImage depth, PXCMPointF32[] pos_ij,


PXCMPointF32[] pos_uv);
[Java]
pxcmStatus MapColorToDepth(PXCMImage depth, PXCMPointF32[] pos_ij,
PXCMPointF32[] pos_uv);

Parameters
depth

The depth image instance.

npoints

Number of points to map.

pos_ij

An array of color coordinates

pos_uv

An array of depth coordinates to be mapped.

Description
The MapColorToDepth function maps an array of color coordinates to depth
coordinates.
If the function fails to map certain coordinates, for example, some color value is
floored or saturated, the function returns (-1,-1) in the depth coordinates to
indicate the failure.
Return Status
STATUS_NO_ERROR

324

Intel RealSense SDK 2016 R2 Reference Manual

The function returned successfully.

2010-2016 Intel Corporation

2.11.12.2.4 MapDepthToColor

Namespace Hierarchy
[C++]
PXCProjection::MapDepthToColor
[C#]
PXCMProjection.MapDepthToColor
[Java]
PXCMProjection.MapDepthToColor

Syntax
[C++]
pxcStatus MapDepthToColor(pxcI32 npoints, PXCPoint3DF32 *pos_uvz,
PXCPointF32 *pos_ij);
[C#]
pxcmStatus MapDepthToColor(PXCMPoint3DF32[] pos_uvz, PXCMPointF32[]
pos_ij);
[Java]
pxcmStatus MapDepthToColor(PXCMPoint3DF32[] pos_uvz, PXCMPointF32[]
pos_ij);

Parameters
npoints

Number of points to map.

pos_uvz

An array of depth coordinates in the Point3DF32


structure. The application must fill the z field with the
depth value.

pos_ij

An array of color coordinates to be mapped.

Description
The MapDepthToColor function maps an array of depth coordinates to color
coordinates.
If the function fails to map certain coordinates, for example, some depth value is
floored or saturated, the function returns (-1,-1) in the color coordinates to indicate
the failure.
Return Status

325

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

STATUS_NO_ERROR

The function returned successfully.

2.11.12.2.5 ProjectCameraToColor

Namespace Hierarchy
[C++]
PXCProjection::ProjectCameraToColor
[C#]
PXCMProjection.ProjectCameraToColor
[Java]
PXCMProjection.ProjectCameraToColor

Syntax
[C++]
pxcStatus ProjectCameraToColor(pxcI32 npoints, PXCPoint3DF32 *pos3d,
PXCPointF32 *pos_ij);
[C#]
pxcmStatus ProjectCameraToColor(PXCMPoint3DF32[] pos3d, PXCMPointF32[]
pos_ij);
[Java]
pxcmStatus ProjectCameraToColor(PXCMPoint3DF32[] pos3d, PXCMPointF32[]
pos_ij);

Parameters
npoints

Number of points to map.

pos3d

An array of real world coordinates.

pos_ij

An array of color image coordinates to be projected.

Description

326

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The ProjectCameraToColor function projects an array of world coordinates to the


color image coordinates.
If the function fails to project certain coordinates, for example, some world coordinate
value is floored or saturated, the function returns (-1,-1) in the color coordinates to
indicate the failure.
The world coordinates uses the camera coordinate system. The values are in mm.
Return Status
STATUS_NO_ERROR

The function returned successfully.

2.11.12.2.6 ProjectCameraToDepth

Namespace Hierarchy
[C++]
PXCProjection::ProjectCameraToDepth
[C#]
PXCMProjection.ProjectCameraToDepth
[Java]
PXCMProjection.ProjectCameraToDepth

Syntax
[C++]
pxcStatus ProjectCameraToDepth(pxcI32 npoints, PXCPoint3DF32 *pos3d,
PXCPointF32 *pos_uv);
[C#]
pxcmStatus ProjectCameraToDepth(PXCMPoint3DF32[] pos3d, PXCMPointF32[]
pos_uv);
[Java]
pxcmStatus ProjectCameraToDepth(PXCMPoint3DF32[] pos3d, PXCMPointF32[]
pos_uv);

Parameters

327

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

npoints

Number of points to map.

pos3d

An array of real world coordinates.

pos_uv

An array of depth image coordinates to be projected.

Description
The ProjectCameraToDepth function projects an array of world coordinates to the
depth image coordinates.
If the function fails to project certain coordinates, for example, some world coordinate
value is floored or saturated, the function returns (-1,-1) in the depth coordinates to
indicate the failure.
The world coordinates uses the camera coordinate system. The values are in mm.
Return Status
STATUS_NO_ERROR

The function returned successfully.

2.11.12.2.7 ProjectColorToCamera

Namespace Hierarchy
[C++]
PXCProjection::ProjectColorToCamera
[C#]
PXCMProjection.ProjectColorToCamera
[Java]
PXCMProjection.ProjectColorToCamera

Syntax
[C++]
pxcStatus ProjectColorToCamera(pxcI32 npoints, PXCPoint3DF32 *pos_ijz,
PXCPoint3DF32 *pos3d);
[C#]
pxcmStatus ProjectColorToCamera(PXCMPoint3DF32[] pos_ijz,
PXCMPoint3DF32[] pos3d);
[Java]

328

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

pxcmStatus ProjectColorToCamera(PXCMPoint3DF32[] pos_ijz,


PXCMPoint3DF32[] pos3d);

Parameters
npoints

Number of points to map.

pos_ijz

An array of color coordinates in the Point3DF32


structure. The application must fill the z field with the
corresponding depth value.

pos3d

An array of world coordinates to be mapped.

Description
The ProjectColorToCamera function projects color image coordinates to the world
coordinates.
The world coordinates uses the camera coordinate system. The values are in mm.
Return Status
STATUS_NO_ERROR

The function returned successfully.

2.11.12.2.8 ProjectDepthToCamera

Namespace Hierarchy
[C++]
PXCProjection::ProjectDepthToCamera
[C#]
PXCMProjection.ProjectDepthToCamera
[Java]
PXCMProjection.ProjectDepthToCamera

Syntax
[C++]
pxcStatus ProjectDepthToCamera(pxcI32 npoints, PXCPoint3DF32 *pos_uvz,
PXCPoint3DF32 *pos3d);
[C#]
pxcmStatus ProjectDepthToCamera(PXCMPoint3DF32[] pos_uvz,
PXCMPoint3DF32[] pos3d);

329

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[Java]
pxcmStatus ProjectDepthToCamera(PXCMPoint3DF32[] pos_uvz,
PXCMPoint3DF32[] pos3d);

Parameters
npoints

Number of points to map.

pos_uvz

An array of depth coordinates in the Point3DF32


structure. The application must fill the z field with the
depth value.

pos3d

An array of world coordinates to be mapped.

Description
The ProjectDepthToCamera function projects depth image coordinates to the world
coordinates.
The world coordinates uses the camera coordinate system. The values are in mm.
Return Status
STATUS_NO_ERROR

The function returned successfully.

2.11.12.2.9 QueryInvUVMap

Namespace Hierarchy
[C++]
PXCProjection::QueryInvUVMap
[C#]
PXCMProjection.QueryInvUVMap
[Java]
PXCMProjection.QueryInvUVMap

Syntax
[C++]
pxcStatus QueryInvUVMap(PXCImage *depth, PXCPointF32 *inv_uvmap);
[C#]
pxcmStatus QueryInvUVMap(PXCMImage depth, PXCMPointF32[] inv_uvmap);

330

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[Java]
pxcmStatus QueryInvUVMap(PXCMImage depth, PXCMPointF32[] inv_uvmap);

Parameters
depth

The depth image instance.

uvmap

An array of size color width*height to receive the


Inverse UV map.

Description
The QueryInvUVMap function calculates the Inverse UV map from the depth image.
The Inverse UV map is a PointF32 array of size color width*height. Each pixel value
is a pair of resolution-normalized multipliers that can be used to map the color
coordinates to the depth coordinates as follows:

u
v

InvUVMap[i, j ]. x * depth _ width


InvUVMap[i, j ]. y * depth _ height

where (i,j) is the color pixel, and (u,v) is the mapped depth pixel.
Return Status
STATUS_NO_ERROR

The function returned successfully.

2.11.12.2.10 QueryUVMap

Namespace Hierarchy
[C++]
PXCProjection::QueryUVMap
[C#]
PXCMProjection.QueryUVMap
[Java]
PXCMProjection.QueryUVMap

Syntax
[C++]
pxcStatus QueryUVMap(PXCImage *depth, PXCPointF32 *uvmap);
[C#]
331

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

pxcmStatus QueryUVMap(PXCMImage depth, PXCMPointF32[] uvmap);


[Java]
pxcmStatus QueryUVMap(PXCMImage depth, PXCMPointF32[] uvmap);

Parameters
depth

The depth image instance.

uvmap

An array of size depth width*height to receive the


UV map.

Description
The QueryUVMap function calculates the UV map from the depth image. The UV map
is a PointF32 array of size depth width*height. Each pixel value is a pair of
resolution-normalized multipliers that can be used to map the depth coordinates to
the color coordinates as follows:

i UVMap[u, v ]. x * color _ width


j UVMap[u, v ]. y * color _ height
where (u,v) is the depth pixel, and (i,j) is the mapped color pixel.
Return Status
STATUS_NO_ERROR

The function returned successfully.

2.11.12.2.11 QueryVertices

Namespace Hierarchy
[C++]
PXCProjection::QueryVertices
[C#]
PXCMProjection.QueryVertices
[Java]
PXCMProjection.QueryVertices

Syntax
[C++]
pxcStatus QueryVertices(PXCImage *depth, PXCPoint3DF32 *vertices);

332

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C#]
pxcmStatus QueryVertices(PXCMImage depth, PXCMPoint3DF32[] vertices);
[Java]
pxcmStatus QueryVertices(PXCMImage depth, PXCMPoint3DF32[] vertices);

Parameters
depth

The depth image instance.

vertices

An array of size depth width*height to receive the


vertices.

Description
The QueryVertices function calculates the vertices from the depth image. The
vertices contain the world coordinates in mm.
Return Status
STATUS_NO_ERROR

The function returned successfully.

2.11.12.2.12 SelectOption

Namespace Hierarchy
[C++]
PXCProjection::SelectOption
[C#]
PXCMProjection.SelectOption
[Java]
PXCMProjection.SelectOption

Syntax
[C++]
PXCProjection SelectOption(ProjectionOption option);
[C#]
PXCMProjection SelectOption(ProjectionOption option);
[Java]
PXCMProjection SelectOption(ProjectionOption option);

333

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Parameters
option

The projection option; see the ProjectionOption


enumerator for details.

Description
The SelectOption function selects a different projection function implementation
with the specific options.
Do not release the returned Projection instance.
Return Status
The Projection instance.

2.11.13 SampleReader (UWP)


Namespace Hierarchy
Intel.Realsense.SampleReader

Description
The SampleReader interface provides member functions to enable streaming raw
color and depth samples from the I/O device.
You can use the Activate function to create an instance of the SampleReader
interface.
Reference
Intel.Realsense

Examples
Example 63 shows how to stream a color stream.
Example 63: Configure and Stream a Color Stream

using Intel.RealSense;
// Create a SenseManager instance
SenseManager sm=SenseManager.CreateInstance();

334

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

// Enable blob tracking


SampleReader reader=SampleReader.Activate(sm, StreamType.STREAM_TYPE_COLOR,
640, 480, 30);
// Initialize
sm.Init();
// Stream Data
while (sm.AcquireFrame(true)>=Status.STATUS_NO_ERROR) {
// Working on reader.Sample
....
// Resume next frame processing
sm.ReleaseFrame();
}
// Clean up
sm.Dispose();

See Also
Events
Member Functions
Properties
Static Functions

335

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.13.1 Events

The SampleReader interface provides the following events:


Event

Description

SampleArrived (UWP)

Invoke when there is any streaming sample


from the I/O device.

2.11.13.1.1 SampleArrived (UWP)

Namespace Hierarchy
Intel.RealSense.SampleReader.SampleArrived

Syntax
void SampleArrived(Object sender, SampleArrivedEventArgs args);

Parameters
sender

The SampleReader instance.

args

The SampleArrivedEventArgs instance that contains the


event parameters.

Description
The SampleArrived function is invoked when a camera sample is available.
Return Status
None

336

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.13.1.1.1 SampleArrivedEventArgs (UWP)

Namespace Hierarchy
Intel.RealSense.SampleArrivedEventArgs

Definition
class SampleArrivedEventArgs {
Sample Sample;
};

Description
The SampleArrivedEventArgs structure describes the SampleArrived event
parameters.
Members
Sample

The Sample instance.

2.11.13.2 Member Functions

The SampleReader interface provides the following member functions:


Member Function

Description

EnableStream[s] (UWP)

Request streaming with the stream


configuration(s).

2.11.13.2.1 EnableStream[s] (UWP)

Namespace Hierarchy
Intel.RealSense.SampleReader.EnableStream
Intel.RealSense.SampleReader.EnableStreams

Syntax
void EnableStream(StreamType type, int width, int height,
Single fps, StreamOption options);
void EnableStream(StreamType type, int width, int height,
Single fps);
void EnableStreams(IReadOnlyDictionary<StreamType,
PerceptionVideoProfile> profiles);

337

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Parameters
type

The stream type; see the StreamType enumerator for


definitions.

width

The image width in pixels.

height

The image height in pixels.

fps

The frame rate in frames per second.

options

The optional stream options; See the StreamOption


enumerator for definitions.

profiles

Specify the configuration of a set of streams.

Description
The EnableStream[s] function activates single or multiple synchronized
stream reads in the SenseManager pipeline.
If you use this function to enable multiple streams, the SDK synchronizes all
streams and deliver the samples at the same time.
Create multiple SampleReader instances if you need to read unaligned
samples from different streams.
Return Status
None
2.11.13.3 Properties

The SampleReader interface provides the following properties:


Property

Description

sample (UWP)

Get the available sample from the I/O device.

paused (UWP)

Pause/resume sample reading.

2.11.13.3.1 sample (UWP)

Namespace Hierarchy

338

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Intel.RealSense.SampleReader.Sample

Syntax
Sample Sample {
get
};

Description
The sample property returns the available sample (explicitly enabled by the
EnableStream function) from the capture device. If there is no sample
available, the property returns null.
2.11.13.3.2 paused (UWP)

Namespace Hierarchy
Intel.RealSense.SampleReader.Paused

Syntax
Boolean Paused {
get; set;
};

Description
The paused property pauses/resumes sample reading. If paused=false, the
SampleReader no longer accepts samples from the I/O device.
2.11.13.4 Static Functions

The SampleReader interface provides the following static functions:


Static Functions

Description

Activate (UWP)

Activate single or multiple stream reads in the


SenseManager pipeline.

2.11.13.4.1 Activate (UWP)

Namespace Hierarchy
Intel.RealSense.SampleReader.Activate

339

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Syntax
static SampleReader Activate(SenseManager sm, StreamType type,
int width, int height, Single fps, StreamOption options);
static SampleReader Activate(SenseManager sm, StreamType type,
int width, int height, Single fps);
static SampleReader Activate(SenseManager sm);

Parameters
sm

The SenseManager instance.

type

The optional stream type; See the StreamType


enumerator for definitions.

width

The optional stream width in pixels.

height

The optional stream height in pixels.

fps

The optional frame rate in frame per seconds.

options

The stream options; See the StreamOption enumerator


for definitions.

Description
The Activate function activates single or multiple stream reads in the
SenseManager pipeline.
Within the SampleReader instance, all initiated stream reads are synchronized.
To read unaligned streams, create multiple SampleReader instances and
enable a different stream for each SampleReader instance.
If you specify any stream configuration, the function invokes the
EnableStream function with the specified stream configuration.
Return Status
The SampleReader instance, or NULL/null if there is any error.

340

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.14 SenseManager (+JS,+UWP)


Namespace Hierarchy
[C++]
PXCSenseManager
[C#]
PXCMSenseManager
[Java]
PXCMSenseManager
[JavaScript]
intel.realsense.SenseManager
[C#/UWP]
Intel.Realsense.SenseManager

Description
The SenseManager helper interface provides a simple interface for some common
application usage cases, that is, one or more processing modules (such as hand
tracking, face analysis and voice recognition) connects directly to an I/O device (or a
playback file).
The general procedure for using the SenseManager interface is as follows:
Configure: The application uses the EnableXXXX set of functions (or the
CreateInstance function from the algorithm interface) to configure the
pipeline. For example, use the EnableStream function to specify a video
stream.
Initialize: The application calls the Init function to initialize the pipeline.
Run the pipeline: The application calls the StreamFrames function (or the
equivalent set of AcquireFrame/ReleaseFrame functions) to loop frames
among the pipeline components.
Handle events: Optionally, the application can override the callback/
delegate/event functions to handle events.
The application can use the CreateInstance function to create an instance of the
SenseManager interface.
Reference
[C++]
pxcsensemanager.h
341

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C#/.NET4]
libpxcclr.cs.dll
[C#/Unity]
libpxcclr.unity.dll
[Java]
libpxcclr.java.jar
[Processing]
libpxcclr_processing
[JavaScript]
realsense.js
[C#/UWP]
Intel.Realsense

Runtime
[C++][C#][Java][JavaScript]

Install SDK runtime: core


Examples
Example 64 shows how to create a SenseManager instance and stream a color stream, and
Example 65 shows how to use the SenseManager interface for blob tracking.
Example 64: Configure and Stream a Color Stream

[C++]
// Create a SenseManager instance
PXCSenseManager *sm=PXCSenseManager::CreateInstance();
// Enable the video stream
sm->EnableStream(PXCCapture::STREAM_TYPE_COLOR,0,0,0);
// Initialization
sm->Init();
// Stream data
while (sm->AcquireFrame(true)>=PXC_STATUS_NO_ERROR) {
// Get the sample data
PXCCapture::Sample *sample=sm->QuerySample();
.... // process image sample->color
// Resume next frame processing
sm->ReleaseFrame();
}

342

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

// Clean up
sm->Release();
[C#]
// Create a SenseManager instance
PXCMSenseManager sm=PXCMSenseManager.CreateInstance();
// Enable a video stream
sm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_COLOR,0,0,0);
// Initialize
sm.Init();
// Stream Data
while (sm.AcquireFrame(true).IsSuccessful()) {
// Get the sample data
PXCMCapture.Sample sample=sm.QuerySample();
.... // process image sample.color
// Resume next frame processing
sm.ReleaseFrame();
}
// Clean up
sm.Dispose();
[Java]
// Create a SenseManager instance
PXCMSenseManager sm=PXCMSenseManager.CreateInstance();
// Enable a video stream
sm.EnableStream(PXCMCapture.StreamType.STREAM_TYPE_COLOR,0,0,0);
// Initialize
sm.Init();
// Stream Data
while (sm.AcquireFrame(true).isSuccessful()) {
// Get the sample data
PXCMCapture.Sample sample=sm.QuerySample();
.... // process image sample.color
// Resume next frame processing
sm.ReleaseFrame();
}
// Clean up
sm.close();
[JavaScript]

343

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

To protect user privacy, it is not allowed to stream raw or processed images in JavaScript.
[C#/UWP]
using Intel.RealSense;
// Create a SenseManager instance
SenseManager sm=SenseManager.CreateInstance();
// Enable blob tracking
SampleReader reader=SampleReader.Activate(sm, StreamType.STREAM_TYPE_COLOR,
640, 480, 30);
// Initialize
sm.Init();
// Stream Data
while (sm.AcquireFrame(true)>=Status.STATUS_NO_ERROR) {
// Working on reader.Sample
....
// Resume next frame processing
sm.ReleaseFrame();
}
// Clean up
sm.Dispose();
Example 65: Configure and Perform Blob Tracking

[C++]
// Create a SenseManager instance
PXCSenseManager *sm=PXCSenseManager::CreateInstance();
// Enable blob tracking
sm->EnableBlob();
// Initialization
sm->Init();
// Stream data
while (sm->AcquireFrame(true)>=PXC_STATUS_NO_ERROR) {
// Get the blob data
PXCBlobModule *blob=sm->QueryBlob();
....
// Resume next frame processing
sm->ReleaseFrame();
}
// Clean up
sm->Release();
344

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C#]
// Create a SenseManager instance
PXCMSenseManager sm=PXCMSenseManager.CreateInstance();
// Enable blob tracking
sm.EnableBlob();
// Initialize
sm.Init();
// Stream Data
while (sm.AcquireFrame(true).IsSuccessful()) {
// Get the blob data
PXCMBlobModule blob=sm.QueryBlob();
....
// Resume next frame processing
sm.ReleaseFrame();
}
// Clean up
sm.Dispose();
[Java]
// Create a SenseManager instance
PXCMSenseManager sm=PXCMSenseManager.CreateInstance();
// Enable blob tracking
sm.EnableBlob();
// Initialize
sm.Init();
// Stream Data
while (sm.AcquireFrame(true).isSuccessful()) {
// Get the blob data
PXCMBlobModule blob=sm.QueryBlob();
....
// Resume next frame processing
sm.ReleaseFrame();
}
// Clean up
sm.close();
[JavaScript]
// name space shortcuts
var rs=intel.realsense;
var rsb=intel.realsense.blob;
345

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

// the SenseManager instance


var sm;
// the blob module instance
var bm;
// Close when page goes away
// See also https://developer.mozilla.org/en-US/docs/Web/Guide/
User_experience/Using_the_Page_Visibility_API about page visibility change.
window.beforeunload=function() {
if (sm!=undefined) {
sm.release().then(function() {
sm=bm=undefined;
}
}
}
// Resume processing when page is active
window.onfocus=function() {
if (bm!=undefined) {
sm.captureManager.device.restorePropertiesUponFocus();
bm.pause(false);
}
}
// Pause processing when page is inactive
window.onblur=function() {
if (bm!=undefined) {
bm.pause(true);
}
}
// Process blob data when ready
function onBlobData(sender, data) {
....
}
// Create a SenseManager instance
rs.SenseManager.createInstance().then(function(instance) {
sm=instance
return rsb.BlobModule.activate(sm);
}).then(function(instance) {
bm=instance;
// Set the data handler.
bm.onFrameProcessed=onBlobData;
// Initialize the SenseManager
return sm.init();
}).then(status) {
return sm.streamFrames();
});

346

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C#/UWP]
using Intel.RealSense;
using Intel.RealSense.Blob;
// Create a SenseManager instance
SenseManager sm=SenseManager.CreateInstance();
// Enable blob tracking
BlobModule blob=BlobModule.Activate(sm);
BlobData data=blob.CreateOutput();
// Initialize
sm.Init();
// Stream Data
while (sm.AcquireFrame(true)>=Status.STATUS_NO_ERROR) {
// Get the blob data
data.Update();
....
// Resume next frame processing
sm.ReleaseFrame();
}
// Clean up
sm.Dispose();

See Also

347

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Constants
Callbacks and Delegates
Events
Member Functions Essentials
Member Functions (3D Scanning)
Member Functions (Blob Tracking)
Member Functions (Enhanced Video)
Member Functions (Face Tracking)
Member Functions (Hand Cursor)
Member Functions (Hand Tracking)
Member Functions (Object Recognition)
Member Functions (Object Tracking)
Member Functions (Person Tracking)
Member Functions (Scene Perception)
Member Functions (Stream Capture)
Member Functions (Touchless Controller)
Member Functions (User Segmentation)
Properties (C#)
Static Functions

348

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.14.1 Constants

The SenseManager interface exposes the following constants:


Constant

Description

CUID

The interface identifier.

2.11.14.2 Callbacks and Delegates

The SenseManager interface provides the following callback functions/delegates:


Callback/Delegate

Description

Handler

Callbacks and delegates during initialization and


frame looping.

2.11.14.2.1 Handler

Namespace Hierarchy
[C++]
PXCSenseManager::Handler
[C#]
PXCMSenseManager.Handler
[Java]
PXCMSenseManager.Handler

Description
The Handler interface is a set of callback functions/delegates to be used during the
SenseManager initialization and frame looping operations. The application must
implement the interface.
Examples
Example 66 shows how to create a handler.
Example 66: Create a Handler

[C++]
class MyHandler: public PXCSenseManager::Handler {
public:
virtual pxcStatus PXCAPI OnConnect(PXCCapture::Device *device, pxcBool
connected) {
return PXC_STATUS_DEVICE_FAILED;
}

349

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

virtual pxcStatus PXCAPI OnModuleProcessFrame(pxcUID mid, PXCBase*


object) {
return PXC_STATUS_NO_ERROR;
}
};
// sm is a PXCSenseManager instance.
MyHandler handler;
sm->Init(&handler);
[C#]
static pxcmStatus OnConnect(PXCMCapture.Device device, bool connected) {
return pxcmStatus.PXCM_STATUS_DEVICE_FAILED;
}
static pxcmStatus OnModuleProcessFrame(int mid, PXCMBase object) {
return pxcmStatus.PXCM_STATUS_NO_ERROR;
}
// sm is a PXCMSenseManager instance
PXCMSenseManager.Handler handler=new PXCMSenseManager.Handler();
handler.onConnect=OnConnect;
handler.onModuleProcessFrame=OnModuleProcessFrame;
sm.Init(handler);
[Java]
class MyHandler impements PXCMSenseManager.Handler {
public pxcmStatus OnConnect(PXCMCapture.Device device, boolean
connected) {
return pxcmStatus.PXCM_STATUS_DEVICE_FAILED;
}
public pxcmStatus OnModuleProcessFrame(int mid, PXCMBase object) {
return pxcmStatus.PXCM_STATUS_NO_ERROR;
}
};
// sm is a PXCMSenseManager instance
MyHandler handler=new MyHandler();
sm.Init(handler);

See Also
Member Functions

350

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.14.2.1.1 Member Functions

The Handler interface provides the following callback functions/delegates:


Callback/Delegate

Description

OnNewSample

Events occur during streaming, when a captured


image sample is available.

OnModuleProcessedFrame

Events occur during streaming, when processing


module data is available.

OnModuleSetProfile

Events occur during initialization, before the


module configuration is set.

OnConnect

Event occurs during streaming, when the device is


disconnected or reconnected.

OnStatus

Event occurs during streaming, when a module


issues any warning or error.

Namespace Hierarchy
[C++]
PXCSenseManager::Handler::OnConnect
[C#]
PXCMSenseManager.Handler.onConnect
[Java]
PXCMSenseManager.Handler.onConnect

Syntax
[C++]
pxcStatus OnConnect(PXCCapture::Device *device, pxcBool connected);
[C#]
delegate pxcmStatus OnConnectDelegate(PXCMCapture.Device device, Boolean
connected);
[Java]
pxcmStatus OnConnect(PXCMCapture.Device device, boolean connected);

Parameters

351

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

device

The I/O device instance.

connected

If true, the I/O device is re-connected. If false, the I/O device


is disconnected.

Description
The OnConenct function is invoked in the following cases:
During initialization (Init), when the SDK checks for each I/O device for a suitable
input device, the function is invoked when an I/O device is created
(connected=true) or skipped (connected=false). The SDK ignores the function
return code.
During streaming, when the I/O device is unplugged or replugged. The application
can use to display a message for device reconnection. If the function returns
STATUS_NO_ERROR, the SDK waits for device reconnection. Otherwise, the SDK
breaks the streaming loop with STATUS_DEVICE_LOST.
The application should not perform any lengthy operation in the callback function.
Return Status
STATUS_NO Continue the processing loop. In the case of device disconnection, wait for
_ERROR
the device to reconnect.

Any error
code

352

During streaming, any error code will abort the streaming loop.

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Namespace Hierarchy
[C++]
PXCSenseManager::Handler::OnModuleProcessedFrame
[C#]
PXCMSenseManager.Handler.onModuleProcessedFrame
[Java]
PXCMSenseManager.Handler.onModuleProcessedFrame

Syntax
[C++]
pxcStatus OnModuleProcessedFrame(pxcUID mid, PXCBase *module, Sample
*sample);
[C#]
delegate pxcmStatus OnModuleProcessedFrameDelegate(Int32 mid, PXCMBase
module, Sample sample);
[Java]
pxcmStatus OnModuleProcessedFrame(int mid, PXCMBase module, Sample
sample);

Parameters
mid

The module identifier; usually this is the interface


identifier.

module

The module instance.

sample

The images that the module just worked on.

Description
The OnModuleProcessedFrame function is invoked when a module has completed its
processing of the current frame. The module output is ready at this point. You can use
this function to retrieve the module output.
If you use AcquireFrame/ReleaseFrame, or StreamFrames(true), the function is
invoked from the same thread. If you use StreamFrames(false), the function is
invoked from a dedicated thread.
You should not perform any lengthy operation in the callback function.
Return Status
353

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

STATUS_NO_ERROR

Continue the processing loop.

Any error code

Abort the processing loop.

Remarks
The module instance is an object that SenseManager internally manages. Do not
release the module instance.

Namespace Hierarchy
[C++]
PXCSenseManager::Handler::OnModuleSetProfile
[C#]
PXCMSenseManager.Handler.onModuleSetProfile
[Java]
PXCMSenseManager.Handler.onModuleSetProfile

Syntax
[C++]
pxcStatus OnModuleSetProfile(pxcUID mid, PXCBase *object);
[C#]
delegate pxcmStatus OnModuleSetProfileDelegate(Int32 mid, PXCMBase
object);
[Java]
pxcmStatus OnModuleSetProfile(int mid, PXCMBase object);

Parameters
mid

The module identifier; usually this is the interface


identifier.

object

The module instance.

Description

354

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The OnModuleSetProfile function is invoked after initializing a module. The


application can use this function to query the current configuration parameters or
reject current settings.
The application should not perform any lengthy operation in the callback function.
Return Status
STATUS_NO_ERROR

Accept the current settings and continue the


processing loop.

Any error code

Reject the current settings and skip to the next


configuration.

Remarks
The module instance is an object that SenseManager internally manages. Do not
release the module instance.

Namespace Hierarchy
[C++]
PXCSenseManager::Handler::OnNewSample
[C#]
PXCMSenseManager.Handler.onNewSample
[Java]
PXCMSenseManager.Handler.onNewSample

Syntax
[C++]
pxcStatus OnNewSample(pxcUID mid, Sample *sample);
[C#]
delegate pxcmStatus OnNewSampleDelegate(Int32 mid, Sample sample);
[Java]
delegate pxcmStatus OnNewSampleDelegate(Int32 mid, Sample sample);

Parameters

355

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

mid

The stream identifier. If multiple streams are requested through the


EnableVideoStream[s] function, this is PXCCapture.CUID+0, or
PXCCapture.CUID+1....

sample

The available image sample(s).

Description
The OnNewSample function is invoked when some image sample(s) is/are available
when requested from the EnableVideoStream[s] functions.
The application should not perform any lengthy operation in the callback function.
Return Status
STATUS_NO_ERROR

Continue the processing loop.

Any error code

Abort the processing loop.

Remarks
The image sample instances are objects that SenseManager internally manages. Do
not release any sample instances.

Namespace Hierarchy
[C++]
PXCSenseManager::Handler::OnStatus
[C#]
PXCMSenseManager.Handler.onStatus
[Java]
PXCMSenseManager.Handler.onStatus

Syntax
[C++]
void OnStatus(pxcUID mid, pxcStatus status);
[C#]
delegate void OnStatusDelegate(Int32 mid, pxcmStatus status);
[Java]
void OnStatus(int mid, pxcmStatus status);
356

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Parameters
mid

The stream identifier. If multiple streams are requested through the


EnableVideoStream[s] function, this is PXCCapture.CUID+0, or
PXCCapture.CUID+1....

status

The status code. See the Status for definitions.

Description
The OnStatus function is invoked when there is any error or warning during
streaming. The module identifier indicates the module that issues the error or
warning.
The application should not perform any lengthy operation in the callback function.
Return Status
None

2.11.14.3 Events

The SenseManager interface provides the following events:


Callback/Delegate

Description

DeviceConnected (JS,UWP)

Event occurs during streaming, when the


device is disconnected or reconnected.

StatusChanged (JS,UWP)

Event occurs during streaming, when a


module issues any warning or error.

2.11.14.3.1 DeviceConnected (JS,UWP)

Namespace Hierarchy
[JavaScript]
intel.realsense.SenseManager.onDeviceConnected
[C#/UWP]
Intel.RealSense.SenseManager.DeviceConnected

Syntax
[JavaScript]

357

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

function onDeviceConnected(sender, connected);


[C#/UWP]
void DeviceConnected(Object sender, DeviceConnectedEventArgs args);

Parameters
sender

The Device instance.

connected

If true, the I/O device is re-connected. If false, the I/O device


is disconnected.

args

The DeviceConnectedEventArgs instance that contains the


event parameters.

Description
The DeviceConencted function is invoked in the following cases:
During initialization (Init), when the SDK checks for each I/O device for a suitable
input device, the function is invoked when an I/O device is created
(connected=true) or skipped (connected=false).
During streaming, when the I/O device is unplugged or replugged. The application
can use to display a message for device reconnection.
The application should not perform any lengthy operation in the callback
function.
Return Status
None

358

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.14.3.1.1 DeviceConnectedEventArgs (UWP)

Namespace Hierarchy
Intel.RealSense.DeviceConnectedEventArgs

Definition
class DeviceConnectedEventArgs {
Boolean Connected;
};

Description
The DeviceConnectedEventArgs structure describes the event parameters of the
OnConnect event.
Members
connect

If true, the I/O device is re-connected. If false, the I/O device is


disconnected.

2.11.14.3.2 StatusChanged (JS,UWP)

Namespace Hierarchy
[JavaScript]
intel.realsense.SenseManager.onStatusChanged
[C#/UWP]
Intel.RealSense.SenseManager.StatusChanged

Syntax
[JavaScript]
function onStatusChanged(sender, status);
[C#/UWP]
void StatusChanged(Object sender, StatusChangedEventArgs args);

Parameters

359

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

sender

The SenseManager or the algorithm module instance, where the error


or warning status is issued.

status

The status code. See the Status for definitions.

args

The StatusChangedEventArgs instance that contains the event


parameters.

Description
The StatusChanged function is invoked when there is any error or warning during
streaming. The sender instance indicates where the error or warning is issued.
The application should not perform any lengthy operation in the callback function.
Return Status
None

2.11.14.3.2.1 StatusChangedEventArgs (UWP)

Namespace Hierarchy
Intel.RealSense.StatusChangedEventArgs

Definition
class StatusChangedEventArgs {
Status Status;
};

Description
The StatusChangedEventArgs structure describes the event parameters of the
StatusChanged event.
Members
connect

360

If true, the I/O device is re-connected. If false, the I/O device is


disconnected.

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.14.4 Member Functions Essentials

The SenseManager interface provides the following member functions:


Member Functions

Description

Init[Async] (+JS,+UWP)

Initialize the pipeline.

AcquireFrame (+UWP)

Wait until a new frame is available and lock it for


processing.

ReleaseFrame (+UWP)

Release the lock on the current frame.

FlushFrame

Flush any internal cache.

Close[Down] (+JS,+UWP)

Close the pipeline.

StreamFrames (+JS,+UWP)

A helper function that performs AcquireFrame/


ReleaseFrame streaming loop in a separate
thread.

IsConnected

Check the device connection status.

QueryCaptureManager

Retrieve the CaptureManager instance.

QuerySession

Retrieve the Session instance.

EnableModule

Insert a processing module into the pipeline.

QueryModule

Returns the processing module instance.

PauseModule

Pause/resume a processing module in the


pipeline.

Release (C++,JS)

Release the instance.

2.11.14.4.1 AcquireFrame (+UWP)

Namespace Hierarchy
[C++]
PXCSenseManager::AcquireFrame
[C#]
PXCMSenseManager.AcquireFrame
[Java]
PXCMSenseManager.AcquireFrame
[C#/UWP]
Intel.RealSense.SenseManager.AcquireFrame

361

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Syntax
[C++]
pxcStatus AcquireFrame(pxcBool ifall, pxcI32 timeout);
pxcStatus AcquireFrame(pxcBool ifall);
pxcStatus AcquireFrame(void);
[C#]
pxcmStatus AcquireFrame(Boolean ifall, Int32 timeout);
pxcmStatus AcquireFrame(Boolean ifall);
pxcmStatus AcquireFrame();
[Java]
pxcmStatus AcquireFrame(boolean ifall, int timeout);
pxcmStatus AcquireFrame(boolean ifall);
pxcmStatus AcquireFrame();
[C#/UWP]
Status AcquireFrame(boolean ifall, int timeout);
Status AcquireFrame(boolean ifall);

Parameters
ifall

If true, the function returns when all processing


modules complete generating results. If false, the
function returns when any of the I/O module or the
processing modules signals. If omitted, the default is
true.

timeout

The timeout value in ms. If omitted, the function waits


infinitely.

Description

362

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The AcquireFrame function waits until some data is available for processing. If
ifall=true, the function waits until all I/O requests are completed on the current
frame and all processing modules have completed processing the current frame of
data. If there are I/O requests for different data, such as color, depth, and/or audio
samples, the function will synchronize the reads of them and return only when all of
them are retrieved and processed.
This means that ifall=true will synchronize all I/Os to the same frame rate or
frequency.
If ifall=false, the function waits until any of the I/O requests or the processing
module operations is done. This is usually used when there are multiple I/O requests
of different frame rates or frequencies. After the function returns, the application can
use the QueryXXX set of functions to figure out which data is ready for processing. For
example, use the QueryBlob function to check if the blob tracking algorithm has
completed processing the current frame.
The application should invoke the ReleaseFrame function as soon as possible to
continue processing subsequent frames. The frame processing is paused between
the AcquireFrame function and the next ReleaseFrame function. The application
should not invoke any lengthy procedures between the AcquireFrame function and
the ReleaseFrame functions.
Although any further frame processing is paused after the AcquireFrame function,
the capture device continues to deliver new samples in parallel, in the live streaming
case or in the file playback case if realtime=true (default). Thus any lengthy
processing in between the AcquireFrame and ReleaseFrame functions may result in
frame loss. In the case of file playback, use SetRealtime(false) if repeatability is
needed in the file playback.
Return Status

363

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

STATUS_NO_ERROR

There is some data available for processing and


the I/O device is connected.

STATUS_EXEC_TIMEOUT

The time out value is reached before any data is


available for processing.

STATUS_DEVICE_LOST

The I/O device is disconnected.

STATUS_EXEC_INPROGRESS

Calling AcquireFrame after StreamFrames.

STATUS_STREAM_CONFIG_CHANGE The device configuration is changed. You need


D
to close the pipeline and restart the pipeline

initialization. See Sharing Device Configuration


for more details.
STATUS_DEVICE_BUSY

The I/O device is being used by other


applications.

Remarks
[C#/Unity]
Uni If used inside the Unity Update() function, it is recommended to use
ty AcquireFrame(false,0) to avoid impacting the Unity rendering performance.

2.11.14.4.2 Close[Down] (+JS,+UWP)

Namespace Hierarchy
[C++]
PXCSenseManager::Close
[C#]
PXCMSenseManager.Close
[Java]
PXCMSenseManager.Close
[JavaScript]
intel.realsense.SenseManager.close
[C#/UWP]
Intel.RealSense.SenseManager.CloseDown

Syntax
[C++]
364

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

void Close(void);
[C#]
void Close();
[Java]
void Close();
[JavaScript]
function close();
[C#/UWP]
void CloseDown();

Parameters
None

Description
The Close[Down] function closes the streams and releases any processing module
instances.
Return Status
None

Remarks
[Java]

Do not confuse this Close function, which closes the streams only, with the close
function, which destroys the SenseManager instance.

2.11.14.4.3 EnableModule

Namespace Hierarchy
[C++]
PXCSenseManager::EnableModule
[C#]
PXCMSenseManager.EnableModule
[Java]
PXCMSenseManager.EnableModule

365

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Syntax
[C++]
pxcStatus EnableModule(pxcUID mid, ImplDesc *mdesc);
[C#]
pxcmStatus EnableModule(Int32 mid, ImplDesc mdesc);
[Java]
pxcmStatus EnableModule(int mid, ImplDesc mdesc);

Parameters
mid

The module identifier. This is usually the interface


identifier.

mdesc

The module descriptor to identify the processing


module; see the ImplDesc structure for details.

Description
The EnableModule function creates an instance of the specified processing module
and inserts it to the processing pipeline.
This is the base function for inserting any modules. The application should use the
interface specific helper functions such as EnableHand and EnableFace.
Return Status
STATUS_NO_ERROR

The module instance is created successfully.

2.11.14.4.4 Init[Async] (+JS,+UWP)

Namespace Hierarchy
[C++]
PXCSenseManager::Init
[C#]
PXCMSenseManager.Init
[Java]
PXCMSenseManager.Init
[JavaScript]
intel.realsense.SenseManager.init

366

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C#/UWP]
Intel.RealSense.SenseManager.InitAsync

Syntax
[C++]
pxcStatus Init(Handler *handler);
pxcStatus Init(void);
[C#]
pxcmStatus Init(Handler handler);
pxcmStatus Init();
[Java]
pxcmStatus Init(Handler handler);
pxcmStatus Init();
[JavaScript]
function init();
[C#/UWP]
async Task<Status> InitAsync();

Parameters
[C++][C#][Java]
ha The optional set of callback or delegate functions.
nd
le
r

Description
The Init function configures the pipeline to be ready for processing.
Return Status
[C++][C#][Java][C#/UWP]
STATUS_NO_ERROR

The function returned successfully.

STATUS_ITEM_UNAVAILABLE

The function failed to locate an I/O device that


meets the previously activated streaming
configuration, for example, the configuration
for face tracking.

[JavaScript]

367

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The returned promise object contains:


sts

The function status code, as defined in the Status enumerator.

See Also
Callbacks and Delegates
Events
2.11.14.4.5 IsConnected

Namespace Hierarchy
[C++]
PXCSenseManager::IsConnected
[C#]
PXCMSenseManager.IsConnected
[Java]
PXCMSenseManager.IsConnected

Syntax
[C++]
pxcBool IsConnected(void);
[C#]
Boolean IsConnected();
[Java]
boolean IsConnected();

Parameters
None
Description
The IsConnected function returns the input device connection status during
streaming. The connection status is valid only in between the Init function and the
Close function.
Return Status

368

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

true

The input device is connected.

false

The input device is not connected.

2.11.14.4.6 PauseModule

Namespace Hierarchy
[C++]
PXCSenseManager::PauseModule
[C#]
PXCMSenseManager.PauseModule
[Java]
PXCMSenseManager.PauseModule

Syntax
[C++]
void PauseModule(pxcUID mid, pxcBool pause);
[C#]
void PauseModule(Int32 mid, Boolean pause);
[Java]
void PauseModule(int mid, boolean pause);

Parameters
mid

The module identifier. This is usually the interface


identifier.

pause

If true, the pipeline will stop delivering samples to


the module; if false, the pipeline resumes delivering
samples to the module.

Description
The PauseModule function pauses or resumes the module processing. If paused, the
pipeline no longer delivers any input samples to the module.
This is the base function for pausing/resuming any modules. The application
usually uses interface specific functions such as PauseHand and PauseFace.

369

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Return Status
None

2.11.14.4.7 QuerySession

Namespace Hierarchy
[C++]
PXCSenseManager::QuerySession
[C#]
PXCSenseManager.QuerySession
[Java]
PXCSenseManager.QuerySession

Syntax
[C++]
PXCSession *QuerySession(void);
[C#]
PXCMSession QuerySession();
[Java]
PXCMSession QuerySession();

Parameters
None
Description
The QuerySession function returns the Session instance.
Return Status
The Session instance.
Remarks
C++

370

The returned instance is an SenseManager internally managed object. Do not


release it.

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

C#

The returned instance is an SenseManager internally managed object. Do not


release it.
The C# application can also use the property session.

Java

The returned instance is an SenseManager internally managed object. Do not


release it.

2.11.14.4.8 QueryCaptureManager

Namespace Hierarchy
[C++]
PXCSenseManager::QueryCaptureManager
[C#]
PXCMSenseManager.QueryCaptureManager
[Java]
PXCMSenseManager.QueryCaptureManager

Syntax
[C++]
PXCCaptureManager *QueryCaptureManager(void);
[C#]
PXCMCaptureManager QueryCaptureManager();
[Java]
PXCMCaptureManager QueryCaptureManager();

Parameters
None
Description
The QueryCaptureManager function returns the CaptureManager instance.
Return Status
The CaptureManager instance or NULL/null if the module is not initialized.

371

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Remarks
[C++]

The returned instance is a SenseManager internally managed object. Do not release it.
[C#]

The returned instance is a SenseManager internally managed object. Do not release it.
The C# application can also use the property captureManager.
[Java]

The returned instance is a SenseManager internally managed object. Do not release it.

2.11.14.4.9 QueryModule

Namespace Hierarchy
[C++]
PXCSenseManager::QueryModule
[C#]
PXCMSenseManager.QueryModule
[Java]
PXCMSenseManager.QueryModule

Syntax
[C++]
PXCBase* QueryModule(pxcUID mid);
[C#]
PXCMBase QueryModule(Int32 mid);
[Java]
PXCMBase QueryModule(int mid);

Parameters
mid

The module identifier. This is usually the interface


identifier.

Description

372

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The QueryModule function returns the module instance when the module is not busy
processing any incoming data. There are two periods of time when a module is not
busy:
Setup: In between the EnableModule function call (or the equivalent interface
specific helper functions) and the first AcquireFrame function call, the
QueryModule function returns the module instance. The application can use the
module instance for additional setup operations.
Retrieve Data: In between the AcquireFrame function call and the ReleaseFrame
function call, the QueryModule function returns a valid module instance if the
module is completed processing the current frame of input data. The application
can use the module instance to retrieve processing results.
This is the base function for querying any module instance. The application can use
the interface specific helper functions to retrieve a specific interface instance, such as
QueryHand and QueryFace.
Return Status
The module instance, or NULL/null if the module is busy.
2.11.14.4.10 Release (C++,JS)

Namespace Hierarchy
[C++]
PXCSenseManager.Release
[JavaScript]
intel.realsense.SenseManager.release

Syntax
[C++]
void Release(void);
[JavaScript]
function release();

Parameters
None

Description

373

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The Release function releases closes down the pipeline and release the
SenseManager instance.
Return Status
None

2.11.14.4.11 ReleaseFrame (+UWP)

Namespace Hierarchy
[C++]
PXCSenseManager::ReleaseFrame
[C#]
PXCMSenseManager.ReleaseFrame
[Java]
PXCMSenseManager.ReleaseFrame
[C#/UWP]
Intel.RealSense.SenseManager.ReleaseFrame

Syntax
[C++]
void ReleaseFrame(void);
[C#]
void ReleaseFrame();
[Java]
void ReleaseFrame();
[C#/UWP]
void ReleaseFrame();

Parameters
None
Description
The ReleaseFrame function releases the lock on the current frame. The pipeline
continues to process subsequent frames.

374

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Return Status
None

2.11.14.4.12 FlushFrame

Namespace Hierarchy
[C++]
PXCSenseManager::FlushFrame
[C#]
PXCMSenseManager.FlushFrame
[Java]
PXCMSenseManager.FlushFrame

Syntax
[C++]
void FlushFrame(void);
[C#]
void FlushFrame();
[Java]
void FlushFrame();

Parameters
None
Description
The FlushFrame function releases any internally cached frames. The subsequent
AcquireFrame function will return a newly captured frame.
Return Status
None

2.11.14.4.13 StreamFrames (+JS,+UWP)

Namespace Hierarchy
[C++]
375

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

PXCSenseManager::StreamFrames
[C#]
PXCMSenseManager.StreamFrames
[Java]
PXCMSenseManager.StreamFrames
[JavaScript]
intel.realsense.SenseManager.streamFrames
[C#/UWP]
Intel.RealSense.SenseManager.StreamFrames

Syntax
[C++]
pxcStatus StreamFrames(pxcBool blocking);
[C#]
pxcmStatus StreamFrames(Boolean blocking);
[Java]
pxcmStatus StreamFrames(boolean blocking);
[JavaScript]
function streamFrames();
[C#/UWP]
Status StreamFrames();

Parameters
[C++][C#][Java]
blocking

A flag to indicate if the function should block or return immediately.


If blocking=true, the function blocks until the streaming loop
exits.

Description
The StreamFrames function is a helper function that implements the AcquireFrame/
ReleaseFrame streaming loop in a separate thread.
The application can call the Close function to terminate the streaming loop at any
time and release the resources.
Return Status
376

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C++][C#][Java][C#/UWP]
STATUS_NO_ERROR

The function returned successfully.

[JavaScript]

The returned promise object contains:


sts

The function status code, as defined in the Status enumerator.

Remarks
[C++][C#][Java][C#/UWP]

If the application initiates the streaming loop through this function, the functions
AcquireFrame and ReleaseFrame will return errors to indicate the duplicated
invoking.

2.11.14.5 Member Functions (3D Scanning)

The SenseManager interface provides the following member functions:


Member Functions

Description

Enable3DScan

Enable the 3D scanning module.

Query3DScan

Get a module instance.

2.11.14.5.1 Enable3DScan

Namespace Hierarchy
[C++]
PXCSenseManager::Enable3DScan
[C#]
PXCMSenseManager.Enable3DScan
[Java]
PXCMSenseManager.Enable3DScan

Syntax
[C++]
pxcStatus Enable3DScan(pxcCHAR *name);
pxcStatus Enable3DScan();

377

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C#]
pxcmStatus Enable3DScan(String name);
pxcmStatus Enable3DScan();
[Java]
pxcmStatus Enable3DScan(String name);
pxcmStatus Enable3DScan();

Parameters
name

The module friendly name, or NULL/null for any


implementation.

Description
The Enable3DScan function activates 3D scanning in the multimodal pipeline.
Return Status
STATUS_NO_ERROR

The function returns successfully.

2.11.14.5.2 Query3DScan

Namespace Hierarchy
[C++]
PXCSenseManager::Query3DScan
[C#]
PXCMSenseManager.Query3DScan
[Java]
PXCMSenseManager.Query3DScan

Syntax
[C++]
PXC3DScan* Query3DScan(void);
[C#]
PXC3DScan Query3DScan();
[Java]
PXC3DScan Query3DScan();

378

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Parameters
None

Description
The Query3DScan function returns the module instance when the module is not busy
processing any incoming data. There are two periods of time when a module is not
busy:
Setup: In between the Enable3DScan function call and the first AcquireFrame
function call, the Query3DScan function returns the module instance. The
application can use the module instance for additional setup operations.
Retrieve Data: In between the AcquireFrame function call and the ReleaseFrame
function call, the Query3DScan function returns a valid module instance if the
module is completed processing the current frame of input data. The application
can use the module instance to retrieve processing results.
Return Status
The module instance, or NULL/null if the module is busy.
2.11.14.6 Member Functions (Blob Tracking)

The SenseManager interface provides the following member functions:


Member Functions

Description

EnableBlob

Enable the blob tracking module.

PauseBlob

Pause/resume the module processing.

QueryBlob

Get a module instance.

QueryBlobSample

Get the module processed images.

2.11.14.6.1 EnableBlob

Namespace Hierarchy
[C++]
PXCSenseManager::EnableBlob
[C#]
PXCMSenseManager.EnableBlob

379

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[Java]
PXCMSenseManager.EnableBlob

Syntax
[C++]
pxcStatus
pxcStatus

EnableBlob(pxcCHAR *name);
EnableBlob();

[C#]
pxcmStatus EnableBlob(String name);
pxcmStatus EnableBlob();
[Java]
pxcmStatus EnableBlob(string name);
pxcmStatus EnableBlob();

Parameters
name

The module friendly name, or NULL/null for any


implementation.

Description
The EnableBlob function activates the blob tracking module in the pipeline.
Return Status
STATUS_NO_ERROR

The function returns successfully.

2.11.14.6.2 PauseBlob

Namespace Hierarchy
[C++]
PXCSenseManager::PauseBlob
[C#]
PXCMSenseManager.PauseBlob
[Java]
PXCMSenseManager.PauseBlob

Syntax
[C++]
void PauseBlob(pxcBool pause);

380

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C#]
void PauseBlob(Boolean pause);
[Java]
void PauseBlob(boolean pause);

Parameters
pause

If true, the pipeline will stop delivering samples to


the module; if false, the pipeline resumes delivering
samples to the module.

Description
The PauseBlob function pauses or resumes the blob tracking module. If paused, the
pipeline no longer delivers any input samples to the module.
Return Status
None

2.11.14.6.3 QueryBlob

Namespace Hierarchy
[C++]
PXCSenseManager::QueryBlob
[C#]
PXCMSenseManager.QueryBlob
[Java]
PXCMSenseManager.QueryBlob

Syntax
[C++]
PXCBlobModule* QueryBlob(void);
[C#]
PXCMBlobModule QueryBlob();
[Java]
PXCMBlobModule QueryBlob();

381

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Parameters
None

Description
The QueryBlob function returns the module instance, BlobModule, when the module
is not busy processing any incoming data.
There are two periods of time when a module is not busy:
Setup: In between the EnableBlob function call and the first AcquireFrame
function call, the QueryBlob function returns the module instance. The application
can use the module instance for additional setup operations.
Retrieve Data: In between the AcquireFrame function call and the ReleaseFrame
function call, the QueryBlob function returns a valid module instance if the module
is completed processing the current frame of input data. The application can use
the module instance to retrieve processing results.
Return Status
The module instance, or NULL/null if the module is busy.
2.11.14.6.4 QueryBlobSample

Namespace Hierarchy
[C++]
PXCSenseManager::QueryBlobSample
[C#]
PXCMSenseManager.QueryBlobSample
[Java]
PXCMSenseManager.QueryBlobSample

Syntax
[C++]
Sample *QueryBlobSample(void);
[C#]
Sample QueryBlobSample();
[Java]
Sample QueryBlobSample();
382

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Parameters
None

Description
The QueryBlobSample function returns the current images processed by the blob
tracking module.
Return Status
The Sample instance or NULL/null if the sample is not available.
Remarks
The returned sample is a SenseManager internally maintained object.
Do not release it.
2.11.14.7 Member Functions (Enhanced Video)

The SenseManager interface provides the following member functions:


Member Functions

Description

EnableEnhancedVideo

Enable the enhanced video module.

PauseEnhancedVideo

Pause/resume the module processing.

QueryEnhancedVideo

Get a module instance.

QueryEnhancedVideoSample Get the images processed by the module.


2.11.14.7.1 EnableEnhancedVideo

Namespace Hierarchy
[C++]
PXCSenseManager::EnableEnhancedVideo
[C#]
PXCMSenseManager.EnableEnhancedVideo
[Java]
PXCMSenseManager.EnableEnhancedVideo

383

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Syntax
[C++]
pxcStatus EnableEnhancedVideo(void);
[C#]
pxcmStatus EnableEnhancedVideo();
[Java]
pxcmStatus EnableEnhancedVideo();

Parameters
None

Description
The EnableEnhancedVideo function activates the enhanced video module in the
multimodal pipeline.
Return Status
STATUS_NO_ERROR

The function returns successfully.

2.11.14.7.2 PauseEnhancedVideo

Namespace Hierarchy
[C++]
PXCSenseManager::PauseEnhancedVideo
[C#]
PXCMSenseManager.PauseEnhancedVideo
[Java]
PXCMSenseManager.PauseEnhancedVideo

Syntax
[C++]
void PauseEnhancedVideo(pxcBool pause);
[C#]
void PauseEnhancedVideo(Boolean pause);
[Java]
void PauseEnhancedVideo(Boolean pause);

384

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Parameters
pause

If true, the pipeline will stop delivering samples to


the module; if false, the pipeline resumes delivering
samples to the module.

Description
The PauseEnhancedVideo function pauses or resumes the Enhanced Videography
module. If paused, the pipeline no longer delivers any input samples to the module.
Return Status
None

2.11.14.7.3 QueryEnhancedVideo

Namespace Hierarchy
[C++]
PXCSenseManager::QueryEnhancedVideo
[C#]
PXCMSenseManager.QueryEnhancedVideo
[Java]
PXCMSenseManager.QueryEnhancedVideo

Syntax
[C++]
PXCEnhancedVideo* QueryEnhancedVideo(void);
[C#]
PXCMEnhancedVideo QueryEnhancedVideo();
[Java]
PXCMEnhancedVideo QueryEnhancedVideo();

Parameters
None

Description
385

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The QueryEnhancedVideo function returns the module instance, EnhancedVideo,


when the module is not busy processing any incoming data.
There are two periods of time when a module is not busy:
Setup: In between the EnableEnhancedVideo function call and the first
AcquireFrame function call, the QueryEnhancedVideo function returns the module
instance. The application can use the module instance for additional setup
operations.
Retrieve Data: In between the AcquireFrame function call and the ReleaseFrame
function call, the QueryEnhancedVideo function returns a valid module instance if
the module is completed processing the current frame of input data. The
application can use the module instance to retrieve processing results.
Return Status
The module instance, or NULL/null if the module is busy.
2.11.14.7.4 QueryEnhancedVideoSample

Namespace Hierarchy
[C++]
PXCSenseManager::QueryEnhancedVideoSample
[C#]
PXCMSenseManager.QueryEnhancedVideoSample
[Java]
PXCMSenseManager.QueryEnhancedVideoSample

Syntax
[C++]
Sample *QueryEnhancedVideoSample(void);
[C#]
Sample QueryEnhancedVideoSample();
[Java]
Sample QueryEnhancedVideoSample();

Parameters
None

386

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Description
The QueryEnhancedVideoSample function returns the current images processed by
the enhanced video module.
Return Status
The Sample instance or NULL/null if the sample is not available.
Remarks
The returned sample is a SenseManager internally maintained object.
Do not release it.
2.11.14.8 Member Functions (Face Tracking)

The SenseManager interface provides the following member functions:


Member Functions

Description

EnableFace

Enable the face tracking module.

PauseFace

Pause/resume the module processing.

QueryFace

Get a module instance.

QueryFaceSample

Get the face module processed images.

2.11.14.8.1 EnableFace

Namespace Hierarchy
[C++]
PXCSenseManager::EnableFace
[C#]
PXCMSenseManager.EnableFace
[Java]
PXCMSenseManager.EnableFace

Syntax
[C++]
pxcStatus EnableFace(pxcCHAR *name);
pxcStatus EnableFace(void);

387

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C#]
pxcmStatus EnableFace(String name);
pxcmStatus EnableFace();
[Java]
pxcmStatus EnableFace(string name);
pxcmStatus EnableFace();

Parameters
name

The module friendly name, or NULL/null for any implementation.

Description
The EnableFace function activates the face tracking module in the pipeline.
Return Status
STATUS_NO_ERROR

The function returned successfully.

2.11.14.8.2 PauseFace

Namespace Hierarchy
[C++]
PXCSenseManager::PauseFace
[C#]
PXCMSenseManager.PauseFace
[Java]
PXCMSenseManager.PauseFace

Syntax
[C++]
void PauseFace(pxcBool pause);
[C#]
void PauseFace(Boolean pause);
[Java]
void PauseFace(boolean pause);

Parameters

388

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

pause

If true, the pipeline will stop delivering samples to


the module; if false, the pipeline resumes delivering
samples to the module.

Description
The PauseFace function pauses or resumes the face tracking module. If paused, the
pipeline no longer delivers any input samples to the module.
Return Status
None

2.11.14.8.3 QueryFace

Namespace Hierarchy
[C++]
PXCSenseManager::QueryFace
[C#]
PXCMSenseManager.QueryFace
[Java]
PXCMSenseManager.QueryFace

Syntax
[C++]
PXCFaceModule* QueryFace(void);
[C#]
PXCMFaceModule QueryFace();
[Java]
PXCMFaceModule QueryFace();

Parameters
None

Description

389

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The QueryFace function returns the module instance, FaceModule, when the module
is not busy processing any incoming data.
There are two periods of time when a module is not busy:
Setup: In between the EnableFace function call and the first AcquireFrame
function call, the QueryFace function returns the module instance. The application
can use the module instance for additional setup operations.
Retrieve Data: In between the AcquireFrame function call and the ReleaseFrame
function call, the QueryFace function returns a valid module instance if the module
is completed processing the current frame of input data. The application can use
the module instance to retrieve processing results.
Return Status
The module instance, or NULL/null if the module is busy.
2.11.14.8.4 QueryFaceSample

Namespace Hierarchy
[C++]
PXCSenseManager::QueryFaceSample
[C#]
PXCMSenseManager.QueryFaceSample
[Java]
PXCMSenseManager.QueryFaceSample

Syntax
[C++]
Sample *QueryFaceSample(void);
[C#]
Sample QueryFaceSample();
[Java]
Sample QueryFaceSample();

Parameters
None

390

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Description
The QueryFaceSample function returns the current images processed by the face
module.
Return Status
The Sample instance or NULL/null if the sample is not available.
Remarks
The returned sample is a SenseManager internally maintained object.
Do not release it.
2.11.14.9 Member Functions (Hand Cursor)

The SenseManager interface provides the following member functions:


Member Functions

Description

EnableHandCursor

Enable the hand cursor module.

PauseHandCursor

Pause/resume the module processing.

QueryHandCursor

Get a module instance.

QueryHandCursorSample

Get the module processed images.

2.11.14.9.1 EnableHandCursor

Namespace Hierarchy
[C++]
PXCSenseManager::EnableHandCursor
[C#]
PXCMSenseManager.EnableHandCursor
[Java]
PXCMSenseManager.EnableHandCursor

Syntax
[C++]
pxcStatus
pxcStatus

EnableHandCursor(pxcCHAR *name);
EnableHandCursor();

[C#]
391

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

pxcmStatus EnableHandCursor(String name);


pxcmStatus EnableHandCursor();
[Java]
pxcmStatus EnableHandCursor(string name);
pxcmStatus EnableHandCursor();

Parameters
name

The module friendly name, or NULL/null for any implementation.

Description
The EnableHand function activates the hand cursor module in the pipeline.
Return Status
STATUS_NO_ERROR

The function returned successfully.

2.11.14.9.2 PauseHandCursor

Namespace Hierarchy
[C++]
PXCSenseManager::PauseHandCursor
[C#]
PXCMSenseManager.PauseHandCursor
[Java]
PXCMSenseManager.PauseHandCursor

Syntax
[C++]
void PauseHandCursor(pxcBool pause);
[C#]
void PauseHandCursor(Boolean pause);
[Java]
void PauseHandCursor(boolean pause);

Parameters

392

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

pause

If true, the pipeline will stop delivering samples to


the module; if false, the pipeline resumes delivering
samples to the module.

Description
The PauseHandCursor function pauses or resumes the hand cursor module. If
paused, the pipeline no longer delivers any input samples to the module.
Return Status
None

2.11.14.9.3 QueryHandCursor

Namespace Hierarchy
[C++]
PXCSenseManager::QueryHandCursor
[C#]
PXCMSenseManager.QueryHandCursor
[Java]
PXCMSenseManager.QueryHandCursor

Syntax
[C++]
PXCHandCursorModule* QueryHandCursor(void);
[C#]
PXCMHandCursorModule QueryHandCursor();
[Java]
PXCMHandCursorModule QueryHandCursor();

Parameters
None

Description

393

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The QueryHandCursor function returns the module instance, HandCursorModule,


when the module is not busy processing any incoming data.
There are two periods of time when a module is not busy:
Setup: In between the EnableHandCursor function call and the first AcquireFrame
function call, the QueryHandCursor function returns the module instance. The
application can use the module instance for additional setup operations.
Retrieve Data: In between the AcquireFrame function call and the ReleaseFrame
function call, the QueryHandCursor function returns a valid module instance if the
module is completed processing the current frame of input data. The application
can use the module instance to retrieve processing results.
Return Status
The module instance, or NULL/null if the module is busy.
2.11.14.9.4 QueryHandCursorSample

Namespace Hierarchy
[C++]
PXCSenseManager::QueryHandCursorSample
[C#]
PXCMSenseManager.QueryHandCursorSample
[Java]
PXCMSenseManager.QueryHandCursorSample

Syntax
[C++]
Sample *QueryHandCursorSample(void);
[C#]
Sample QueryHandCursorSample();
[Java]
Sample QueryHandCursorSample();

Parameters
None

394

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Description
The QueryHandCursorSample function returns the current images processed by the
hand cursor module.
Return Status
The Sample instance or NULL/null if the sample is not available.
Remarks
The returned sample is a SenseManager internally maintained object.
Do not release it.
2.11.14.10Member Functions (Hand Tracking)

The SenseManager interface provides the following member functions:


Member Functions

Description

EnableHand

Enable the hand tracking module.

PauseHand

Pause/resume the module processing.

QueryHand

Get a module instance.

QueryHandSample

Get the hand module processed images.

2.11.14.10.1 EnableHand

Namespace Hierarchy
[C++]
PXCSenseManager::EnableHand
[C#]
PXCMSenseManager.EnableHand
[Java]
PXCMSenseManager.EnableHand

Syntax
[C++]
pxcStatus
pxcStatus

395

EnableHand(pxcCHAR *name);
EnableHand();

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C#]
pxcmStatus EnableHand(String name);
pxcmStatus EnableHand();
[Java]
pxcmStatus EnableHand(string name);
pxcmStatus EnableHand();

Parameters
name

The module friendly name, or NULL/null for any implementation.

Description
The EnableHand function activates the hand tracking module in the pipeline.
Return Status
STATUS_NO_ERROR

The function returned successfully.

2.11.14.10.2 PauseHand

Namespace Hierarchy
[C++]
PXCSenseManager::PauseHand
[C#]
PXCMSenseManager.PauseHand
[Java]
PXCMSenseManager.PauseHand

Syntax
[C++]
void PauseHand(pxcBool pause);
[C#]
void PauseHand(Boolean pause);
[Java]
void PauseHand(boolean pause);

Parameters

396

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

pause

If true, the pipeline will stop delivering samples to


the module; if false, the pipeline resumes delivering
samples to the module.

Description
The PauseHand function pauses or resumes the hand tracking module. If paused, the
pipeline no longer delivers any input samples to the module.
Return Status
None

2.11.14.10.3 QueryHand

Namespace Hierarchy
[C++]
PXCSenseManager::QueryHand
[C#]
PXCMSenseManager.QueryHand
[Java]
PXCMSenseManager.QueryHand

Syntax
[C++]
PXCHandModule* QueryHand(void);
[C#]
PXCMHandModule QueryHand();
[Java]
PXCMHandModule QueryHand();

Parameters
None

Description

397

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The QueryHand function returns the module instance, HandModule, when the module
is not busy processing any incoming data.
There are two periods of time when a module is not busy:
Setup: In between the EnableHand function call and the first AcquireFrame
function call, the QueryHand function returns the module instance. The application
can use the module instance for additional setup operations.
Retrieve Data: In between the AcquireFrame function call and the ReleaseFrame
function call, the QueryHand function returns a valid module instance if the module
is completed processing the current frame of input data. The application can use
the module instance to retrieve processing results.
Return Status
The module instance, or NULL/null if the module is busy.
2.11.14.10.4 QueryHandSample

Namespace Hierarchy
[C++]
PXCSenseManager::QueryHandSample
[C#]
PXCMSenseManager.QueryHandSample
[Java]
PXCMSenseManager.QueryHandSample

Syntax
[C++]
Sample *QueryHandSample(void);
[C#]
Sample QueryHandSample();
[Java]
Sample QueryHandSample();

Parameters
None

398

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Description
The QueryHandSample function returns the current images processed by the hand
module.
Return Status
The Sample instance or NULL/null if the sample is not available.
Remarks
The returned sample is a SenseManager internally maintained object.
Do not release it.
2.11.14.11Member Functions (Object Recognition)

The SenseManager interface provides the following member functions:


Member Functions

Description

EnableObjectRecognition

Enable the object recognition module.

PauseObjectRecognition

Pause/resume the module processing.

QueryObjectRecognition

Get a module instance.

QueryObjectRecognitionSample

Get the module processed sample.

2.11.14.11.1 EnableObjectRecognition

Namespace Hierarchy
[C++]
PXCSenseManager::EnableObjectRecognition
[C#]
PXCMSenseManager.EnableObjectRecognition
[Java]
PXCMSenseManager.EnableObjectRecognition

Syntax
[C++]
pxcStatus EnableObjectRecognition(void);
[C#]

399

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

pxcmStatus EnableObjectRecognition();
[Java]
pxcmStatus EnableObjectRecognition();

Parameters
None

Description
The EnableObjectRecognition function activates object recognition in the
SenseManager pipeline.
Return Status
STATUS_NO_ERROR

The function returns successfully.

2.11.14.11.2 PauseObjectRecognition

Namespace Hierarchy
[C++]
PXCSenseManager::PauseObjectRecognition
[C#]
PXCMSenseManager.PauseObjectRecognition
[Java]
PXCMSenseManager.PauseObjectRecognition

Syntax
[C++]
void PauseObjectRecognition(pxcBool pause);
[C#]
void PauseObjectRecognition(Boolean pause);
[Java]
void PauseObjectRecognition(boolean pause);

Parameters

400

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

pause

If true, the pipeline will stop delivering samples to


the module; if false, the pipeline resumes delivering
samples to the module.

Description
The PauseObjectRecognition function pauses or resumes the object recognition
module. If paused, the pipeline no longer delivers any input samples to the module.
Return Status
None

2.11.14.11.3 QueryObjectRecognition

Namespace Hierarchy
[C++]
PXCSenseManager::QueryObjectRecognition
[C#]
PXCMSenseManager.QueryObjectRecognition
[Java]
PXCMSenseManager.QueryObjectRecognition

Syntax
[C++]
PXCObjectRecognitionModule* QueryObjectRecognition(void);
[C#]
PXCMObjectRecognitionModule QueryObjectRecognition();
[Java]
PXCMObjectRecognitionModule QueryObjectRecognition();

Parameters
None

Description

401

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The QueryObjectRecognition function returns the module instance when the


module is not busy processing any incoming data. There are two periods of time when
a module is not busy:
Setup: In between the EnableObjectRecognition function call and the first
AcquireFrame function call, the QueryObjectRecognition function returns the
module instance. The application can use the module instance for additional setup
operations.
Retrieve Data: In between the AcquireFrame function call and the ReleaseFrame
function call, the QueryObjectRecognition function returns a valid module
instance if the module is completed processing the current frame of input data. The
application can use the module instance to retrieve processing results.
Return Status
The ObjectRecognitionModule instance, or NULL/null if the module is busy.
2.11.14.11.4 QueryObjectRecognitionSample

Namespace Hierarchy
[C++]
PXCSenseManager::QueryObjectRecognitionSample
[C#]
PXCMSenseManager.QueryObjectRecognitionSample
[Java]
PXCMSenseManager.QueryObjectRecognitionSample

Syntax
[C++]
Sample *QueryObjectRecognitionSample(void);
[C#]
Sample QueryObjectRecognitionSample();
[Java]
Sample QueryObjectRecognitionSample();

Parameters
None

402

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Description
The QueryObjectRecognitionSample function returns the current images processed
by the object tracking module.
Return Status
The Sample instance or NULL/null if the sample is not available.
Remarks
The returned sample is a SenseManager internally maintained object.
Do not release it.
2.11.14.12Member Functions (Object Tracking)

The SenseManager interface provides the following member functions:


Member Functions

Description

EnableTracker

Enable the object tracking module.

PauseTracker

Pause/resume the module processing.

QueryTracker

Get a module instance.

QueryTrackerSample

Get the module processed sample.

2.11.14.12.1 EnableTracker

Namespace Hierarchy
[C++]
PXCSenseManager::EnableTracker
[C#]
PXCMSenseManager.EnableTracker
[Java]
PXCMSenseManager.EnableTracker

Syntax
[C++]
pxcStatus EnableTracker(void);
[C#]

403

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

pxcmStatus EnableTracker();
[Java]
pxcmStatus EnableTracker();

Parameters
None

Description
The EnableTracker function activates object tracking in the SenseManager pipeline.
Return Status
STATUS_NO_ERROR

The function returns successfully.

2.11.14.12.2 PauseTracker

Namespace Hierarchy
[C++]
PXCSenseManager::PauseTracker
[C#]
PXCMSenseManager.PauseTracker
[Java]
PXCMSenseManager.PauseTracker

Syntax
[C++]
void PauseTracker(pxcBool pause);
[C#]
void PauseTracker(Boolean pause);
[Java]
void PauseTracker(boolean pause);

Parameters

404

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

pause

If true, the pipeline will stop delivering samples to


the module; if false, the pipeline resumes delivering
samples to the module.

Description
The PauseTracker function pauses or resumes the object tracking module. If paused,
the pipeline no longer delivers any input samples to the module.
Return Status
None

2.11.14.12.3 QueryTracker

Namespace Hierarchy
[C++]
PXCSenseManager::QueryTracker
[C#]
PXCMSenseManager.QueryTracker
[Java]
PXCMSenseManager.QueryTracker

Syntax
[C++]
PXCTracker* QueryTracker(void);
[C#]
PXCMTracker QueryTracker();
[Java]
PXCMTracker QueryTracker();

Parameters
None

Description

405

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The QueryTracker function returns the module instance when the module is not
busy processing any incoming data. There are two periods of time when a module is
not busy:
Setup: In between the EnableTracker function call and the first AcquireFrame
function call, the QueryTracker function returns the module instance. The
application can use the module instance for additional setup operations.
Retrieve Data: In between the AcquireFrame function call and the ReleaseFrame
function call, the QueryTracker function returns a valid module instance if the
module is completed processing the current frame of input data. The application
can use the module instance to retrieve processing results.
Return Status
The Tracker instance, or NULL/null if the module is busy.
2.11.14.12.4 QueryTrackerSample

Namespace Hierarchy
[C++]
PXCSenseManager::QueryTrackerSample
[C#]
PXCMSenseManager.QueryTrackerSample
[Java]
PXCMSenseManager.QueryTrackerSample

Syntax
[C++]
Sample *QueryTrackerSample(void);
[C#]
Sample QueryTrackerSample();
[Java]
Sample QueryTrackerSample();

Parameters
None

Description
406

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The QueryTrackerSample function returns the current images processed by the


object tracking module.
Return Status
The Sample instance or NULL/null if the sample is not available.
Remarks
The returned sample is a SenseManager internally maintained object.
Do not release it.
2.11.14.13Member Functions (Person Tracking)

The SenseManager interface provides the following member functions:


Member Functions

Description

EnablePersonTracking

Enable the person tracking module.

PausePersonTracking

Pause/resume the module processing.

QueryPersonTracking

Get a module instance.

QueryPersonTrackingSample

Get the module processed sample.

2.11.14.13.1 EnablePersonTracking

Namespace Hierarchy
[C++]
PXCSenseManager::EnablePersonTracking
[C#]
PXCMSenseManager.EnablePersonTracking
[Java]
PXCMSenseManager.EnablePersonTracking

Syntax
[C++]
pxcStatus EnablePersonTracking(void);
[C#]
pxcmStatus EnablePersonTracking();
[Java]
407

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

pxcmStatus EnablePersonTracking();

Parameters
None

Description
The EnablePersonTracking function activates person tracking in the SenseManager
pipeline.
Return Status
STATUS_NO_ERROR

The function returns successfully.

2.11.14.13.2 PausePersonTracking

Namespace Hierarchy
[C++]
PXCSenseManager::PausePersonTracking
[C#]
PXCMSenseManager.PausePersonTracking
[Java]
PXCMSenseManager.PausePersonTracking

Syntax
[C++]
void PausePersonTracking(pxcBool pause);
[C#]
void PausePersonTracking(Boolean pause);
[Java]
void PausePersonTracking(boolean pause);

Parameters
pause

408

Intel RealSense SDK 2016 R2 Reference Manual

If true, the pipeline will stop delivering samples to


the module; if false, the pipeline resumes delivering
samples to the module.

2010-2016 Intel Corporation

Description
The PausePersonTracking function pauses or resumes the Person Tracking module.
If paused, the pipeline no longer delivers any input samples to the module.
Return Status
None

2.11.14.13.3 QueryPersonTracking

Namespace Hierarchy
[C++]
PXCSenseManager::QueryPersonTracking
[C#]
PXCMSenseManager.QueryPersonTracking
[Java]
PXCMSenseManager.QueryPersonTracking

Syntax
[C++]
PXCPersonTrackingModule* QueryPersonTracking(void);
[C#]
PXCMPersonTrackingModule QueryPersonTracking();
[Java]
PXCMPersonTrackingModule QueryPersonTracking();

Parameters
None

Description

409

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The QueryPersonTracking function returns the module instance when the module is
not busy processing any incoming data. There are two periods of time when a module
is not busy:
Setup: In between the EnablePersonTracking function call and the first
AcquireFrame function call, the QueryPersonTracking function returns the
module instance. The application can use the module instance for additional setup
operations.
Retrieve Data: In between the AcquireFrame function call and the ReleaseFrame
function call, the QueryPersonTracking function returns a valid module instance if
the module is completed processing the current frame of input data. The
application can use the module instance to retrieve processing results.
Return Status
The module instance, or NULL/null if the module is busy.
2.11.14.13.4 QueryPersonTrackingSample

Namespace Hierarchy
[C++]
PXCSenseManager::QueryPersonTrackingSample
[C#]
PXCMSenseManager.QueryPersonTrackingSample
[Java]
PXCMSenseManager.QueryPersonTrackingSample

Syntax
[C++]
Sample *QueryPersonTrackingSample(void);
[C#]
Sample QueryPersonTrackingSample();
[Java]
Sample QueryPersonTrackingSample();

Parameters
None

410

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Description
The QueryPersonTrackingSample function returns the current images processed by
the person tracking module.
Return Status
The Sample instance or NULL/null if the sample is not available.
Remarks
The returned sample is a SenseManager internally maintained object.
Do not release it.
2.11.14.14Member Functions (Scene Perception)

The SenseManager interface provides the following member functions:


Member Functions

Description

EnableScenePerception

Enable the scene perception module.

PauseScenePerception

Pause/resume the module processing.

QuerySenePerception

Get a module instance.

QueryScenePerceptionSample

Get the module processed sample.

2.11.14.14.1 EnableScenePerception

Namespace Hierarchy
[C++]
PXCSenseManager::EnableScenePerception
[C#]
PXCMSenseManager.EnableScenePerception
[Java]
PXCMSenseManager.EnableScenePerception

Syntax
[C++]
pxcStatus EnableScenePerception(pxcCHAR *name);
pxcStatus EnableScenePerception();
[C#]
411

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

pxcmStatus EnableScenePerception(String name);


pxcmStatus EnableScenePerception();
[Java]
pxcmStatus EnableScenePerception(string name);
pxcmStatus EnableScenePerception();

Parameters
name

The module friendly name, or NULL/null for any


implementation.

Description
The EnableScenePerception function activates the Scene Perception module in the
pipeline.
Return Status
STATUS_NO_ERROR

The function returns successfully.

2.11.14.14.2 PauseScenePerception

Namespace Hierarchy
[C++]
PXCSenseManager::PauseScenePerception
[C#]
PXCMSenseManager.PauseScenePerception
[Java]
PXCMSenseManager.PauseScenePerception

Syntax
[C++]
void PauseScenePerception(pxcBool pause);
[C#]
void PauseScenePerception(Boolean pause);
[Java]
void PauseScenePerception(boolean pause);

Parameters

412

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

pause

If true, the pipeline will stop delivering samples to


the module; if false, the pipeline resumes delivering
samples to the module.

Description
The PauseScenePerception function pauses or resumes the Scene Perception
module. If paused, the pipeline no longer delivers any input samples to the module.
Return Status
None

2.11.14.14.3 QuerySenePerception

Namespace Hierarchy
[C++]
PXCSenseManager::QuerySenePerception
[C#]
PXCMSenseManager.QuerySenePerception
[Java]
PXCMSenseManager.QuerySenePerception

Syntax
[C++]
PXCScenePerception* QuerySenePerception(void);
[C#]
PXCMScenePerception QuerySenePerception();
[Java]
PXCMScenePerception QuerySenePerception();

Parameters
None

Description

413

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The QuerySenePerception function returns the module instance, ScenePerception,


when the module is not busy processing any incoming data.
There are two periods of time when a module is not busy:
Setup: In between the EnableScenePerception function call and the first
AcquireFrame function call, the QuerySenePerception function returns the
module instance. The application can use the module instance for additional setup
operations.
Retrieve Data: In between the AcquireFrame function call and the ReleaseFrame
function call, the QuerySenePerception function returns a valid module instance if
the module is completed processing the current frame of input data. The
application can use the module instance to retrieve processing results.
Return Status
The module instance, or NULL/null if the module is busy.
2.11.14.14.4 QueryScenePerceptionSample

Namespace Hierarchy
[C++]
PXCSenseManager::QueryScenePerceptionSample
[C#]
PXCMSenseManager.QueryScenePerceptionSample
[Java]
PXCMSenseManager.QueryScenePerceptionSample

Syntax
[C++]
Sample *QueryScenePerceptionSample(void);
[C#]
Sample QueryScenePerceptionSample();
[Java]
Sample QueryScenePerceptionSample();

Parameters
None

414

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Description
The QueryScenePerceptionSample function returns the current images processed
by the scene perception module.
Return Status
The Sample instance or NULL/null if the sample is not available.
Remarks
The returned sample is a SenseManager internally maintained object.
Do not release it.
2.11.14.15Member Functions (Stream Capture)

The SenseManager interface provides the following member functions:


Member Functions

Description

EnableStream[s]

Capture the specified aligned or unaligned stream


(or streams).

QuerySample

Retrieve available images.

2.11.14.15.1 EnableStream[s]

Namespace Hierarchy
[C++]
PXCSenseManager::EnableStream[s]
[C#]
PXCMSenseManager.EnableStream[s]
[Java]
PXCMSenseManager.EnableStream[s]

Syntax
[C++]
pxcStatus EnableStreams(DataDesc *ddesc);
pxcStatus EnableStream(StreamType stream, pxcI32 width, pxcI32 height,
pxcF32 fps, StreamOption options);
pxcStatus EnableStream(StreamType stream, pxcI32 width, pxcI32 height,
pxcF32 fps);
pxcStatus EnableStream(StreamType stream, pxcI32 width, pxcI32 height);

415

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C#]
pxcmStatus EnableStreams(DataDesc ddesc);
pxcmStatus EnableStream(StreamType stream, Int32 width, Int32 height,
Single fps, StreamOption options);
pxcmStatus EnableStream(StreamType stream, Int32 width, Int32 height,
Single fps);
pxcmStatus EnableStream(StreamType stream, Int32 width, Int32 height);
[Java]
pxcmStatus EnableStreams(DataDesc ddesc);
pxcmStatus EnableStream(StreamType stream, int width, int height, float
fps, EnumSet<StreamOption> options);
pxcmStatus EnableStream(StreamType stream, int width, int height, float
fps);
pxcmStatus EnableStream(StreamType stream, int width, int height);

Parameters
ddesc

The video stream descriptor as detailed in the


DataDesc structure.

stream

The stream type. See the StreamType enumerator for


definitions.

width

The specified image width, or zero for any image


width.

height

The specified image height, or zero for any image


height.

fps

The specified frame rate, or zero for any frame rate.

options

The stream options; see the StreamOption


enumerator for definitions.

Description

416

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The EnableStream[s] function requests that the specified stream(s) be part of the
pipeline streaming. The application can call this function multiple times for different
streams.
The EnableStreams function behavior is different from the EnableStream function.
The former activates one or more aligned streams reads. If you specify more than 1
stream in the stream descriptor, the SenseManager interface delivers all streams
synchronized when invoking the OnNewSample callback function. The later activates
individual unaligned stream reads. If you call the EnableStream function multiple
times, you get multiple OnNewSample callbacks, each with the currently available
stream sample.
Use this function to explicitly request a stream or more streams for rendering or
processing. There is no need to call this function for any modality processing. When
the application uses the EnableModule function (or any algorithm specific helper
functions) to enable algorithm modalities, the SDK enables the corresponding
streams implicitly.
Return Status
STATUS_NO_ERROR

The function completes successfully.

See Also
Capturing Individual Color or Depth Stream
Capturing Unaligned Color and Depth Streams
Capturing Aligned Color and Depth Streams
2.11.14.15.2 QuerySample

Namespace Hierarchy
[C++]
PXCSenseManager::QuerySample
[C#]
PXCMSenseManager.QuerySample
[Java]
PXCMSenseManager.QuerySample

Syntax
[C++]
Sample *QuerySample(pxcUID mid);
Sample *QuerySample(void);
417

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C#]
Sample QuerySample(Int32 mid);
Sample QuerySample();
[Java]
Sample QuerySample(int mid);
Sample QuerySample();

Parameters
mid

The optional module identifier.

Description
The QuerySample function returns all image sample available, at this moment.
If the module identifier mid is omitted, the function returns a single Sample structure
that contains all available image instances from any explicitly requested streams via
the EnableStream[s] function(s).
If the module identifier mid is specified, the function returns available images only for
the specific module:
For algorithm modules, use the module interface identifier. For example, use
mid=PXCFaceModule::CUID to retrieve images processed by the face module.
For streams explicitly requested through multiple calls to the EnableStream[s]
functions, use mid=PXCCapture::CUID+0, PXCCapture::CUID+1, .... to retrieve the
images.
Return Status
The Sample instance or NULL/null if the sample is not available.
Remarks
The returned sample is a SenseManager internally maintained object.
Do not release it.
2.11.14.16Member Functions (Touchless Controller)

The SenseManager interface provides the following member functions:


Member Functions
418

Intel RealSense SDK 2016 R2 Reference Manual

Description
2010-2016 Intel Corporation

EnableTouchlessController Enable the touchless controller feature.


PauseTouchlessController Pause/resume the touchless controller feature.
QueryTouchlessController Get an instance of the touchless controller control

interface.
2.11.14.16.1 EnableTouchlessController

Namespace Hierarchy
[C++]
PXCSenseManager::EnableTouchlessController
[C#]
PXCMSenseManager.EnableTouchlessController
[Java]
PXCMSenseManager.EnableTouchlessController

Syntax
[C++]
pxcStatus EnableTouchlessController();
[C#]
pxcmStatus EnableTouchlessController();
[Java]
pxcmStatus EnableTouchlessController();

Parameters
None

Description
The EnableTouchlessController function activates the touchless controller feature
in the multimodal pipeline.
Return Status
STATUS_NO_ERROR

419

Intel RealSense SDK 2016 R2 Reference Manual

The function returns successfully.

2010-2016 Intel Corporation

2.11.14.16.2 PauseTouchlessController

Namespace Hierarchy
[C++]
PXCSenseManager::PauseTouchlessController
[C#]
PXCMSenseManager.PauseTouchlessController
[Java]
PXCMSenseManager.PauseTouchlessController

Syntax
[C++]
void PauseTouchlessController(pxcBool pause);
[C#]
void PauseTouchlessController(Boolean pause);
[Java]
void PauseTouchlessController(boolean pause);

Parameters
pause

If true, the pipeline will pause the feature. If false,


the pipeline will resume the feature.

Description
The PauseTouchlessController function pauses or resumes the touchless
controller feature.
Return Status
None

2.11.14.16.3 QueryTouchlessController

Namespace Hierarchy
[C++]
PXCSenseManager::QueryTouchlessController
[C#]
PXCMSenseManager.QueryTouchlessController

420

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[Java]
PXCMSenseManager.QueryTouchlessController

Syntax
[C++]
PXCTouchlessController* QueryTouchlessController(void);
[C#]
PXCMTouchlessController QueryTouchlessController();
[Java]
PXCMTouchlessController QueryTouchlessController();

Parameters
None

Description
The QueryTouchlessController function returns the module instance when the
module is not busy processing any incoming data. There are two periods of time when
a module is not busy:
Setup: In between the EnableTouchlessController function call and the first
AcquireFrame function call, the QueryTouchlessController function returns the
module instance. The application can use the module instance for additional setup
operations.
Retrieve Data: In between the AcquireFrame function call and the ReleaseFrame
function call, the QueryTouchlessController function returns a valid module
instance if the module is completed processing the current frame of input data. The
application can use the module instance to retrieve processing results.
Return Status
The module instance, or NULL/null if the module is busy.
2.11.14.17Member Functions (User Segmentation)

The SenseManager interface provides the following member functions:

421

Member Functions

Description

Enable3DSeg

Enable the user segmentation module.

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Pause3DSeg

Pause/resume the module processing.

Query3DSeg

Get a module instance.

Query3DSegSample

Get the module processed sample.

2.11.14.17.1 Enable3DSeg

Namespace Hierarchy
[C++]
PXCSenseManager::Enable3DSeg
[C#]
PXCMSenseManager.Enable3DSeg
[Java]
PXCMSenseManager.Enable3DSeg

Syntax
[C++]
pxcStatus Enable3DSeg(pxcCHAR *name);
pxcStatus Enable3DSeg();
[C#]
pxcmStatus Enable3DSeg(String name);
pxcmStatus Enable3DSeg();
[Java]
pxcmStatus Enable3DSeg(String name);
pxcmStatus Enable3DSeg();

Parameters
name

The module friendly name, or NULL/null for any


implementation.

Description
The Enable3DSeg function activates user segmentation in the multimodal pipeline.
Return Status
STATUS_NO_ERROR

422

Intel RealSense SDK 2016 R2 Reference Manual

The function returns successfully.

2010-2016 Intel Corporation

2.11.14.17.2 Pause3DSeg

Namespace Hierarchy
[C++]
PXCSenseManager::Pause3DSeg
[C#]
PXCMSenseManager.Pause3DSeg
[Java]
PXCMSenseManager.Pause3DSeg

Syntax
[C++]
void Pause3DSeg(pxcBool pause);
[C#]
void Pause3DSeg(Boolean pause);
[Java]
void Pause3DSeg(boolean pause);

Parameters
pause

If true, the pipeline will stop delivering samples to


the module; if false, the pipeline resumes delivering
samples to the module.

Description
The Pause3DSeg function pauses or resumes the user segmentation module. If
paused, the pipeline no longer delivers any input samples to the module.
Return Status
None

2.11.14.17.3 Query3DSeg

Namespace Hierarchy
[C++]
PXCSenseManager::Query3DSeg
[C#]

423

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

PXCMSenseManager.Query3DSeg
[Java]
PXCMSenseManager.Query3DSeg

Syntax
[C++]
PXC3DSeg* Query3DSeg(void);
[C#]
PXCM3DSeg Query3DSeg();
[Java]
PXCM3DSeg Query3DSeg();

Parameters
None

Description
The Query3DSeg function returns the module instance when the module is not busy
processing any incoming data. There are two periods of time when a module is not
busy:
Setup: In between the Enable3DSeg function call and the first AcquireFrame
function call, the Query3DSeg function returns the module instance. The application
can use the module instance for additional setup operations.
Retrieve Data: In between the AcquireFrame function call and the ReleaseFrame
function call, the Query3DSeg function returns a valid module instance if the module
is completed processing the current frame of input data. The application can use
the module instance to retrieve processing results.
Return Status
The module instance, or NULL/null if the module is busy.
2.11.14.17.4 Query3DSegSample

Namespace Hierarchy
[C++]
PXCSenseManager::Query3DSegSample
[C#]
424

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

PXCMSenseManager.Query3DSegSample
[Java]
PXCMSenseManager.Query3DSegSample

Syntax
[C++]
Sample *Query3DSegSample(void);
[C#]
Sample Query3DSegSample();
[Java]
Sample Query3DSegSample();

Parameters
None

Description
The Query3DSegSample function returns the current images processed by the user
segmentation module.
Return Status
The Sample instance or NULL/null if the sample is not available.
Remarks
The returned sample is a SenseManager internally maintained object.
Do not release it.
2.11.14.18Properties

The PXCMSenseManager interface provides the following properties:

425

Property

Description

captureManager (C#,JS,UWP)

Return the PXCMCaptureManager instance.

session (C#,JS)

Return the PXCMSession instance.

sample (UWP)

Return the available sample from the capture device.

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.14.18.1 captureManager (C#,JS,UWP)

Namespace Hierarchy
[C#]
PXCMSenseManager.captureManager
[JavaScript]
intel.realsense.SenseManager.captureManager
[C#/UWP]
Intel.Realsense.SenseManager.CaptureManager

Syntax
[C#]
PXCMCaptureManager captureManager {
get;
}
[JavaScript]
Data Type

{
captureManager,

CaptureManager

};
[C#/UWP]
CaptureManager captureManager {
get;
}

Description
The captureManager property returns the CaptureManager instance.
Remarks
[C#]

The C# application can also use the function QueryCaptureManager.

2.11.14.18.2 sample (UWP)

Namespace Hierarchy
Intel.RealSense.SenseManager.Sample

Syntax
426

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Sample Sample {
get
};

Description
The sample property returns the available sample from the capture device. If
there is no sample available, the property returns null.
2.11.14.18.3 session (C#,JS)

Namespace Hierarchy
[C#]
PXCMSenseManager.session
[JavaScript]
intel.realsense.SenseManager.session

Syntax
[C#]
PXCMSession session {
get;
}
[JavaScript]
Data Type

{
session,

Session

};

Description
The session property returns the Session instance.
Remarks
[C#]

The C# application can also use the function QuerySession.

2.11.14.19Static Functions

The SenseManager interface provides the following static functions:

427

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Static Functions

Description

CreateInstance (+JS,+UWP)

Create an instance of the SenseManager


interface.

detectPlatform (JS)

Detect platform for JavaScript.

2.11.14.19.1 CreateInstance (+JS,+UWP)

Namespace Hierarchy
[C++]
PXCSenseManager::CreateInstance
[C#]
PXCMSenseManager.CreateInstance
[Java]
PXCMSenseManager.CreateInstance
[JavaScript]
intel.realsense.SenseManager.createInstance
[C#/UWP]
Intel.RealSense.SenseManager.CreateInstance

Syntax
[C++]
static PXCSenseManager* CreateInstance(void);
[C#]
static PXCMSenseManager CreateInstance();
[Java]
static PXCMSenseManager CreateInstance();
[JavaScript]
function createInstance();
[C#/UWP]
static SenseManager CreateInstance();

Parameters
None
Description
[C++][C#][Java]
428

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The CreateInstance function creates an instance of the SenseManager interface.


This is a convenience function that skips session creation. The application can also
use the CreateSenseManager function to creates an instance of the SenseManager
interface from the Session instance.
[JavaScript][C#/UWP]

The createInstance function creates an instance of the SenseManager interface.

Return Status
[C++][C#][Java][C#/UWP]

The SenseManager instance, or NULL/null if there is any error.


[JavaScript]

The SenseManager instance as a promise object.

2.11.14.19.2 detectPlatform (JS)

Namespace Hierarchy
intel.realsense.SenseManager.detectPlatform

Syntax
function detectPlatform(components, cameras);

Parameters

429

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

components

The array of runtimes that the application uses. Each runtime


is specified as a feature name string. See Installer Feature
Code for the feature definitions.

cameras

The array of cameras that the application can work with.


For example, use "f200" (lower case) to specify that your
application works with the camera model F200. You can also
use "front" and "rear" to specify any front facing or rear
facing camera.
See Installer Options for a complete list of supported
cameras.
If the cameras array is empty, the function checks for any
available front or rear cameras.

Description
The detectPlatform function checks the platform for the camera model, the
camera driver version, and the SDK runtime version. The function signals if
the platform is prepared to run your JavaScript application.
Specify the runtimes using the installer feature names as described in Installer
Feature Code, and the required cameras using the camera model strings as
described in Installer Options.
The function returns a set of flags to indicate if the platform is ready, and a
nextStep state of what the application needs to do next, as follows:
Flags

430

nextStep

Comment

isDCMUpdateNeeed

"driver": Prompt the

!isCameraReady &&
!isCheckNeeded

"unsupported": Prompt The platform is either

Intel RealSense SDK 2016 R2 Reference Manual

The required camera


user to install or upgrade driver is not detected, or
the camera driver to the the installed camera
latest version from the
driver is outdated.
computer manufacturer.

the user that your


application cannot run
on the platform.

not equipped with the


required camera, the OS
or browser is not
supported.

2010-2016 Intel Corporation

(isCameraReady &&
!isRuntimeInstalled
&&
!isDCMUpdateNeeded)
|| isCheckNeeded

"runtime": Prompt the

isCameraReady &&
isRuntimeInstalled
&&
!isDCMUpdateNeeded

"ready": Continue to

user to download and


execute the runtime
installer to prepare the
platform.

The required SDK


runtimes are not
available, or the
function failed to detect
the platform details.

The platform is
your application context. equipped with the right
camera, up-to-date
camera driver and SDK
runtimes to run your
application.

Return Status
The promise object contains the following flags:
isCameraReady

If true, the specified camera in the cameras array is


available.

isDCMUpdateNeeded

If true, the camera driver on the platform is


outdated. Prompt the user to update the camera
driver to the latest from his/her computer
manufacturer.

isRuntimeInstalled

If true, the specified runtimes are installed on the


platform.

isCheckNeeded

If true, the function failed to detect the camera or


software installation on the platform. Prompt the
user to download and execute the runtime installer
to prepare the platform.

nextStep

A string of what the application should do next to


prepare the platform. See Description for definitions.

Example
Example 67 shows the platform detection logic for a blob tracking application.
Example 67: Platform Detection for Blob Tracking

// name space shortcut


var rs=intel.realsense;

431

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

// detect platform: checking for blob and front camera F200


rs.SenseManager.detectPlatform(['blob'], ['f200']).then(function (flags) {
if (flags.nextStep == 'driver') {
document.write("Please update your camera driver from your computer
manufacturer.");
return;
}
if (flags.nextStep == 'unsupported') {
document.write("The platform is not supported.");
return;
}
if (flags.nextStep == 'runtime') {
document.write("Download & install SDK runtime(s): URL");
return;
}
if (flags.nextStep == 'ready') {
// The platform is ready. Proceed to the application context.
return;
}
}).catch(function (e) {
document.write("Detection Failure: " + e);
});

See Also
Deploying JavaScript Applications

2.11.15 Session (+JS)


Namespace Hierarchy
[C++]
PXCSession
[C#]
PXCMSession
[Java]
PXCMSession
[JavaScript]
intel.realsense.Session

Description
The Session interface maintains the SDK context. The application can query and
create instances of I/O module and algorithm module implementations.

432

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The Session implementation exposes the Metadata interface for centralized meta
data storage.
You can use the QuerySession function (or session in C# and JavaScript) to retrieve
an instance of the Session interface, as illustrated in Example 68.
Reference
[C++]
pxcsession.h
[C#/.NET4]
libpxcclr.cs.dll
[C#/Unity]
libpxcclr.unity.dll
[Java]
libpxcclr.java.jar
[Processing]
libpxcclr_processing
[JavaScript]
realsense.js

Runtime
[C++][C#][Java][JavaScript]

Install SDK runtime: core


Example
Example 68 shows how to create a session instance.
Example 68: Create a Session Instance

[C++]
PXCSenseManager *sm=PXCSenseManager::CreateInstance();
...
PXCSession::ImplVersion v=sm->QuerySession()->QueryVersion();
printf_s("SDK Version: %d.%d\n", v.major, v.minor);
...
sm->Release();
[C#]
PXCMSenseManager sm=PXCMSenseManager.CreateInstance();
...
PXCMSession.ImplVersion v=sm.session.version;
Console.WriteLine("SDK Version: {0}.{1}", v.major, v.minor);

433

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

...
sm.Dispose();
[Java]
PXCMSenseManager sm=PXCMSenseManager.CreateInstance();
...
PXCMSession.ImplVersion v=sm.session.version;
System.out.printf("SDK Version: %d.%d%n",v.major,v.minor);
...
sm.Dispose();
[JavaScript]
intel.realsense.SenseManager.createInstance().then(function(sm)) {
...
document.write("SDK Version: " + sm.session.version);
...
sm.release();
}

See Also
Constants
Member Functions
Properties (C#, JS)
Static Functions

434

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.15.1 Constants

The Session interface exposes the following constants:


Constant

Description

CUID

The interface identifier.

2.11.15.2 Member Functions

The Session interface exposes the following member functions:


Member Functions

Description

CreateAudio

Create an audio instance.

CreateImage

Create an image instance.

CreatePhoto

Create a photo instance.

CreateImpl

Create a module instance.

CreateAudioSource

Create a PXCAudioSource instance.

CreateCaptureManager

Create a CaptureManager instance.

CreateSenseManager

Create a SenseManager instance.

CreatePowerManager

Create a PowerState instance.

QueryModuleDesc (+JS)

Query the module descriptor.

LoadImplFromFile

Add a module shared library to the session.

QueryImpl
QueryImpls (JS)

Query an implementation.

QueryVersion

Query the SDK version information.

QueryCoordinateSystem
SetCoordinateSystem

Query/Set the coordinate system.

UnloadImplFromFile

Remove a module shared library from the session.

2.11.15.2.1 CreateAudio

Namespace Hierarchy
[C++]
PXCSession::CreateAudio
[C#]
PXCMSession.CreateAudio
435

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[Java]
PXCMSession.CreateAudio

Syntax
[C++]
PXCAudio* CreateAudio(PXCAudio::AudioInfo *info, PXCAudio::AudioData
*data);
PXCAudio* CreateAudio(PXCAudio::AudioInfo *info);
[C#]
PXCMAudio CreateAudio(PXCMAudio.AudioInfo info, PXCMAudio.AudioData
data);
PXCMAudio CreateAudio(PXCMAudio.AudioInfo info);
[Java]
PXCMAudio CreateAudio(PXCMAudio.AudioInfo info, PXCMAudio.AudioData
data);
PXCMAudio CreateAudio(PXCMAudio.AudioInfo info);

Parameters
info

The AudioInfo structure for audio buffer


information.

data

Optional initialization data; see the AudioData


structure for details.

Description
The CreateAudio function creates an instance of the Audio interface, which manages
audio buffer access.
If data is specified, the SDK initializes the audio buffer with the specified data, by
taking the buffer pointers or the OS-specific surface handle, without copying any data.
The formats in the AudioData structure and in the AudioInfo structure must match.
If data is not specified, the SDK creates the audio buffer without initialization.
Return Status

The Audio instance, or NULL/null if there is any error.


Example

436

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Example 69 shows how to create an audio object.


Example 69: Create an Audio Object

[C++]
PXCAudio::AudioInfo ainfo;
memset(&ainfo,0,sizeof(ainfo));
ainfo.bufferSize=8820;
ainfo.format=PXCAudio::AUDIO_FORMAT_PCM;
ainfo.sampleRate=44100;
ainfo.nchannels=2;

//
//
//
//

max number of bytes


audio sample format
sampling rate in Hz
number of channels

PXCAudio *audio=session->CreateAudio(&ainfo);
...
audio->Release();
[C#]
PXCMAudio.AudioInfo ainfo=new PXCMAudio.AudioInfo() {
bufferSize=8820,
// max number of bytes
format=PXCMAudio.AudioFormat.AUDIO_FORMAT_PCM,
// audio sample
format
sampleRate=44100,
// sampling rate in Hz
nchannels=2,
// number of channels
};
PXCMAudio audio=session.CreateAudio(ainfo);
...
audio.Dispose();
[Java]
PXCMAudio.AudioInfo ainfo=new PXCMAudio.AudioInfo();
ainfo.bufferSize=8820,
// max number of bytes
ainfo.format=PXCMAudio.AudioFormat.AUDIO_FORMAT_PCM,
// audio sample
format
ainfo.sampleRate=44100,
// sampling rate in Hz
ainfo.nchannels=2,
// number of channels
PXCMAudio audio=session.CreateAudio(ainfo);
...
audio.close();

437

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.15.2.2 CreateAudioSource

Namespace Hierarchy
[C++]
PXCSession::CreateAudioSource
[C#]
PXCMSession.CreateAudioSource
[Java]
PXCMSession.CreateAudioSource

Syntax
[C++]
PXCAudioSource* CreateAudioSource(void);
[C#]
PXCMAudioSource CreateAudioSource();
[Java]
PXCMAudioSource CreateAudioSource();

Parameters
None

Description
The CreateAudioSource function creates an instance of the AudioSource interface.
Return Status
The AudioSource instance, or NULL/null if there is any error.
2.11.15.2.3 CreateCaptureManager

Namespace Hierarchy
[C++]
PXCSession::CreateCaptureManager
[C#]
PXCMSession.CreateCaptureManager
[Java]
PXCMSession.CreateCaptureManager

438

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Syntax
[C++]
PXCCaptureManager* CreateCaptureManager(void);
[C#]
PXCMCaptureManager CreateCaptureManager();
[Java]
PXCMCaptureManager CreateCaptureManager();

Parameters
None

Description
The CreateCaptureManager function creates an instance of the CaptureManager
interface.
Return Status
The CaptureManager instance, or NULL/null if there is any error.
2.11.15.2.4 CreateImage

Namespace Hierarchy
[C++]
PXCSession::CreateImage
[C#]
PXCMSession.CreateImage
[Java]
PXCMSession.CreateImage

Syntax
[C++]
PXCImage* CreateImage(PXCImage::ImageInfo *info, PXCImage::ImageData
*data);
PXCImage* CreateImage(PXCImage::ImageInfo *info);
[C#]
PXCMImage CreateImage(PXCMImage.ImageInfo info, PXCMImage.ImageData
data);
PXCMImage CreateImage(PXCMImage.ImageInfo info);

439

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[Java]
PXCMImage CreateImage(PXCMImage.ImageInfo info, PXCMImage.ImageData
data);
PXCMImage CreateImage(PXCMImage.ImageInfo info);

Parameters
info

The required image properties in the ImageInfo


structure.

data

Optional initialization data; see the ImageData


structure for details.

Description
The CreateImage function creates an instance of the Image interface to manage
image buffer access.
If data is specified, the SDK initializes the image buffer with the specified data, by
taking the buffer pointers or the OS-specific surface handle, without copying any data.
The formats in the ImageInfo structure and in the ImageData structure must match.
If data is not specified, the SDK creates the image buffer without initialization.
Return Status
The Image instance, or NULL/null if there is any error.
Example
Example 70 shows how to create an image object.
Example 70: Create an Image Object

[C++]
PXCImage::ImageInfo iinfo;
memset(&iinfo,0,sizeof(iinfo));
iinfo.width=640;
iinfo.height=480;
iinfo.format=PXCImage::COLOR_FORMAT_RGB24;
PXCImage *image=session->CreateImage(&iinfo);
...
image->Release();
[C#]
PXCMImage.ImageInfo iinfo=new PXCMImage.ImageInfo() {
width=640, height=480, format=PXCMImage.ColorFormat.COLOR_FORMAT_RGB24

440

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

};
PXCMImage image=session.CreateImage(iinfo);
...
image.Dispose();
[Java]
PXCMImage.ImageInfo iinfo=new PXCMImage.ImageInfo();
iinfo.width=640;
iinfo.height=480;
iinfo.format=PXCMImage.ColorFormat.COLOR_FORMAT_RGB24;
PXCMImage image=session.CreateImage(iinfo);
...
image.close();
2.11.15.2.5 CreateImpl

Namespace Hierarchy
[C++]
PXCSession::CreateImpl
[C#]
PXCMSession.CreateImpl
[Java]
PXCMSession.CreateImpl

Syntax
[C++]
pxcStatus CreateImpl(ImplDesc *desc, pxcUID iuid, pxcUID cuid, void
**instance);
pxcStatus CreateImpl(pxcUID iuid, pxcUID cuid, void **instance);
pxcStatus CreateImpl(pxcUID cuid, void **instance);
pxcStatus CreateImpl(ImplDesc *desc, pxcUID cuid, void **instance);
[C#]
pxcmStatus
instance);
pxcmStatus
pxcmStatus
pxcmStatus
[Java]
pxcmStatus
pxcmStatus
pxcmStatus
pxcmStatus

441

CreateImpl(ImplDesc desc, Int32 iuid, Int32 cuid, out PXCMBase


CreateImpl(Int32 iuid, Int32 cuid, out PXCMBase instance);
CreateImpl(Int32 cuid, out PXCMBase instance);
CreateImpl(ImplDesc desc, Int32 cuid, out PXCMBase instance);

CreateImpl(ImplDesc desc, int iuid, PXCMBase instance);


CreateImpl(int iuid, PXCMBase instance);
CreateImpl(PXCMBase instance);
CreateImpl(ImplDesc desc, PXCMBase instance);

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Parameters
desc

Optional module descriptor template; see the


ImplDesc structure for details.

iuid

The module implementation identifier.

cuid

The module interface identifier.

instance

Return the instance of the implementation.

Description
The CreateImpl function creates an instance of the I/O module or the algorithm
module. The module descriptor can be a complete module descriptor returned from
the QueryImpl function, or a template, in which case the SDK creates an instance of
the first I/O or algorithm module matched.
Return Status
STATUS_NO_ERROR

The function returned successfully.

STATUS_ITEM_UNAVAILABLE

Failed to identify a module that matches the


module descriptor, or the requested interface.

Remarks
[C++]

The application may use the corresponding templates CreateImpl<T> to enable type
checking. For example, the following statement creates an instance (into variable y) of
interface Y:
pxcStatus sts=session->CreateImpl<Y>(&y);
[C#]

The application may use the corresponding templates CreateImpl<T> to enable type
checking. For example, the following statement creates an instance (into variable y) of
interface Y:
pxcmStatus sts=session.CreateImpl<Y>(out y);
[Java]

The application must explicitly construct the returned instance using the default

442

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

constructor and then pass the instance to the function:


PXCMFaceModule face=new PXCMFaceModule();
pxcmStatus sts=session.CreateImpl(face);

2.11.15.2.6 CreatePhoto

Namespace Hierarchy
[C++]
PXCSession::CreatePhoto
[C#]
PXCMSession.CreatePhoto
[Java]
PXCMSession.CreatePhoto

Syntax
[C++]
PXCPhoto* CreatePhoto(void);
[C#]
PXCMPhoto CreatePhoto();
[Java]
PXCMPhoto CreatePhoto();

Parameters
None

Description
The CreatePhoto function creates an instance of the Photo interface.
The photo image is uninitialized at this time. Use the Photo functions to set the photo
content.
You need to release the instance after use.
Return Status
The Photo instance, or NULL/null if there is any error.

443

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.15.2.7 CreatePowerManager

Namespace Hierarchy
[C++]
PXCSession::CreatePowerManager
[C#]
PXCMSession.CreatePowerManager
[Java]
PXCMSession.CreatePowerManager

Syntax
[C++]
PXCPowerState* CreatePowerManager(void);
[C#]
PXCMPowerState CreatePowerManager();
[Java]
PXCMPowerState CreatePowerManager();

Parameters
None
Description
The CreatePowerManager function creates an instance of the PowerState interface.
Return Status
The PowerState instance, or NULL/null if there is any error.
2.11.15.2.8 CreateSenseManager

Namespace Hierarchy
[C++]
PXCSession::CreateSenseManager
[C#]
PXCMSession.CreateSenseManager
[Java]
PXCMSession.CreateSenseManager

444

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Syntax
[C++]
PXCSenseManager* CreateSenseManager(void);
[C#]
PXCMSenseManager CreateSenseManager();
[Java]
PXCMSenseManager CreateSenseManager();

Parameters
None

Description
The CreateSenseManager function creates an instance of the SenseManager
interface.
Return Status
The SenseManager instance, or NULL/null if there is any error.
2.11.15.2.9 LoadImplFromFile

Namespace Hierarchy
[C++]
PXCSession::LoadImplFromFile
[C#]
PXCMSession.LoadImplFromFile
[Java]
PXCMSession.LoadImplFromFile

Syntax
[C++]
pxcStatus LoadImplFromFile(pxcCHAR *fileName);
[C#]
pxcmStatus LoadImplFromFile(String fileName);
[Java]
pxcmStatus LoadImplFromFile(string fileName);

445

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Parameters
filename

The module shared library name.

Description
The LoadImplFromFile function loads a module implementation from a shared
library at run time.
Return Status
STATUS_NO_ERROR

The function returned successfully.

2.11.15.2.10 QueryCoordinateSystem

Namespace Hierarchy
[C++]
PXCSession::QueryCoordinateSystem
[C#]
PXCMSession.QueryCoordinateSystem
[Java]
PXCMSession.QueryCoordinateSystem

Syntax
[C++]
CoordinateSystem QueryCoordinateSystem(void);
[C#]
CoordinateSystem QueryCoordinateSystem();
[Java]
EnumSet<CoordinateSystem> QueryCoordinateSystem();

Parameters
None

Description

446

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The QueryCoordinateSystem function returns the current camera coordinate system


setting.
Return Status
The bit-OR'ed value of the camera coordinate settings. See the CoordinateSystem
enumerator for definitions.
2.11.15.2.11 QueryImpl

Namespace Hierarchy
[C++]
PXCSession::QueryImpl
[C#]
PXCMSession.QueryImpl
[Java]
PXCMSession.QueryImpl

Syntax
[C++]
pxcStatus QueryImpl(ImplDesc *template, pxcI32 idx, ImplDesc *desc);
[C#]
pxcmStatus QueryImpl(ImplDesc template, Int32 idx, out ImplDesc desc);
pxcmStatus QueryImpl(Int32 idx, out ImplDesc desc);
[Java]
pxcmStatus QueryImpl(ImplDesc template, int idx, ImplDesc desc);
pxcmStatus QueryImpl(int idx, ImplDesc desc);

Parameters

447

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

template

The module descriptor template; for any field


in the ImplDesc structure, a zero means
matching any values. For bit-ORed fields, a
none-zero value means matching the
corresponding bits.

idx

The zero-based index value if there are


multiple matches.

desc

The matched complete module descriptor, to


be returned.

Description
The QueryImpl function enumerates available modules according to the search
criteria (the module descriptor template, template). If there are multiple matches, the
application needs to increase the idx number to retrieve additional matches, until the
function returns STATUS_ITEM_UNAVAILABLE.
Return Status
STATUS_NO_ERROR

The function returned successfully.

STATUS_ITEM_UNAVAILABLE

There are no modules (or no further modules) that


match the template.

2.11.15.2.12 QueryImpls (JS)

Namespace Hierarchy
intel.realsense.Session.queryImpls

Syntax
function queryImpl(template);

Parameters

448

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

template

The module descriptor template; for any field


in the ImplDesc structure, a zero means
matching any values. For bit-ORed fields, a
none-zero value means matching the
corresponding bits.

Description
The QueryImpls function enumerates available modules according to the search
criteria (the module descriptor template, template).
Return Status
The returned promise object contains:
sts

The function returns status code. See pxcmStatus.

impls

The module descriptor array as defined in ImplDesc.

2.11.15.2.13 QueryModuleDesc (+JS)

Namespace Hierarchy
[C++]
PXCSession::QueryModuleDesc
[C#]
PXCMSession.QueryModuleDesc
[Java]
PXCMSession.QueryModuleDesc
[JavaScript]
intel.realsense.Session.queryModuleDesc

Syntax
[C++]
pxcStatus QueryModuleDesc(PXCBase *module, ImplDesc *mdesc);
[C#]
pxcmStatus QueryModuleDesc(PXCMBase module, out ImplDesc mdesc);
[Java]
pxcmStatus QueryModuleDesc(PXCMBase module, ImplDesc mdesc);

449

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[JavaScript]
function queryModuleDesc(module);

Parameters
module

The module instance.

mdesc

The module implementation descriptor, to be


returned.

Description
The QueryModuleDesc function returns the module implementation descriptor, in
the ImplDesc structure.
Return Status
[C++][C#][Java]
STATUS_NO_ERROR

The function returned successfully.

STATUS_ITEM_UNAVAILABLE

The module instance is not identified.

[JavaScript]

The returned promise object contains:


sts

The function returns status code. See Status.

mdesc

The module descriptor. See ImplDesc.

2.11.15.2.14 QueryVersion

Namespace Hierarchy
[C++]
PXCSession::QueryVersion
[C#]
PXCMSession.QueryVersion
[Java]
PXCMSession.QueryVersion

450

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Syntax
[C++]
ImplVersion QueryVersion(void);
[C#]
ImplVersion QueryVersion();
[Java]
ImplVersion QueryVersion();

Parameters
None

Description
The QueryVersion function returns the SDK API version.
Return Status
The SDK version in the ImplVersion structure.
Remarks
[C#]

The C# application can also use property version.

2.11.15.2.15 SetCoordinateSystem

Namespace Hierarchy
[C++]
PXCSession::SetCoordinateSystem
[C#]
PXCMSession.SetCoordinateSystem
[Java]
PXCMSession.SetCoordinateSystem

Syntax
[C++]
pxcStatus SetCoordinateSystem(CoordinateSystem value);
[C#]
451

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

pxcmStatus SetCoordinateSystem(CoordinateSystem value);


[Java]
pxcmStatus SetCoordinateSystem(EnumSet<CoordinateSystem> value);

Parameters
value

The coordinate system setting; see the


CoordinateSystem enumerator for definitions.

Description
The SetCoordinateSystem function sets the current camera coordinate system
value.
To change the coordinate system, you must call the SetCoordinateSystem
function before any camera device or the algorithm instance is created. In the case of
using the SenseManager interface, set the coordinate system right after creating the
SenseManager instance and before any EnableXXX functions. The behavior is
undefined if you change the coordinate system setting after the capture or algorithm
instances are created or in the middle of streaming.
Return Status
STATUS_NO_ERROR

The function returned successfully.

2.11.15.2.16 UnloadImplFromFile

Namespace Hierarchy
[C++]
PXCSession::UnloadImplFromFile
[C#]
PXCMSession.UnloadImplFromFile
[Java]
PXCMSession.UnloadImplFromFile

Syntax
[C++]
pxcStatus UnloadImplFromFile(pxcCHAR *dllName);
[C#]
pxcmStatus UnloadImplFromFile(String dllName);

452

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[Java]
pxcmStatus UnloadImplFromFile(string dllName);

Parameters
dllName

The module shared library name.

Description
The UnloadImplFromFile function removes a module implementation. The shared
library is unloaded from memory.
Return Status
STATUS_NO_ERROR

The function returned successfully.

STATUS_ITEM_UNAVAILABLE

Failed to locate the specified module.

2.11.15.3 Properties (C#, JS)

The Session interface exposes the following properties:


Property

Description

version

Access to the SDK version.

2.11.15.3.1 version

Namespace Hierarchy
[C#]
Session.version
[JavaScript]
intel.realsense.Session.version

Syntax
[C#]
ImplVersion version {
get;
}
[JavaScript]

453

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Data Type

{
version,

ImplVersion

Description
The version property gets the SDK version.
Remarks
[C#]

The application can also use member function QueryVersion.

2.11.15.4 Static Functions

The Session interface exposes the following static functions:


Member Functions

Description

CreateInstance

Create an instance of the Session interface.

2.11.15.4.1 CreateInstance

Namespace Hierarchy
[C++]
PXCSession::CreateInstance
[C#]
PXCMSession.CreateInstance
[Java]
PXCMSession.CreateInstance

Syntax
[C++]
static PXCSession* CreateInstance(void);
[C#]
static PXCMSession CreateInstance();
[Java]
static PXCMSession CreateInstance();

454

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Parameters
None
Description
The CreateInstance function creates an instance of the Session interface.
Return Status
The Session instance, or NULL/null if there is any error.

2.11.16 SyncPoint
Namespace Hierarchy
[C++]
PXCSyncPoint
[C#]
PXCMSyncPoint
[Java]
PXCMSyncPoint

Description
The SyncPoint interface manages the synchronization of any asynchronous execution.
The SP (Sync Point) is created by each SDK asynchronous function. The application must
release the SP after synchronization.
Reference
[C++]
pxcsyncpoint.h
[C#/.NET4]
libpxcclr.cs.dll
[C#/Unity]
libpxcclr.unity.dll
[Java]
libpxcclr.java.jar
[Processing]

455

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

libpxcclr_processing

Runtime
[C++][C#][Java]

Install SDK runtime: core


See Also
Constants
Member Functions
Static Functions
2.11.16.1 Constants

The SyncPoint interface exposes the following constants:


Constant

Description

CUID

The interface identifier.

TIMEOUT_INFINITE

Wait infinitely for synchronization.

SYNCEX_LIMIT

The maximum number of SPs for which the SynchronizeEx


function can wait.

2.11.16.2 Member Functions

The SyncPoint interface exposes the following member functions:


Member Functions

Description

Synchronize

Synchronize an asynchronous execution.

2.11.16.2.1 Synchronize

Namespace Hierarchy
[C++]
PXCSyncPoint::Synchronize
[C#]
PXCMSyncPoint.Synchronize
[Java]
PXCMSyncPoint.Synchronize

Syntax
[C++]
pxcStatus Synchronize(pxcI32 timeout);
456

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

pxcStatus Synchronize(void);
[C#]
pxcmStatus Synchronize(Int32 timeout);
pxcmStatus Synchronize();
[Java]
pxcmStatus Synchronize(int timeout);
pxcmStatus Synchronize();

Parameters
timeout

The time out value in milliseconds.

Description
The Synchronize function waits until an asynchronous execution is completed, or
returns due to time out.
If timeout is omitted, the function waits infinitely until an asynchronous execution is
completed.
Return Status
STATUS_EXEC_TIMEOUT

The asynchronous operation is still running. The


function returns due to time out.

Other values

The return status of the completed asynchronous


operation.

2.11.16.3 Static Functions

The SyncPoint interface exposes the following static functions:


Member Functions

Description

SynchronizeEx

Synchronize multiple sync points.

ReleaseSP

Release an array of sync points.

2.11.16.3.1 ReleaseSP

Namespace Hierarchy
[C++]
PXCSyncPoint::ReleaseSP

457

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C#]
PXCMSyncPoint.ReleaseSP
[Java]
PXCMSyncPoint.ReleaseSP

Syntax
[C++]
static void ReleaseSP(SyncPoint[] sps, pxcI32 startIndex, pxcI32 nitems);
[C#]
static void ReleaseSP(SyncPoint[] sps, Int32 startIndex, Int32 nitems);
static void ReleaseSP(SyncPoint[] sps);
[Java]
static void ReleaseSP(SyncPoint[] sps, int startIndex, int nitems);
static void ReleaseSP(SyncPoint[] sps);

Parameters
sps

The SP array, whose elements are to be


released.

startIndex

The start index of the SP element.

nitems

The number of SP elements to be released.

Description
The ReleaseSP function resets an SP array by releasing each array element. If
startIndex and nitems are omitted, the function works on the entire array.
The SP array object is not released.
Return Status
None
Remarks
[C++]

If an SP array element is not NULL, the function uses the Release function to release it.
The application must zero the SP array for any newly-allocated SP array as follows:
SyncPoint **sps=new SyncPoint*[4];
memset(sps,0,sizeof(sps));

458

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[Java]

The function constructs each array element, if not already constructed. The application
can use this function to initialize a newly allocated SP array.

2.11.16.3.2 SynchronizeEx

Namespace Hierarchy
[C++]
PXCSyncPoint::SynchronizeEx
[C#]
PXCMSyncPoint.SynchronizeEx
[Java]
PXCMSyncPoint.SynchronizeEx

Syntax
[C++]
static
pxcHDL
static
pxcI32
static
static

pxcStatus SynchronizeEx(pxcI32 n1, SyncPoint


*objs, pxcI32 *idx, pxcI32 timeout);
pxcStatus SynchronizeEx(pxcI32 n1, SyncPoint
timeout);
pxcStatus SynchronizeEx(pxcI32 n1, SyncPoint
pxcStatus SynchronizeEx(pxcI32 n1, SyncPoint

[C#]
static pxcmStatus
timeout);
static pxcmStatus
static pxcmStatus
static pxcmStatus
[Java]
static
static
static
static

pxcmStatus
pxcmStatus
pxcmStatus
pxcmStatus

**sps, pxcI32 n2,


**sps, pxcI32 *idx,
**sps, pxcI32 *idx);
**sps);

SynchronizeEx(SyncPoint[] sps, out Int32 idx, Int32


SynchronizeEx(SyncPoint[] sps, out Int32 idx);
SynchronizeEx(SyncPoint[] sps, Int32 timeout);
SynchronizeEx(SyncPoint[] sps);

SynchronizeEx(SyncPoint[]
SynchronizeEx(SyncPoint[]
SynchronizeEx(SyncPoint[]
SynchronizeEx(SyncPoint[]

sps, int[] idx, int timeout);


sps, int[] idx);
sps, int timeout);
sps);

Parameters

459

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

n1

The number of synchronization points.

sps

The synchronization point array. The function


skips any invalid SPs (NULL/null value).

n2

The number of OS-specific synchronization


objects.

objs

An optional array of OS-specific


synchronization objects. In Windows*, the
objects can be mutexes, semaphores, events,
or thread handles.

idx

An optional output to return the completed


sync point index; if the synchronization points
signal, the index is from 0 to n1-1. If the OSspecific synchronization objects signal, the
index is from n1 to n1+n2-1.

timeout

The time out value in milliseconds.

Description
The SynchronizeEx function SynchronizeEx waits until one or all of the sync points
signals, or times out.
If idx is provided, the function returns if any of the sync points signals. If idx is not
provided, the function returns after all sync points signal.
If timeout is not provided, the function waits infinitely until one or all of the sync
points signals.
If multiple sync points signal, the function only returns the smallest index of sync
point that signals. The application needs to loop through the status of all sync points
to cover all signaled sync points.
There is a limit to how many SPs the function can wait on. The limit is specified as
SYNCEX_LIMIT, and is OS-specific.
Return Status

460

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

STATUS_PARAM_UNSUPPORTED

The number of synchronization objects


exceeds OS limitation.

STATUS_TIMEOUT

The asynchronous operation is still running.


The function returns due to time out.

STATUS_NO_ERROR

All asynchronous operations are completed.


Check each synchronization point for
completed return status.

Other values

If one of the synchronization points


(SyncPoint) signals, the function returns the
status of the synchronization.

Remarks
[C#]

The OS-specific events are not supported in C#.


[Java]

The OS-specific events are not supported in Java.


If idx is specified, the SP index is returned in idx[0].

2.11.17 VideoModule
Namespace Hierarchy
[C++]
PXCVideoModule
[C#]
PXCMVideoModule
[Java]
PXCMVideoModule

Description
The VideoModule interface exposes video module common methods.
Reference
[C++]

461

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

pxcvideomodule.h
[C#/.NET4]
libpxcclr.cs.dll
[C#/Unity]
libpxcclr.unity.dll
[Java]
libpxcclr.java.jar
[Processing]
libpxcclr_processing

Runtime
[C++][C#][Java]

Install SDK runtime: core


Example
The application can query this interface from any SDK video module implementation, as
illustrated in Example 71.
Example 71: Retrieve Video Module Common Interface

[C++]
// face is a PXCFaceModule instance
PXCVideoModule *module=face->QueryInstance<PXCVideoModule>();
[C#]
// face is a PXCMFaceModule instance
PXCMVideoModule module=face.QueryInstance<PXCMVideoModule>();
[Java]
// face is a PXCMFaceModule instance
PXCMVideoModule module=(PXCMVideoModule)
face.QueryInstance(PXCMVideoModule.CUID);

See Also
Constants
Member Functions

462

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.17.1 Constants

The VideoModule interface exposes the following constants:


Constant

Description

CUID

The interface identifier.

DEVCAP_LIMIT

The number of device properties that can be requested by a


module.

2.11.17.2 Member Functions

The VideoModule interface exposes the following member functions:


Member Functions

Description

QueryCaptureProfile Query the available configuration parameters.


SetCaptureProfile

Set the working configuration parameters.

ProcessImageAsync

Feed data to the video module for algorithm processing.

ProcessSample

Synchronously execute the video module algorithm.

SetProjection

Set the Projection instance.

SetGPUExec

Fine-tune GPU execution behavior.

2.11.17.2.1 ProcessImageAsync

Namespace Hierarchy
[C++]
PXCVideoModule::ProcessImageAsync
[C#]
PXCMVideoModule.ProcessImageAsync
[Java]
PXCMVideoModule.ProcessImageAsync

Syntax
[C++]
pxcStatus ProcessImageAsync(PXCImage *images[], SyncPoint **sp);
[C#]
pxcmStatus ProcessImageAsync(PXCMImage[] images, out SyncPoint sp);
[Java]
pxcmStatus ProcessImageAsync(PXCMImage[] images, SyncPoint sp);

463

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Parameters
images

The array of incoming image data.

sp

The SP, to be returned.

Description
The ProcessImageAsync function feeds the input streams to the video module for
processing. The array of the input streams must be big enough to provide the
required streams and in the right order as reported by the algorithm configuration.
This function is asynchronous. The intermediate processing results are not available
until after the application synchronizes the SP.
Return Status
STATUS_NO_ERROR

The function returned successfully.

Remarks
The application that uses the SenseManager interface to manage the multimodal
pipeline does not use this function. The SenseManager interface internally invokes
this function for algorithm data processing.
2.11.17.2.2 ProcessSample

Namespace Hierarchy
[C++]
PXCVideoModule::ProcessSample
[C#]
PXCMVideoModule.ProcessSample
[Java]
PXCMVideoModule.ProcessSample

Syntax
[C++]
pxcStatus ProcessSample(Sample *sample);
[C#]
pxcmStatus ProcessSample(Sample sample);
464

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[Java]
pxcmStatus ProcessSample(Sample sample);

Parameters
sample

The Sample instance.

Description
The ProcessSample function feeds the input streams to the video module for
processing.
This function blocks until the video module processing is completed.
Return Status
STATUS_NO_ERROR

The function returned successfully.

Remarks
The application that uses the SenseManager interface to manage the multimodal
pipeline does not need to use this function.
2.11.17.2.3 QueryCaptureProfile

Namespace Hierarchy
[C++]
PXCVideoModule::QueryCaptureProfile
[C#]
PXCMVideoModule.QueryCaptureProfile
[Java]
PXCMVideoModule.QueryCaptureProfile

Syntax
[C++]
pxcStatus
pxcStatus

QueryCaptureProfile(pxcI32 index, DataDesc *inputs);


QueryCaptureProfile(DataDesc *inputs);

[C#]
pxcmStatus QueryCaptureProfile(Int32 index, out DataDesc inputs);
pxcmStatus QueryCaptureProfile(out DataDesc inputs);

465

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[Java]
pxcmStatus QueryCaptureProfile(int index, DataDesc inputs);
pxcmStatus QueryCaptureProfile(DataDesc inputs);

Parameters
index

The zero-based index to enumerate all


available configuration parameters.

inputs

The configuration parameters, to be returned;


see the DataDesc structure definition.

Description
The QueryCaptureProfile function enumerates all available configuration
parameters for configuring the video module inputs.
If index is omitted, the function returns the current working configuration parameters.
Return Status
STATUS_NO_ERROR

The function returned successfully.

STATUS_ITEM_UNAVAILABLE

The requested configuration parameters are


not available.

Remarks
The application that uses the SenseManager interface to manage the multimodal
pipeline does not use this function. The SenseManager interface internally invokes
this function for algorithm data processing.

466

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.11.17.2.4 SetCaptureProfile

Namespace Hierarchy
[C++]
PXCVideoModule::SetCaptureProfile
[C#]
PXCMVideoModule.SetCaptureProfile
[Java]
PXCMVideoModule.SetCaptureProfile

Syntax
[C++]
pxcStatus

SetCaptureProfile(DataDesc *inputs);

[C#]
pxcmStatus SetCaptureProfile(DataDesc inputs);
[Java]
pxcmStatus SetCaptureProfile(DataDesc inputs);

Parameters
inputs

The configuration parameters as described in


the DataDesc structure.

Description
The SetCaptureProfile function sets the video module configuration parameters.
Return Status
STATUS_NO_ERROR

The function returned successfully.

Remarks
The application that uses the SenseManager interface to manage the multimodal
pipeline does not use this function. The SenseManager interface internally invokes
this function for algorithm data processing.
2.11.17.2.5 SetGPUExec

Namespace Hierarchy
467

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C++]
PXCVideoModule::SetGPUExec
[C#]
PXCMVideoModule.SetGPUExec
[Java]
PXCMVideoModule.SetGPUExec

Syntax
[C++]
void SetGPUExec(bool enable, int32_t taskId);
void SetGPUExec(bool enable);
void SetGPUExec();
[C#]
void SetGPUExec(Boolean enable, Int32 taskId);
void SetGPUExec(Boolean enable);
void SetGPUExec();
[Java]
void SetGPUExec(boolean enable, int taskId);
void SetGPUExec(boolean enable);
void SetGPUExec();

Parameters
enable

Enable/disable GPU execution.

taskId

Reserved; must be -1.

Description
The SetGPUExec function fine-tunes the algorithm GPU optimization behavior. By
default, the algorithm module enables all GPU optimizations. The function can be
used to move certain GPU executions to CPU.
Return Status
None

2.11.17.2.6 SetProjection

Namespace Hierarchy
[C++]
468

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

PXCVideoModule::SetProjection
[C#]
PXCMVideoModule.SetProjection
[Java]
PXCMVideoModule.SetProjection

Syntax
[C++]
void SetProjection(PXCProjection *projection);
[C#]
void SetProjection(PXCMProjection projection);
[Java]
void SetProjection(PXCMProjection rojection);

Parameters
projection

The Projection instance.

Description
The SetProjection function sets the Projection instance for the video module
algorithm.
Return Status
None

2.12

Structure Reference
This section describes the structure definitions of the Intel RealSense SDK essential
interfaces.
Naming Conventions
For C++, C# and Java, this manual uses [M] (where M stands for "managed") in the interface
names to represent interfaces that are available in a managed environment (such as C# and
Java). For example, Capture represents the C++ interface PXCCapture and the C#, and Java
interface PXCMCapture.
The manual uses additional markings after the interface or method names as follows:

469

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Marking

Example

Comment

None

Base

Common for all languages and


frameworks, except JavaScript and
UWP interfaces. JavaScript and UWP
interfaces or methods are listed
separately.

(C++)

PXCBase.Release

C++ specific interface or methods.

(C#)

PXCMBase.Dispose

C# and Unity C# specific interface or


methods.

(C#.NET4)

PXCMImage.ImageData.ToBitmap

C# .NET4 specific interface or


methods. Not available in Unity C#.

(Unity)

PXCMImage.ImageData.ToTexture2 Unity C# specific interface or methods.


D
Not available in C#.

(Java)

PXCMBase.close

Java and Processing specific interface


or methods.

(Processing) PXCMImage.ImageData.ToPImage

Processing specific interface or


methods. Not available in Java.

(JS)

PXCMSession.QueryImpls

JavaScript specific interface or


methods.

(+JS)

PXCMSession.QueryModelDesc

Emphasize that the JavaScript


language is part of this function along
with other language interfaces.

(UWP)

SampleReader.EnableStream[s]

UWP specific interface or methods.

(+UWP)

SenseManager.CreateInstance

Emphasize that the UWP interface is


part of this function along with other
language interfaces.

2.12.1 Box3DF32
Namespace Hierarchy
[C++]
PXCBox3DF32
[C#]
PXCMBox3DF32
[Java]
PXCMPoint3DF32

Definition
[C++]
470

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

struct PXCBox3DF32 {
PXCPoint3DF32 centerOffset;
PXCPoint3DF32 dimension;
};
[C#]
class PXCMBox3DF32 {
PXCMPoint3DF32 centerOffset;
PXCMPoint3DF32 dimension;
};
[Java]
class PXCMPoint3DF32 {
PXCMPoint3DF32 centerOffset;
PXCMPoint3DF32 dimension;
};

Description
The Box3DF32 structure defines a 3D box.
Members
centerOffset

The center of the 3D box.

dimension

The dimension of the 3D box.

2.12.2 DataDesc
Namespace Hierarchy
[C++]
PXCVideoModule::DataDesc
[C#]
PXCMVideoModule.DataDesc
[Java]
PXCMVideoModule.DataDesc

Definition
[C++]
struct DataDesc {
StreamDescSet streams;
DeviceCap
devCaps[];
DeviceInfo
deviceInfo;
};

471

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C#]
class DataDesc {
StreamDescSet streams;
DeviceCap[]
devCaps;
DeviceInfo
deviceInfo;
};
[Java]
class DataDesc {
StreamDescSet streams;
DeviceCap[]
devCaps;
DeviceInfo
deviceInfo;
};

Description
The DataDesc structure describes the video stream I/O data needs for a processing
module. Unused fields must be set to zero.
Constructors
The default constructor value initializes all field values.
Members
streams

Description of all streams needed by the processing


module. See the StreamDescSet structure for stream
description definitions.

devCaps

Description of additional device properties required by the


processing module. See the DeviceCap structure for device
property definitions.

deviceInfo

Description of the requested device information. Any nonzero values are matched. See the DeviceInfo structure for
definitions.

2.12.3 DeviceCap
Namespace Hierarchy
[C++]
PXCVideoModule::DeviceCap
[C#]
PXCMVideoModule.DeviceCap

472

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[Java]
PXCMVideoModule.DeviceCap

Definition
[C++]
struct DeviceCap {
Property label;
pxcF32
value;
};
[C#]
struct DeviceCap {
Property label;
Single
value;
};
[Java]
class DeviceCap {
Property label;
float
value;
};

Description
The DeviceCap structure describes a device property and its value.
Members
label

The device property label. See the Property enumerator


for definitions. If this value is negative, the property
(specified by its absolute value) is an optional property.

value

The property value in floating point number.

2.12.4 DeviceInfo (Capture,+JS,+UWP)


Namespace Hierarchy
[C++]
PXCCapture::DeviceInfo
[C#]
PXCMCapture.DeviceInfo
[Java]
PXCMCapture.DeviceInfo

473

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[JavaScript]
intel.realsense.DeviceInfo
[C#/UWP]
Intel.RealSense.DeviceInfo

Definition
[C++]
struct DeviceInfo {
pxcCHAR
pxcCHAR
pxcCHAR
pxcI32
PXCPointF32
DeviceModel
DeviceOrientation
StreamType
pxcI32
pxcI32
Rotation
ConnectionType
};
[C#]
class DeviceInfo {
String
String
String
Int32[]
PXCMPointF32
DeviceModel
DeviceOrientation
StreamType
Int32
Int32
Rotation
ConnectionType
};
[Java]
class DeviceInfo {
string
string
string
int[]
PXCMPointF32
DeviceModel
DeviceOrientation
StreamType
int

474

name[224];
serial[32];
did[256];
firmware[4];
location;
model;
orientation;
streams;
didx;
duid;
rotation;
connectionType;

name;
serial;
did;
firmware;
location;
model;
orientation;
streams;
didx;
duid;
rotation;
connectionType;

name;
serial;
did;
firmware;
location;
model;
orientation;
streams;
didx;

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

int
Rotation
ConnectionType

duid;
rotation;
connectionType;

};
[JavaScript]
Data Type

{
name,

string

serial,

string

did,

string

firmware,

number array

location,

PointF32

model,

DeviceModel

orientation,

DeviceOrientation

streams,

StreamType

didx,

number

duid,

number

connectionType,

ConnectionType

}
[C#/UWP]
class DeviceInfo {
String
String
String
Int32[]
Point
DeviceModel
DeviceOrientation
Rotation
ConnectionType
};

Name;
Serial;
DeviceId;
Firmware;
Location;
Model;
Orientation;
Rotation;
connectionType;

Description
The DeviceInfo structure provides the capture device information.
Members

475

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

name/Name

The NULL-terminated (C++) user-friendly device name


string.

serial/Serial

The serial number string of the device.

did/DeviceId

The NULL-terminated (C++) unique string to identify the


capture device, or the symbolic link of the device.

firmware/Firmware

The firmware version of the device.

location/Location

The device location relative to be lower left of the display


panel, positive X to the right and positive Y to up. The values
are in mm.

orientation/
Orientation

The device orientation.

streams

The bit-OR'ed value of all stream types the device supports.

didx

The zero-based device index if there are multiple devices


on the system.

duid

The unique identifier of the device. The identifier is


randomly generated and remains unique for a specific SDK
session. Mostly used in power management to identify the
device.

connectionType

The indicator of how the device is connected to the system.


See the ConnectionType enumerator for definitions.

Example
Example 72 shows how to enumerate device information.
Example 72: Enumerate Device Information

[C++]
// PXCCapture *capture;
for (int i=0;;i++) {
PXCCapture::DeviceInfo dinfo;
if (capture->QueryDeviceIfo(i,&dinfo)<PXC_STATUS_NO_ERROR) break;
wprintf_s(L"device[%d]: %s\n", i, dinfo.name);
}
[C#]
// PXCMCapture capture;
for (int i=0;;i++) {
PXCMCapture.DeviceInfo dinfo;
476

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

if (capture.QueryDeviceInfo(i,out dinfo).IsError()) break;


Console.WriteLn("device{0}: {1}", i, dinfo.name);
}
[Java]
// PXCMCapture capture;
for (int i=0;;i++) {
PXCMCapture.DeviceInfo dinfo=new PXCMCapture.DeviceInfo();
if (capture.QueryDeviceInfo(i,dinfo).isError()) break;
System.printf("device%d: %s%n", i, dinfo.name);
}
[JavaScript]
// Enumerating devices is not supported in JavaScript.
// You can enumerate the current device information from SenseManager
// Assume sm is the SenseManager instance
var dinfo=sm.captureManager.device.deviceInfo;
[C#/UWP]
// sm is the SenseManager instance;
List<Device> devices=await Device.FindAllAsync(sm);
foreach (Device device in devices) {
DeviceInfo dinfo=device.DeviceInfo;
...
}

2.12.5 ImageData
Namespace Hierarchy
[C++]
PXCImage::ImageData
[C#]
PXCMImage.ImageData
[Java]
PXCMImage.ImageData

Definition
[C++]
struct ImageData {
PixelFormat format;
pxcI32
pitches[4];
pxcBYTE
*planes[4];
};
[C#]
struct ImageData {
PixelFormat
format;

477

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Int32[]
IntPtr[]

pitches;
planes;

};
[Java]
struct ImageData {
PixelFormat
format;
int[]
pitches;
};

Description
The ImageData structure describes image storage details.
Members
format

The pixel format of image samples. See the PixelFormat


enumerator for definitions.

planes

Image plane buffers. Compacted or compressed images use


planes [0] to point to a single continuous buffer.

pitches

Pitches of the plane buffers.

Remarks
[C#]

The planes field points to array of pointers to the image buffers in the unmanaged
memory. The application can use marhsal copy or the provided member functions to
access to the image buffers.
[Java]

The application must use the provided member functions to access to the image
buffers.

See Also
Member Functions
2.12.5.1 Member Functions

The ImageData structures exposes the following member functions:

478

Member Functions

Description

ToByteArray

Export the data plane to the destination array.

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

ToFloatArray
ToShortArray
FromByteArray
FromFloatArray
FromShortArray

Import the data plane from the destination array.

ToBitmap
ToWriteableBitmap

Export the image data to a bitmap or a writable bitmap.

FromTexture2D (Unity) Import and export functions for Unity.


ToTexture2D (Unity)
FromPImage
Import and export functions for Processing.
(Processing)
ToPImage (Processing)
2.12.5.1.1 FromByteArray (C#,Java)

Namespace Hierarchy
[C#]
PXCMImage.ImageData.FromByteArray
[Java]
PXCMImage.ImageData.FromByteArray

Syntax
[C#]
void FromByteArray(Int32 index, Byte[] src);
[Java]
void FromByteArray(int index, byte[] src);

Parameters
index

The data plane index.

src

The source data array.

Description
The FromByteArray function imports from the source byte array to the image data
plane.
Return Status

479

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

None
2.12.5.1.2 FromFloatArray (C#,Java)

Namespace Hierarchy
[C#]
PXCMImage.ImageData.FromFloatArray
[Java]
PXCMImage.ImageData.FromFloatArray

Syntax
[C#]
void FromFloatArray(Int32 plane, Single[] src);
[Java]
void FromFloatArray(int plane, float[] src);

Parameters
plane

The data plane index

src

The source data array.

Description
The FromFloatArray function imports the source data array to the image plane.
Return Status
None
2.12.5.1.3 FromPImage (Processing)

Namespace Hierarchy
PXCMImage.ImageData.FromPImage

Syntax
void FromPImage(int index, PImage src);

480

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Parameters
index

The data plane index.

src

The source image instance. The image format


must be RGB.

Description
The FromPImage function imports from a source image instance. The image format
must be RGB.
The application must use AcquireAccess(..., COLOR_FORMAT_RGB32, ...) to
force conversion of any native color format to the RGB32 color format before using
this function.
Return Status
None
2.12.5.1.4 FromShortArray (C#,Java)

Namespace Hierarchy
[C#]
PXCMImage.ImageData.FromShortArray
[Java]
PXCMImage.ImageData.FromShortArray

Syntax
[C#]
void FromShortArray(Int32 plane, Int16[] src);
[Java]
void FromShortArray(int plane, short[] src);

Parameters
plane

The data plane index

src

The source data array.

Description
481

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The FromShortArray function imports the source data array to the data plane.
Return Status
None
2.12.5.1.5 FromTexture2D (Unity)

Namespace Hierarchy
PXCMImage.ImageData.FromTexture2D

Syntax
void FromTexture2D(Int32 plane, Texture2D texture);

Parameters
plane

The data plane index.

texture

The source Texture2D instance. The texture


format must be TextureFormat.RGBA32.

Description
The FromTexture2D function imports from a source Texture2D instance. The texture
image must be in the format of TextureFormat.RGBA32.
The application must run this function in the Unity main thread.
The application must use AcquireAccess(..., COLOR_FORMAT_RGB32, ...) to
force conversion of any native color format to the RGB32 color format before using
this function.
Return Status
None
2.12.5.1.6 FromUShortArray (C#)

Namespace Hierarchy

482

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

PXCMImage.ImageData.FromUShortArray

Syntax
void FromUShortArray(Int32 plane, UInt16[] src);

Parameters
plane

The data plane index

src

The source data array.

Description
The FromUShortArray function imports the source data array to the data plane.
Return Status
None
2.12.5.1.7 ToBitmap (C# .NET4)

Namespace Hierarchy
PXCMImage.ImageData.ToBitmap

Syntax
System.Drawing.Bitmap ToBitmap(Int32 plane, Int32 width, Int32
height);
System.Drawing.Bitmap ToBitmap(Int32 plane, System.Drawing.Bitmap
bitmap);

Parameters
plane

The data plane index.

width, height

The bitmap resolution in width and height.

bitmap

The application allocated bitmap instance.

Description

483

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

There are two forms of the ToBitmap function:


If you provide an application allocated bitmap instance, the function copies the
image content to the bitmap and return the same bitmap instance.
If you do not provide the bitmap instance, the function creates a bitmap instance
with the specified width and height parameters, referencing the image content. You
must maintain the life cycle of the image object before the bitmap is released.
The following color formats are supported by the .NET 4.0 framework natively:
PIXEL_FORMAT_RGB32
PIXEL_FORMAT_RGB24
PIXEL_FORMAT_DEPTH
PIXEL_FORMAT_DEPTH_RAW

The application may convert any native color format to one of above formats as
follows:
PXCMImage.ImageData data;
image.AcquireAccess(PXCMImage.Access.ACCESS_READ,
PXCMImage.PixelFormat.PIXEL_FORMAT_DEPTH, out data);
Bitmap bitmap=data.ToBitmap(...);
...
image.ReleaseAccess(data);

Return Status
The System.Drawing.Bitmap bitmap instance, or null if there is any error.
2.12.5.1.8 ToByteArray (C#,Java)

Namespace Hierarchy
[C#]
PXCMImage.ImageData.ToByteArray
[Java]
PXCMImage.ImageData.ToByteArray

Syntax
[C#]
Byte[] ToByteArray(Int32 plane, Int32 size);
Byte[] ToByteArray(Int32 plane, Byte[] dest);
[Java]
byte[] ToByteArray(int plane, int size);
byte[] ToByteArray(int plane, byte[] dest);
484

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Parameters
plane

The data plane index

size

The data array size

dest

The application-allocated destination array.

Description
The ToByteArray function retrieves a copy of the image data plane as a byte array.
Return Status
The byte array instance, or null if there is any error.
2.12.5.1.9 ToFloatArray (C#,Java)

Namespace Hierarchy
[C#]
PXCMImage.ImageData.ToFloatArray
[Java]
PXCMImage.ImageData.ToFloatArray

Syntax
[C#]
Single[] ToFloatArray(Int32 plane, Int32 size);
Single[] ToFloatArray(Int32 plane, Single[] dest);
[Java]
float[] ToFloatArray(int plane, int size);
float[] ToFloatArray(int plane, float[] dest);

Parameters

485

plane

The data plane index

size

The data array size

dest

The application-allocated destination array.

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Description
The ToFloatArray function retrieves a copy of the image plane as a float array.
Return Status
The float array instance, or null if there is any error.
2.12.5.1.10 ToPImage (Processing)

Namespace Hierarchy
PXCMImage.ImageData.ToPImage

Syntax
PImage ToPImage(int index, PImage dest);

Parameters
index

The data plane index.

dest

The application allocated PImage instance. The


image format must be RGB.

Description
The ToPImage function exports the image data object to an application created
PImage instance.
The image format must be RGB.
The application must use AcquireAccess(..., COLOR_FORMAT_RGB32, ...) to
force conversion of any native color format to the RGB32 color format before using
this function.
Return Status
The PImage instance, or null if there is any error.

486

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.12.5.1.11 ToShortArray (C#,Java)

Namespace Hierarchy
[C#]
PXCMImage.ImageData.ToShortArray
[Java]
PXCMImage.ImageData.ToShortArray

Syntax
[C#]
Int16[] ToShortArray(Int32 plane, Int32 size);
Int16[] ToShortArray(Int32 plane, Int16[] dest);
[Java]
short[] ToShortArray(int plane, int size);
short[] ToShortArray(int plane, short[] dest);

Parameters
plane

The data plane index.

size

The data array size.

dest

The application-allocated destination array.

Description
The ToShortArray function retrieves a copy of the image plane as a short array.
Return Status
The short array instance, or null if there is any error.
2.12.5.1.12 ToTexture2D (Unity)

Namespace Hierarchy
PXCMImage.ImageData.ToTexture2D

Syntax
Texture2D ToTexture2D(Int32 plane, Int32 width, Int32 height);

487

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Texture2D ToTexture2D(Int32 plane, Texture2D texture);

Parameters
plane

The data plane index.

width, height

The image resolution in width and height.

texture

The application allocated Texture2D instance.


The texture format must be
TextureFormat.RGBA32.

Description
The ToTexture2D function exports the image data object to an application created or
internally allocated Texture2D instance.
The texture is in the format of TextureFormat.RGBA32.
The application must run this function in the Unity main thread.
The application must use AcquireAccess(..., COLOR_FORMAT_RGB32, ...) to
force conversion of any native color format to the RGB32 color format before using
this function.
Return Status
The Texture2D instance, or null if there is any error.
2.12.5.1.13 ToUShortArray (C#)

Namespace Hierarchy
PXCMImage.ImageData.ToUShortArray

Syntax
UInt16[] ToUShortArray(Int32 plane, Int32 size);
UInt16[] ToUShortArray(Int32 plane, UInt16[] dest);

Parameters

488

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

plane

The data plane index.

size

The data array size.

dest

The application-allocated destination array.

Description
The ToUShortArray function retrieves a copy of the image plane as an unsigned short
array.
Return Status
The unsigned short array instance, or null if there is any error.
2.12.5.1.14 ToWriteableBitmap (C# .NET4)

Namespace Hierarchy
PXCMImage.ImageData.ToWriteableBitmap

Syntax
System.Windows.Media.Imaging.WritableBitmap ToWriteableBitmap(Int32
width, Int32 height, Double dpiX, Double dpiY);
System.Windows.Media.Imaging.WritableBitmap ToWriteableBitmap(Int32
plane, Int32 width, Int32 height, Double dpiX, Double dpiY);

Parameters
plane

The data plane index.

width, height

The bitmap resolution in width and height.

dpiX, dpiY

The bitmap dot density (dot per inch.)

Description

489

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The ToWriteableBitmap function creates a


System.Windows.Media.Imaging.WritableBitmap bitmap instance from the image

data object. The bitmap directly refers to image data in the image data object. The
application must maintain the life cycle of the image data object before the bitmap is
disposed.
The following color formats are supported by the .NET 4.0 framework natively:
COLOR_FORMAT_RGB32
COLOR_FORMAT_RGB24
COLOR_FORMAT_DEPTH
COLOR_FORMAT_DEPTH_RAW

The application may convert any native color format to one of above formats as
follows:
PXCMImage.ImageData data;
image.AcquireAccess(PXCMImage.Access.ACCESS_READ,
PXCMImage.ColorFormat.COLOR_FORMAT_DEPTH, out data);
Bitmap bitmap=data.ToWriteableBitmap(...);
...
image.ReleaseAccess(data);

Return Status
The System.Windows.Media.Imaging.WritableBitmap bitmap instance, or null if
there is any error.

2.12.6 ImageInfo
Namespace Hierarchy
[C++]
PXCImage::ImageInfo
[C#]
PXCMImage.ImageInfo
[Java]
PXCMImage.ImageInfo

Definition
[C++]
struct ImageInfo {
pxcI32 width;
pxcI32 height;
PixelFormat format;
};

490

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C#]
class ImageInfo {
Int32 width;
Int32 height;
PixelFormat format;
};
[Java]
class ImageInfo {
int width;
int height;
PixelFormat format;
};

Description
The ImageInfo structure defines the essential properties of an image storage.
Members
width

The image width in pixels.

height

The image height in pixels.

format

The image pixel format. See the PixelFormat enumerator


for definitions.

2.12.7 ImplDesc (+JS)


Namespace Hierarchy
[C++]
PXCSession::ImplDesc
[C#]
PXCMSession.ImplDesc
[Java]
PXCMSession.ImplDesc
[JavaScript]
intel.realsense.ImplDesc

Definition
[C++]
struct ImplDesc {
ImplGroup
group;

491

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

ImplSubgroup
pxcUID
pxcUID
ImplVersion
pxcI32
pxcI32
pxcUID
pxcCHAR

subgroup;
algorithm;
iuid;
version;
merit;
vendor;
cuids[4];
friendlyName[256];

};
[C#]
class ImplDesc {
ImplGroup
ImplSubgroup
Int32
Int32
ImplVersion
Int32
Int32
Int32[]
String
};

group;
subgroup;
algorithm;
iuid;
version;
merit;
vendor;
cuids;
friendlyName;

[Java]
class ImplDesc {
EnumSet<ImplGroup>
EnumSet<ImplSubgroup>
int
int
ImplVersion
int
int
int[]
string
};

group;
subgroup;
algorithm;
iuid;
version;
merit;
vendor;
cuids;
friendlyName;

[JavaScript]
Data Type

492

group,

ImplGroup

subgroup,

ImplSubgroup

algorithm,

number

iuid,

number

version,

ImplVersion

merit,

number

vendor,

number

cuids,

number array

friendlyName,

string

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

};

Description
The ImplDesc structure describes a module implementation. The application can use
this structure as a template to search for modules. In this case, zero in a structure field
will match any values. A bit-pattern in a bit-ORed field will match any bit patterns that
are a superset.
Members
group

The module group; see the ImplGroup enumerator for


details.

subgroup

The module subgroup; see the ImplSubgroup enumerator


for details.

algorithm

The algorithm identifier in the module implementation; see


the module interface for the algorithm enumerations.

iuid

The module implementation identifier.

version

The module implementation version; see the ImplVersion


structure for details.

merit

The preference value. Modules with a higher merit value


take precedence in the module inquiry (QueryImpl) and
creation (CreateImpl).

vendor

The vendor identifier. The Intel vendor identifier is 0x8086.


Other vendors that implement the modules may define
their own identifiers.

cuids

The first four exposed interface identifiers.

friendlyName

The user-friendly module name string.

Remarks

493

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The group and subgroup values uniquely identify an SDK interface. The iuid value
uniquely identifies a module implementation that implements a particular SDK
interface. Thus within an SDK session, the following combinations uniquely identify a
module implementation:
(1)group, subgroup, and iuid
(2)cuid and iuid

Here cuid refers to the identifier of the primary interface implemented by the
module.
Example
Example 73 shows how to enumerate all module information.
Example 73: Enumerate All Modules

[C++]
// session is a PXCSession instance
for (int i=0;;i++) {
PXCSession::ImplDesc desc;
if (session->QueryImpl(0,i,&desc)<PXC_STATUS_NO_ERROR) break;
wprintf_s(L"module[%d]: name=%s\n", i, desc.friendlyName);
...
}
[C#]
// session is a PXCMSession instance
for (int i=0;;i++) {
PXCMSession.ImplDesc desc;
if (session.QueryImpl(i,out desc)<pxcmStatus.PXCM_STATUS_NO_ERROR)
break;
Console.WriteLn("module{0}: name={1}", i, desc.friendlyName);
}
[Java]
// session is a PXCMSession instance
for (i=0;;i++) {
PXCMSession.ImplDesc desc=new PXCMSession.ImplDesc();
if (session.getValue().QueryImpl(i,desc)
<pxcmStatus.PXCM_STATUS_NO_ERROR) break;
System.out.printf("module%d: name=%s", i, desc.friendlyName);
}
[JavaScript]
// session is a Session instance
var models=session.queryImpls(null);
document.write("modules: " + models);

494

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.12.8 ImplVersion (+JS)


Namespace Hierarchy
[C++]
PXCSession::ImplVersion
[C#]
PXCMSession.ImplVersion
[Java]
PXCMSession.ImplVersion
[JavaScript]
intel.realsense.ImplVersion

Definition
[C++]
struct ImplVersion {
pxcI16 major;
pxcI16 minor;
};
[C#]
struct ImplVersion {
Int16 major;
Int16 minor;
};
[Java]
class ImplVersion {
short major;
short minor;
};
[JavaScript]
Data Type

{
major,

number

minor,

number

};

Description
The ImplVersion structure defines the SDK API or module implementation version
numbers.

495

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Members
major

The major version number.

minor

The minor version number.

2.12.9 Point3DF32 (+JS)


Namespace Hierarchy
[C++]
PXCPoint3DF32
[C#]
PXCMPoint3DF32
[Java]
PXCMPoint3DF32
[JavaScript]
intel.realsense.Point3DF32

Definition
[C++]
struct PXCPoint3DF32 {
pxcF32 x;
pxcF32 y;
pxcF32 z;
};
[C#]
struct PXCMPoint3DF32 {
Single x;
Single y;
Single z;
};
[Java]
class PXCMPoint3DF32 {
float x;
float y;
float z;
};
[JavaScript]
Data Type

{
x,

496

Intel RealSense SDK 2016 R2 Reference Manual

number

2010-2016 Intel Corporation

y,

number

z,

number

Description
The Point3DF32 structure defines the coordinates of a 3D point.
Members
x

The x coordinate of the point.

The y coordinate of the point.

The z coordinate of the point.

Type Conversion
[C#]
Unity

You can implicitly cast the Point3DF32 structure from/to Vector3.

2.12.10 Point4DF32 (+JS)


Namespace Hierarchy
[C++]
PXCPoint4DF32
[C#]
PXCMPoint4DF32
[Java]
PXCMPoint4DF32
[JavaScript]
intel.realsense.Point4DF32

Definition
[C++]
struct PXCPoint4DF32 {
pxcF32 x;
pxcF32 y;
pxcF32 z;
pxcF32 w;
497

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

};
[C#]
struct PXCMPoint4DF32 {
Single x;
Single y;
Single z;
Single w;
};
[Java]
class PXCMPoint4DF32 {
float x;
float y;
float z;
float w;
};
[JavaScript]
Data Type

{
x,

number

y,

number

z,

number

w,

number

Description
The Point4DF32 structure defines a 4D rotation represented as a quaternion. See
this link for more details.
Members
x

The x component of the quaternion.

The y component of the quaternion.

The z component of the quaternion.

The w component of the quaternion.

Type Conversion
[C#]

498

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Unit You can implicitly cast the Point4DF32 structure from/to Quaternion.
y

2.12.11 PointF32 (+JS)


Namespace Hierarchy
[C++]
PXCPointF32
[C#]
PXCMPointF32
[Java]
PXCMPointF32
[JavaScript]
intel.realsense.PointF32

Definition
[C++]
struct PXCPointF32 {
pxcF32 x;
pxcF32 y;
};
[C#]
struct PXCMPointF32 {
Single x;
Single y;
};
[Java]
class PXCMPointF32 {
float x;
float y;
};
[JavaScript]
Data Type

{
x,

number

y,

number

Description

499

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The PointF32 structure defines the coordinates of an image pixel.


Members
x

The x coordinate of the image pixel.

The y coordinate of the image pixel.

Type Conversion
[C++]
N/A
[C#]
Uni You can implicitly cast the PointF32 structure from/to Vector2.
ty
[Java]
N/A

2.12.12 PointI32 (+JS)


Namespace Hierarchy
[C++]
PXCPointI32
[C#]
PXCMPointI32
[Java]
PXCMPointI32
[JavaScript]
intel.realsense.PointI32

Definition
[C++]
struct PXCPointI32 {
pxcI32 x;
pxcI32 y;
};
[C#]
struct PXCMPointI32 {
Int32 x;
Int32 y;
};
500

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[Java]
class PXCMPointI32 {
int x;
int y;
};
[JavaScript]
Data Type

{
x,

number

y,

number

Description
The PointI32 structure defines a coordinates of an image pixel.
Members
x

The x coordinate of the image pixel.

The y coordinate of the image pixel.

2.12.13 PropertyInfo
Namespace Hierarchy
[C++]
PXCCapture::Device::PropertyInfo
[C#]
PXCMCapture.Device.PropertyInfo
[Java]
PXCMCapture.Device.PropertyInfo

Definition
[C++]
struct PropertyInfo {
PXCRangeF32 range;
pxcF32
step;
pxcF32
defaultValue;
pxcBool
automatic;
};

501

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C#]
class PropertyInfo {
PXCMRangeF32 range;
Single
step;
Single
defaultValue;
Boolean
automatic;
};
[Java]
class PropertyInfo {
PXCMRangeF32 range;
float
step;
float
defaultValue;
boolean
automatic;
};

Description
The PropertyInfo structure describes the video stream configuration parameters.
Members
range

The property value range.

step

The step between values in the range.

defaultValue

The default value if not set.

automatic

The boolean value to indicate if the property supports


automatic configuration.

2.12.14 RangeF32
Namespace Hierarchy
[C++]
PXCRangeF32
[C#]
PXCMRangeF32
[Java]
PXCMRangeF32

Definition
[C++]
struct PXCRangeF32 {
502

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

pxcF32 min;
pxcF32 max;
};
[C#]
struct PXCMRangeF32 {
Single min;
Single max;
};
[Java]
class PXCMRangeF32 {
float min;
float max;
};

Description
The RangeF32 structure defines a value range.
Field Definition
min

The minimum value, inclusive.

max

The maximum value, inclusive.

2.12.15 RatioI32
Namespace Hierarchy
[C++]
PXCRatioI32
[C#]
PXCMRatioI32
[Java]
PXCMRatioI32

Definition
[C++]
struct PXCRatioI32 {
pxcI32 denominator;
pxcI32 numerator;
};
[C#]
struct PXCMRatioI32 {
503

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Int32 denominator;
Int32 numerator;
};
[Java]
class PXCMRatioI32 {
int denominator;
int numerator;
};

Description
The RatioI32 structure describes a fraction number.
Members
numerator

The numerator of the faction number.

denominator

The denominator of the faction number.

2.12.16 RectF32
Namespace Hierarchy
[C++]
PXCRectF32
[C#]
PXCMRectF32
[Java]
PXCMRectF32

Definition
[C++]
struct PXCRectF32 {
pxcF32 x;
pxcF32 y;
pxcF32 w;
pxcF32 h;
};
[C#]
struct PXCMRectF32 {
Single x;
Single y;
Single w;
Single h;
504

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

};
[Java]
class PXCMRectF32 {
float x;
float y;
float w;
float h;
};

Description
The RectF32 structure defines a rectangular region.
Members
x

The horizontal coordinate of the top left pixel of the


rectangle.

The vertical coordinate of the top left pixel of the rectangle.

The rectangle width in pixels.

The rectangle height in pixels.

2.12.17 RectI32 (+JS)


Namespace Hierarchy
[C++]
PXCRectI32
[C#]
PXCMRectI32
[Java]
PXCMRectI32
[JavaScript]
intel.realsense.RectI32

Definition
[C++]
struct PXCRectI32 {
pxcI32 x;
pxcI32 y;
pxcI32 w;
505

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

pxcI32 h;
};
[C#]
struct PXCMRectI32 {
Int32 x;
Int32 y;
Int32 w;
Int32 h;
};
[Java]
class PXCMRectI32 {
int x;
int y;
int w;
int h;
};
[JavaScript]
Data Type

{
x,

number

y,

number

w,

number

h,

number

Description
The RectI32 structure defines a rectangular region.
Members

506

The horizontal coordinate of the top left pixel of the


rectangle.

The vertical coordinate of the top left pixel of the rectangle.

The rectangle width in pixels.

The rectangle height in pixels.

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.12.18 Sample (+UWP)


Namespace Hierarchy
[C++]
PXCCapture::Sample
[C#]
PXCMCapture.Sample
[Java]
PXCMCapture.Sample
[C#/UWP]
Intel.RealSense.Sample

Definition
[C++]
struct Sample {
PXCImage *color;
PXCImage *depth;
PXCImage *ir;
PXCImage *left;
PXCImage *right;
};
[C#]
class Sample {
PXCMImage color;
PXCMImage depth;
PXCMImage ir;
PXCMImage left;
PXCMImage right;
};
[Java]
class Sample {
PXCMImage color;
PXCMImage depth;
PXCMImage ir;
PXCMImage left;
PXCMImage right;
};
[C#/UWP]
class Sample {
Windows.Media.VideoFrame Color;
Windows.Media.VideoFrame Depth;
Windows.Media.VideoFrame IR;
};

507

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Description
The Sample structure holds an array of images from multiple streams. The structure
provides constructors/functions to clean up the image instances or to access the
image instance by stream type.
Constructors
The default constructor sets all image instances to NULL/null. There is no destructor.
The application can call the ReleaseImages function to release the image instances
when needed.
Members
color/Color

Access to the color stream image instance.

depth/Depth

Access to the depth stream image instance.

ir/IR

Access to the inferred stream image instance.

left, right

Access to the left/right imagers of a stereoscopic camera.

See Also
Member Functions
2.12.18.1 Member Functions

The Sample structure exposes the following member functions:


Member Functions

Description

ReleaseImages

Release the image instances of the sample structure.

operator[]

Access to the structure field by the stream type, for C++ and C#.

get, set

Access to the structure field by the stream type, for Java.

2.12.18.1.1 ReleaseImages

Namespace Hierarchy
[C++]
PXCCapture::Sample::ReleaseImages
[C#]
PXCMCapture.Sample.ReleaseImages

508

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[Java]
PXCMCapture.Sample.ReleaseImages

Syntax
[C++]
void ReleaseImages(void);
[C#]
void ReleaseImages();
[Java]
void ReleaseImages();

Parameters
None

Description
The ReleaseImages function releases all valid image instances and then sets them to
NULL/null.
Return Status
None
2.12.18.1.2 operator[] (C++,C#)

Namespace Hierarchy
[C++]
PXCCapture::Sample::operator[]
[C#]
PXCMCapture.Sample.operator[]

Syntax
[C++]
PXCImage*& operator[](StreamType type);
[C#]
PXCMImage this(StreamType type) {
get; set;
};

509

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Parameters
type

The stream type. See the StreamType


enumerator for definitions.

Description
The operator[] provides access to the structure fields by the stream type.
Return Status
The image instance of the specified stream type.
2.12.18.1.3 get (Java)

Namespace Hierarchy
PXCMCapture.Sample.get

Syntax
PXCMImage get(StreamType type);

Parameters
type

The stream type. See the StreamType


enumerator for definitions.

Description
The get function provides access to the structure fields by the stream type.
Return Status
The image instance of the specified stream type.
2.12.18.1.4 set (Java)

Namespace Hierarchy

510

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

PXCMCapture.Sample.set

Syntax
PXCMImage set(StreamType type, PXCMImage image);

Parameters
type

The stream type. See the StreamType


enumerator for definitions.

image

The source image instance.

Description
The set function sets the source image instance to the structure fields by the stream
type.
Return Status
The image instance of the specified stream type.

2.12.19 SizeI32
Namespace Hierarchy
[C++]
PXCSizeI32
[C#]
PXCMSizeI32
[Java]
PXCMSizeI32

Definition
[C++]
struct PXCSizeI32 {
pxcI32 width;
pxcI32 height;
};
[C#]
struct PXCMSizeI32 {
Int32 width;
511

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Int32 height;
};
[Java]
class PXCMSizeI32 {
int width;
int height;
};

Description
The SizeI32 structure defines the size of a rectangle.
Members
width

The width of the rectangle.

height

The height of the rectangle.

2.12.20 StreamCalibration
Namespace Hierarchy
[C++]
PXCCalibration::StreamCalibration
[C#]
PXCMCalibration.StreamCalibration
[Java]
PXCMCalibration.StreamCalibration

Definition
[C++]
struct StreamCalibration {
PXCPointF32 focalLength;
PXCPointF32 principalPoint;
pxcF32
radialDistortion[3];
pxcF32
tangentialDistortion[2];
PXCCapture::DeviceModel model;
};
[C#]
struct StreamCalibration {
PXCMPointF32 focalLength;
PXCMPointF32 principalPoint;
Single[]
radialDistortion;
Single[]
tangentialDistortion;
512

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

PXCMCapture.DeviceModel model;
};
[Java]
struct StreamCalibration {
PXCMPointF32 focalLength;
PXCMPointF32 principalPoint;
float[]
radialDistortion;
float[]
tangentialDistortion;
PXCMCapture.DeviceModel model;
};

Description

513

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The StreamCalibration structure describes the stream calibration parameters.


A 3D point (x,y,z) in the camera coordinate system maps to a depth image pixel
(u,v) by the following formula:
The formula vary with different camera models.
For camera model F200 and SR300:

u
v

x z
y z

u (1 k1 r 2

k2 r 4

k3 r 6 )

v (1 k1 r 2

k2 r 4

k3 r 6 )

2 p1 u v

p2 ( r 2

2u 2 )

2 p2 u v

p1 (r 2

2v 2 )

fx u

px

fy *v

py

v2

For camera model R200:

u
v

x z
y z

u (1 k1 r 2

k2 r 4

k3 r 6 )

v (1 k1 r 2

k2 r 4

k3 r 6 )

2 p1 u v

p2 ( r 2

2u 2 )

2 p2 u v

p1 (r 2

2v 2 )

fx u

px

fy *v

py

v2

Members

514

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

focalLength

The sensor focal length (fx,fy) in pixels along the X and


Y axes. The values vary with the stream resolution setting.

principalPoint

The sensor principal point (px,py) in pixels along the X


and Y axes. The values vary with the stream resolution
setting.

radialDistortion

The radial distortion coefficients, (k1,k2,k3), as


described by the camera model equations in the
Description section.

tangentialDistortion The tangential distortion coefficients, (p ,p ), as


1
2

described by the camera model equations in the


Description section.
model

The device model identifier. See the DeviceModel


enumerator for definitions.

2.12.21 StreamDesc
Namespace Hierarchy
[C++]
PXCVideoModule::StreamDesc
[C#]
PXCMVideoModule.StreamDesc
[Java]
PXCMVideoModule.StreamDesc

Definition
[C++]
struct StreamDesc {
PXCSizeI32
sizeMin;
PXCSizeI32
sizeMax;
PXCRangeF32 frameRate;
StreamOption options;
pxcI32
propertySet;
};
[C#]
struct StreamDesc {
PXCMSizeI32 sizeMin;
PXCMSizeI32 sizeMax;

515

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

PXCMRangeF32 frameRate;
StreamOption options;
Int32
propertySet;
};
[Java]
class StreamDesc {
PXCMSizeI32 sizeMin;
PXCMSizeI32 sizeMax;
PXCMRangeF32 frameRate;
EnumSet<StreamOption> options;
int
propertySet;
};

Description
The StreamDesc structure describes the stream characteristics of a modules I/O data
requirements. Unused fields should be set to zero.
Members
sizeMin

If not zero, specify the minimum resolution.

sizeMax

If not zero, specify the maximum resolution.

frameRate

If not zero, specify the frame rate range.

options

If not zero, specify the stream options.

propertySet

If not zero, request the specified device property set, as


defined in Table 3.

Table 3: F200 Device Property Set


Set Confidenc FilterOption LaserPowe MotionRange Accuracy Comment
e
r
1

16

MEDIAN

Hand tracking

16

21

MEDIAN

Face tracking

16

21

Coarse

User segmentation

16

Finest

3D scanning

2.12.22 StreamDescSet
Namespace Hierarchy
516

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C++]
PXCVideoModule::StreamDescSet
[C#]
PXCMVideoModule.StreamDescSet
[Java]
PXCMVideoModule.StreamDescSet

Definition
[C++]
struct StreamDescSet {
StreamDesc color;
StreamDesc depth;
StreamDesc ir;
};
[C#]
struct StreamDescSet {
StreamDesc color;
StreamDesc depth;
StreamDesc ir;
};
[Java]
struct StreamDescSet {
StreamDesc color;
StreamDesc depth;
StreamDesc ir;
};

Description
The StreamDescSet structure manages multiple StreamDesc structures and provides
access to them by the stream type.
Members
sizeMin

If not zero, specify the minimum resolution.

sizeMax

If not zero, specify the maximum resolution.

frameRate

If not zero, specify the frame rate range.

2.12.22.1 Member Functions

The StreamDescSet structure exposes the following member functions:


517

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Member Functions

Description

operator[]

Access to the structure field by the stream type, for C++ and C#.

get, set

Access to the structure field by the stream type, for Java.

2.12.22.1.1 operator[] (C++,C#)

Namespace Hierarchy
[C++]
PXCVideoModule::StreamDescSet::operator[]
[C#]
PXCMVideoModule.StreamDescSet.operator[]

Syntax
[C++]
StreamDesc& operator[](StreamType type);
[C#]
StreamDesc this(StreamType type) {
get; set;
};

Parameters
type

The stream type. See the StreamType


enumerator for definitions.

Description
This operator[] operator provides access to the structure fields by the stream type.
Return Status
The StreamDesc instance of the specified stream type.
2.12.22.1.2 get (Java)

Namespace Hierarchy
PXCMVideoModule.StreamDescSet.get

Syntax
518

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

StreamDesc get(StreamType type);

Parameters
type

The stream type. See the StreamType


enumerator for definitions.

Description
The get function provides access to the structure fields by the stream type.
Return Status
The StreamDesc instance of the specified stream type.
2.12.22.1.3 set (Java)

Namespace Hierarchy
PXCMVideoModule.StreamDescSet.set

Syntax
StreamDesc set(StreamType type, StreamDesc desc);

Parameters
type

The stream type. See the StreamType


enumerator for definitions.

desc

The source StreamDesc instance.

Description
The set function sets the source StreamDesc instance to the structure fields by the
stream type.
Return Status

519

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The StreamDesc instance of the specified stream type.

2.12.23 StreamProfile
Namespace Hierarchy
[C++]
PXCCapture::Device::StreamProfile
[C#]
PXCMCapture.Device.StreamProfile
[Java]
PXCMCapture.Device.StreamProfile

Definition
[C++]
struct StreamProfile {
ImageInfo
imageInfo;
PXCRangeF32 frameRate;
StreamOption options;
};
[C#]
class StreamProfile {
ImageInfo
imageInfo;
PXCMRangeF32 frameRate;
StreamOption options;
};
[Java]
class StreamProfile {
ImageInfo
imageInfo;
PXCMRangeF32 frameRate;
StreamOption options;
};

Description
The StreamProfile structure describes the video stream configuration parameters.
Members

520

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

imageInfo

The image properties in the ImageInfo structure.

frameRate

The range of supported frame rates. When used in the


SetStreamProfileSet function, the application should
specify the desired frame rate in the max field of the
RangeF32 structure.

options

The stream options; see the StreamOption enumerator for


definitions.

2.12.24 StreamProfileSet
Namespace Hierarchy
[C++]
PXCCapture::Device::StreamProfileSet
[C#]
PXCMCapture.Device.StreamProfileSet
[Java]
PXCMCapture.Device.StreamProfileSet

Definition
[C++]
struct StreamProfileSet {
StreamProfile color;
StreamProfile depth;
StreamProfile ir;
StreamProfile left;
StreamProfile right;
};
[C#]
class StreamProfileSet {
StreamProfile color;
StreamProfile depth;
StreamProfile ir;
StreamProfile left;
StreamProfile right;
};
[Java]
class StreamProfileSet {
StreamProfile color;
StreamProfile depth;
StreamProfile ir;
StreamProfile left;
521

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

StreamProfile right;
};

Description
The StreamProfileSet structure is a collection of stream configuration parameters.
Members
color
depth
ir
left
right

The stream configuration parameters of certain stream type.


See the StreamType enumerator for the stream type
definitions.

See Also
Member Functions
2.12.24.1 Member Functions

The StreamProfileSet structure exposes the following member functions:


Member Functions

Description

operator[]

Access to the structure field by the stream type, for C++ and C#.

get, set

Access to the structure field by the stream type, for Java.

2.12.24.1.1 operator[] (C++,C#)

Namespace Hierarchy
[C++]
PXCCapture::Device::StreamProfileSet::operator[]
[C#]
PXCMCapture.Device.StreamProfileSet.operator[]

Syntax
[C++]
StreamProfile& operator[](StreamType type);
[C#]
StreamProfile this(StreamType type) {
get; set;
};

522

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Parameters
type

The stream type. See the StreamType


enumerator for definitions.

Description
This operator[] provides access to the StreamProfile fields by the stream type.
Return Status
The StreamProfile instance of the specified stream type.
2.12.24.1.2 get (Java)

Namespace Hierarchy
PXCMCapture.Device.StreamProfileSet.get

Syntax
StreamProfile get(StreamType type);

Parameters
type

The stream type. See the StreamType


enumerator for definitions.

Description
The get function provides access to the StreamProfile structure fields by the
stream type.
Return Status
The StreamProfile instance of the specified stream type.
2.12.24.1.3 set (Java)

Namespace Hierarchy
523

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

PXCMCapture.Device.StreamProfileSet.set

Syntax
StreamProfile set(StreamType type, StreamProfile profile);

Parameters
type

The stream type. See the StreamType


enumerator for definitions.

profile

The source profile.

Description
The set function sets the source profile to the structure fields by the stream type.
Return Status
The StreamProfile instance of the specified stream type.

2.12.25 StreamTransform
Namespace Hierarchy
[C++]
PXCCalibration::StreamTransform
[C#]
PXCMCalibration.StreamTransform
[Java]
PXCMCalibration.StreamTransform

Definition
[C++]
struct StreamTransform {
pxcF32 translation[3];
pxcF32 rotation[3][3];
};
[C#]
struct StreamTransform {
Single[]
translation;
524

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Single[,]

rotation;

};
[Java]
struct StreamTransform {
float[]
translation;
float[,]
rotation;
};

Description
The StreamTransform structure describes the stream rotation and translation
parameters.
Members

2.13

translation

The translation in mm of the camera coordinate system


origin to the world coordinate system origin. The world
coordinate system coincides with the depth camera
coordinate system.

rotation

The rotation of the camera coordinate system with


respect to the world coordinate system. The world
coordinate system coincides with the depth camera
coordinate system.

Enumerator Reference
This section describes the enumerator definitions of the Intel RealSense SDK essential
interfaces.
Naming Conventions
For C++, C# and Java, this manual uses [M] (where M stands for "managed") in the interface
names to represent interfaces that are available in a managed environment (such as C# and
Java). For example, Capture represents the C++ interface PXCCapture and the C#, and Java
interface PXCMCapture.
The manual uses additional markings after the interface or method names as follows:

525

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Marking

Example

Comment

None

Base

Common for all languages and


frameworks, except JavaScript and
UWP interfaces. JavaScript and UWP
interfaces or methods are listed
separately.

(C++)

PXCBase.Release

C++ specific interface or methods.

(C#)

PXCMBase.Dispose

C# and Unity C# specific interface or


methods.

(C#.NET4)

PXCMImage.ImageData.ToBitmap

C# .NET4 specific interface or


methods. Not available in Unity C#.

(Unity)

PXCMImage.ImageData.ToTexture2 Unity C# specific interface or methods.


D
Not available in C#.

(Java)

PXCMBase.close

Java and Processing specific interface


or methods.

(Processing) PXCMImage.ImageData.ToPImage

Processing specific interface or


methods. Not available in Java.

(JS)

PXCMSession.QueryImpls

JavaScript specific interface or


methods.

(+JS)

PXCMSession.QueryModelDesc

Emphasize that the JavaScript


language is part of this function along
with other language interfaces.

(UWP)

SampleReader.EnableStream[s]

UWP specific interface or methods.

(+UWP)

SenseManager.CreateInstance

Emphasize that the UWP interface is


part of this function along with other
language interfaces.

2.13.1 Access (Image)


Namespace Hierarchy
[C++]
PXCImage::Access
[C#]
PXCMImage.Access
[Java]
PXCMImage.Access

Description

526

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The Access enumerator itemizes the surface/buffer access modes.


Name/Description
ACCESS_READ

Read access.

ACCESS_WRITE

Write access.

ACCESS_READ_WRITE

Read and write access.

2.13.2 ConnectionType (+JS,+UWP)


Namespace Hierarchy
[C++]
PXCCapture::ConnectionType
[C#]
PXCMCapture.ConnectionType
[Java]
PXCMCapture.ConnectionType
[JavaScript]
intel.realsense.ConnectionType
[C#/UWP]
Intel.RealSense.ConnectionType

Description
The ConnectionType enumerator itemizes the I/O device connection types.
Name/Description
CONNECTION_TYPE_UNKNOWN

Connection type not determined.

CONNECTION_TYPE_USB_INTEGRAT The integrated device is connected via USB3.


ED
CONNECTION_TYPE_USB_PERIPHER The peripheral device is connected via USB3.
AL

527

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.13.3 CoordinateSystem
Namespace Hierarchy
[C++]
PXCSession::CoordinateSystem
[C#]
PXCMSession.CoordinateSystem
[Java]
PXCMSession.CoordinateSystem

Description
The CoordinateSystem enumerator itemizes supported camera coordinate systems.
Use the bit-ORed values to represent groups of coordinate systems.
Name/Description

528

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

COORDINATE_SYSTEM_FRONT_DEFAULT

From the camera view, X points to the right, Y


up, and Z towards the user. The origin is at the
center of the depth camera.

COORDINATE_SYSTEM_REAR_DEFAULT

The axis X points to the right, Y up and Z


towards the user. The origin is at the center of
the depth camera.

COORDINATE_SYSTEM_REAR_OPENCV

The axis X points to the right, Y down, and


Z towards the scene. The origin is at the
center of the depth camera.

2.13.4 DeviceModel (+JS,+UWP)


Namespace Hierarchy
[C++]
PXCCapture::DeviceModel
[C#]
PXCMCapture.DeviceModel

529

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[Java]
PXCMCapture.DeviceModel
[JavaScript]
intel.realsense.DeviceModel
[C#/UWP]
Intel.RealSense.DeviceModel

Description
The DeviceModel enumerator itemizes supported camera models.
Name/Description
DEVICE_MODEL_GENERIC

Generic integrated or external camera.

DEVICE_MODEL_F200

The Intel RealSense Camera, model F200. This


is a front-facing camera.

DEVICE_MODEL_R200

The Intel RealSense Camera, model R200. This


is a rear-facing camera.

DEVICE_MODEL_R200_ENHANCED

The Intel RealSense Camera, camera model


R200 with enhanced color sensing. This is a virtual
camera that captures the color stream from the
rear-facing camera available on the system and the
depth stream from the R200 camera.
This camera model is not available on all
systems. Factory-calibration is needed to calibrate
the the R200 camera with the rear-facing system
camera.

DEVICE_MODEL_SR300

The Intel RealSense Camera, model SR300. This


is a front-facing camera.

2.13.5 DeviceOrientation (+JS,+UWP)


Namespace Hierarchy
[C++]
PXCCapture::DeviceOrientation
[C#]

530

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

PXCMCapture.DeviceOrientation
[Java]
PXCMCapture.DeviceOrientation
[JavaScript]
intel.realsense.DeviceOrientation
[C#/UWP]
Intel.RealSense.DeviceOrientation

Description
The DeviceOrientation enumerator itemizes supported camera orientations.
Name/Description
DEVICE_ORIENTATION_ANY

Any or unknown camera


orientation.

DEVICE_ORIENTATION_FRONT_FACING

A front/user facing camera.

DEVICE_ORIENTATION_REAR_FACING

A rear/world facing camera.

2.13.6 ImplGroup (+JS)


Namespace Hierarchy
[C++]
PXCSession::ImplGroup
[C#]
PXCMSession.ImplGroup
[Java]
PXCMSession.ImplGroup
[JavaScript]
intel.realsense.Session.ImplGroup

Description
The ImplGroup enumerator itemizes algorithm implementations into major groups. It
can also be used as bit-ORed values to represent groups of algorithms.

531

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Name/Description
IMPL_GROUP_ANY

Any algorithm.

IMPL_GROUP_CORE

The core framework algorithms.

IMPL_GROUP_UTILITIES

The utility algorithms.

IMPL_GROUP_SENSOR

The sensor algorithms.

IMPL_GROUP_OBJECT_RECOGNITION

The object recognition algorithms.

IMPL_GROUP_SPEECH_RECOGNITION

The speech recognition algorithms.

IMPL_GROUP_PHOTOGRAPHY

The photography algorithms.

IMPL_GROUP_USER

User-defined algorithms.

2.13.7 ImplSubgroup (+JS)


Namespace Hierarchy
[C++]
PXCSession::ImplSubgroup
[C#]
PXCMSession.ImplSubgroup
[Java]
PXCMSession.ImplSubgroup
[JavaScript]
intel.realsense.Session.ImplGroup

Description
The ImplSubgroup enumerator itemizes algorithm implementations into minor
groups. It can also be used as bit-ORed values to represent groups of algorithms.
Name/Description

532

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

IMPL_SUBGROUP_ANY

Any algorithm.

Sensor group modules


IMPL_SUBGROUP_AUDIO_CAPTURE

The audio capture algorithm.

IMPL_SUBGROUP_VIDEO_CAPTURE

The video capture algorithm.

Object recognition modules


IMPL_SUBGROUP_FACE_ANALYSIS

The face analysis algorithm including


detection/tracking, landmark detection,
and recognition.

IMPL_SUBGROUP_PULSE_ESTIMATION

The pulse estimation algorithm.

IMPL_SUBGROUP_GESTURE_RECOGNITION The gesture recognition algorithm.


IMPL_SUBGROUP_3DSEG

The user segmentation algorithm.

IMPL_SUBGROUP_3DSCAN

The 3D scanning algorithm.

IMPL_SUBGROUP_SCENE_PERCEPTION

The scene perception algorithm.

IMPL_SUBGROUP_OBJECT_TRACKING

The object tracking algorithm.

Speech recognition modules


IMPL_SUBGROUP_SPEECH_RECOGNITION

Speech recognition module including


dictation and command and control.

IMPL_SUBGROUP_SPEECH_SYNTHESIS

Speech synthesis module.

Photography modules
IMPL_SUBGROUP_ENHANCED_PHOTOGRAPH The enhanced photography algorithms.
Y
IMPL_SUBGROUP_ENHANCED_VIDEOGRAPH The enhanced videography algorithms.
Y

Remarks
See additional subgroup definitions in each module SDK interface definition.

533

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.13.8 IVCAMAccuracy
Namespace Hierarchy
[C++]
PXCCapture::Device::IVCAMAccuracy
[C#]
PXCMCapture.Device.IVCAMAccuracy
[Java]
PXCMCapture.Device.IVCAMAccuracy

Description
The IVCAMAccuracy enumerator itemizes supported camera accuracy settings.
Name/Description
IVCAM_ACCURACY_FINEST

The finest level of accuracy: Use 11


coded patterns at 50fps.

IVCAM_ACCURACY_MEDIAN

The median level of accuracy: Use 10


coded patterns at 55 fps. This is the
default.
Deprecated for camera model
SR300.

IVCAM_ACCURACY_COARSE

The coarse level of accuracy: Use 9


coded patterns at 60 fps.
Deprecated for camera model
SR300.

2.13.9 MirrorMode
Namespace Hierarchy
[C++]
PXCCapture::Device::MirrorMode
[C#]
PXCMCapture.Device.MirrorMode
[Java]
PXCMCapture.Device.MirrorMode
534

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Description
The MirrorMode enumerator itemizes supported power line frequency compensation
values.
Name/Description
MIRROR_MODE_DISABLED

Mirroring is disabled. The images are


shown as in a regular world-facing
camera.

MIRROR_MODE_HORIZONTAL

Horizontally mirrored. The images are


shown as in a regular user-facing
camera.

2.13.10 Option (Image)


Namespace Hierarchy
[C++]
PXCImage::Option
[C#]
PXCMImage.Option
[Java]
PXCMImage.Option

Description
The Option enumerator itemizes supported image options.

Name/Description
OPTION_ANY

Undefined/unknown/any option.

2.13.11 PixelFormat
Namespace Hierarchy
[C++]
PXCImage::PixelFormat

535

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C#]
PXCMImage.PixelFormat
[Java]
PXCMImage.PixelFormat

Description
The PixelFormat enumerator itemizes supported pixel formats.
Name/Description

536

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

PIXEL_FORMAT_YUY2

The YUY2 color format. See fourcc.org for the


description and memory layout.

PIXEL_FORMAT_NV12

The NV12 color format. See fourcc.org for the


description and memory layout.

PIXEL_FORMAT_RGB32

The 32-bit RGB32 color format. On little endian


machines, the memory layout is BGRA. See
fourcc.org for the description and memory layout.

PIXEL_FORMAT_RGB24

The 24-bit RGB24 color format. On little endian


machines, the memory layout is BGR. See
fourcc.org for the description and memory layout.

PIXEL_FORMAT_Y8

The 8-bit gray format. Also used for the 8-bit IR data.
See fourcc.org for the description and memory
layout.

PIXEL_FORMAT_Y8_IR_REL The camera model F200 specific 8-bit IR data


ATIVE
containing the I1-I0 IR image. I1 is the IR image with

the coded pattern on and I0 is the IR image with the


coded pattern off.
Deprecated for camera model SR300.
PIXEL_FORMAT_Y16

The 16-bit gray format. Also used for the 16-bit IR


data. See fourcc.org for the description and
memory layout.

PIXEL_FORMAT_DEPTH

The depth map data in 16-bit unsigned integer. The


values indicate the distance from an object to the
camera's XY plane or the Cartesian depth.The value
precision is in millimeters.
A special depth value is used to indicate lowconfidence pixels. The application can get the value
via the QueryDepthLowConfidenceValue function.

PIXEL_FORMAT_DEPTH_RAW The depth map data in 16-bit unsigned integer. The

value precision is device specific. The application can


get the device precision via the QueryDepthUnit
function.
The format is camera model specific.
537

PIXEL_FORMAT_DEPTH_F32 The depth map data in 32-bit floating point. The

Intel RealSense SDK 2016 R2 Reference Manual

value precision is in millimeters.

2010-2016 Intel Corporation

A special depth value is used to indicate low-

Remarks
The image data are stored in the data planes planes[0-NUM_OF_PLANES]. For most
pixel formats, this is planes[0]. For NV12, the Y plane is stored in planes[0] and
interleaved UV is stored in planes[1].
See Also
Type Extension (C#,Java)

538

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.13.11.1 Type Extension (C#,Java)

The ColorFormat enumerator exposes the following type extension:


Type Extension

Description

ToString

Returns the pixel format string representation.

2.13.11.1.1 ToString

Namespace Hierarchy
[C#]
PXCMImage.PixelFormat.ToString
[Java]
PXCMImage.PixelFormat.toString

Syntax
[C#]
String ToString();
[Java]
string toString();

Parameters
None

Description
The CreateOutput function returns the string representation of the pixel format.
Return Status

The string representation of the pixel format.

2.13.12 ProjectionOption
Namespace Hierarchy
[C++]
PXCProjection::ProjectionOption
[C#]
PXCMProjection.ProjectionOption
539

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[Java]
PXCMProjection.ProjectionOption

Description
The ProjectionOption enumerator itemizes supported projection function
options.

Name/Description
PROJECTION_OPTION_DEFAULT

The default projection options.

PROJECTION_OPTION_CLIPPING_NONE Do not perform any projection result

clipping.

2.13.13 PowerLineFrequency
Namespace Hierarchy
[C++]
PXCCapture::Device::PowerLineFrequency
[C#]
PXCMCapture.Device.PowerLineFrequency
[Java]
PXCMCapture.Device.PowerLineFrequency

Description
The PowerLineFrequency enumerator itemizes supported power line frequency
compensation values.
Name/Description

540

POWER_LINE_FREQUENCY_DISABLED

Disabled.

POWER_LINE_FREQUENCY_50HZ

50Hz power line frequency


compensation.

POWER_LINE_FREQUENCY_60HZ

60Hz power line frequency


compensation.

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.13.14 Property (Advanced, +UWP)


Namespace Hierarchy
[C++]
PXCCapture::Device::Property
[C#]
PXCMCapture.Device.Property
[Java]
PXCMCapture.Device.Property
[C#/UWP]
Intel.RealSense

Description
[C++][C#][Java]

The Property enumerator itemizes supported device properties, for advanced usages,
where the device property values are negotiated between the I/O device and the
algorithm modules during the pipeline initialization.
In simple use cases, you can use the helper functions QueryXXX and SetXXX of the
Device interface to get/set device property values, without involving the Property
enumerator.
[C#/UWP]

The Property enumerator lists all the string representations of the supported device
properties. Use the
Windows.Devices.Perception.PerceptionControlSession.TrySetPropertyAsync
function to set any device property. All values must cast to the float data type.

Name/Description
[C++][C#][Java][C#/UWP]

Device Common Properties

541

[C++][C#][Java]
PROPERTY_DEVICE_ALLOW_PROFILE_CHANGE
[C#/UWP]
N/A

If set to true, the device returns

[C++][C#][Java]
PROPERTY_DEVICE_MIRROR
[C#/UWP]
N/A

The orientation of the camera


images.. See the MirrorMode
enumerator for definitions.

Intel RealSense SDK 2016 R2 Reference Manual

PXC_STATUS_STREAM_CONFIG_CHA
NGED when the stream

configuration is changed.

2010-2016 Intel Corporation

Color Stream Properties

542

[C++][C#][Java]
PROPERTY_COLOR_EXPOSURE
[C#/UWP]
"Intel.RealSense.ColorExposure"

The color camera exposure, in log


base 2 seconds.

[C++][C#][Java]
PROPERTY_COLOR_BRIGHTNESS
[C#/UWP]
"Intel.RealSense.ColorBrightness"

The color camera brightness from


-10,000 (pure black) to 10,000
(pure white).

[C++][C#][Java]
PROPERTY_COLOR_CONTRAST
[C#/UWP]
"Intel.RealSense.ColorContrast"

The color camera contrast, from 0


to 10,000.

[C++][C#][Java]
PROPERTY_COLOR_SATURATION
[C#/UWP]
"Intel.RealSense.ColorSaturation"

The color camera saturation, from


0 to 10,000.

[C++][C#][Java]
PROPERTY_COLOR_HUE
[C#/UWP]
"Intel.RealSense.ColorHue"

The color camera hue, from 18,000 to 18,000 (representing 180 to 180 degrees.)

[C++][C#][Java]
PROPERTY_COLOR_GAMMA
[C#/UWP]
"Intel.RealSense.ColorGamma"

The color camera gamma, from 1


to 500.

[C++][C#][Java]
PROPERTY_COLOR_WHITE_BALANCE
[C#/UWP]
"Intel.RealSense.ColorWhiteBalance"

The color camera balance, as a


color temperature in degrees
Kelvin.

[C++][C#][Java]
PROPERTY_COLOR_SHARPNESS
[C#/UWP]
"Intel.RealSense.ColorSharpness"

The color camera sharpness, from


0 to 100.

[C++][C#][Java]
PROPERTY_COLOR_GAIN
[C#/UWP]
"Intel.RealSense.ColorGain"

The color camera gain adjustment,


with negative values darker,
positive values brighter, and zero
as normal.

[C++][C#][Java]
PROPERTY_COLOR_BACK_LIGHT_COMPENSATION
[C#/UWP]
N/A

The color camera back light


compensation, with 1 to turn on
and 0 to turn off.

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C++][C#][Java]
PROPERTY_COLOR_FIELD_OF_VIEW
[C#/UWP]
N/A

The color sensor horizontal and


vertical field of view parameters, in
degrees, as defined in the
PointF32 structure.
The property value is the model
fixed value, and not the device
instance calibrated value.

[C++][C#][Java]
PROPERTY_COLOR_FOCAL_LENGTH
[C#/UWP]
N/A

The color sensor focal length in


pixels along the x and y axes, as
defined in the PointF32 structure.
The parameters vary with the color
stream resolution setting.
The property value is the model
fixed value, and not the device
instance calibrated value.

[C++][C#][Java]
PROPERTY_COLOR_FOCAL_LENGTH_MM
[C#/UWP]
N/A

The color sensor focal length in


millimeters.

[C++][C#][Java]
PROPERTY_COLOR_PRINCIPAL_POINT
[C#/UWP]
N/A

The color sensor principal point in


pixels along the x and y axes, as
defined in the PointF32 structure.
The parameters vary with the color
stream resolution setting.

The property value is the model


fixed value, and not the device
instance calibrated value.

The property value is the model


fixed value, and not the device
instance calibrated value.
[C++][C#][Java]
PROPERTY_COLOR_POWER_LINE_FREQUENCY
[C#/UWP]
"Intel.RealSense.ColorPowerLineFrequency"

The power line frequency. See the


PowerLineFrequency enumerator
for definitions.

Depth Stream Properties


[C++][C#][Java]
PROPERTY_DEPTH_LOW_CONFIDENCE_VALUE

543

Intel RealSense SDK 2016 R2 Reference Manual

The special depth map value to

2010-2016 Intel Corporation

[C#/UWP]
"Intel.RealSense.DepthLowConfidenceValue"

indicate that the corresponding


depth map pixel is of lowconfidence. The following are
possible reasons for lowconfidence:
Objects are too close to the
camera.
Objects are too far away from the
camera.
Objects have low infrared
reflectivity.

[C++][C#][Java]
PROPERTY_DEPTH_CONFIDENCE_THRESHOLD
[C#/UWP]
"Intel.RealSense.DepthConfidenceThreshold"

The confidence threshold that is


used to floor the depth map values.

[C++][C#][Java]
PROPERTY_DEPTH_UNIT
[C#/UWP]
"Intel.RealSense.DepthUnit"

The precision of native depth pixel


values in micrometre, or m.

[C++][C#][Java]
PROPERTY_DEPTH_FIELD_OF_VIEW
[C#/UWP]
N/A

The depth-sensor horizontal and


vertical field of view parameters, in
degrees, as defined in the
PointF32 structure.
The property value is the model
fixed value, and not the device
instance calibrated value.

[C++][C#][Java]
PROPERTY_DEPTH_SENSOR_RANGE
[C#/UWP]
N/A

The depth-sensor, sensing


distance parameters, in millimeters,
as defined in the RangeF32
structure.
The property value is the model
fixed value, and not the device
instance calibrated value.

[C++][C#][Java]
PROPERTY_DEPTH_FOCAL_LENGTH
[C#/UWP]
N/A

544

Intel RealSense SDK 2016 R2 Reference Manual

The depth-sensor focal length in


pixels along the x and y axes, as
defined in the PointF32 structure.

2010-2016 Intel Corporation

The parameters vary with the


depth stream resolution setting.
The property value is the model
fixed value, and not the device
instance calibrated value.
[C++][C#][Java]
PROPERTY_DEPTH_FOCAL_LENGTH_MM
[C#/UWP]
N/A

The depth-sensor focal length in


millimeters.

[C++][C#][Java]
PROPERTY_DEPTH_PRINCIPAL_POINT
[C#/UWP]
N/A

The depth-sensor principal point in


pixels along the x and y axes, as
defined in the PointF32 structure.
The parameters vary with the
depth stream resolution setting.

The property value is the model


fixed value, and not the device
instance calibrated value.

The property value is the model


fixed value, and not the device
instance calibrated value.
Intel RealSense Camera: Model F200 & SR300

545

[C++][C#][Java]
PROPERTY_IVCAM_ACCURACY
[C#/UWP]
"Intel.RealSense.SR300.Accuracy"

The projected pattern. See the


IVCAMAccuracy for definitions.

[C++][C#][Java]
PROPERTY_IVCAM_FILTER_OPTION
[C#/UWP]
"Intel.RealSense.SR300.FilterOption"

The smoothing aggressiveness


parameter. See Table 4 for
definitions.

[C++][C#][Java]
PROPERTY_IVCAM_LASER_POWER
[C#/UWP]
"Intel.RealSense.SR300.LaserPower"

The power of laser projector in the


range of 0 (min power) to 16 (max
power).

[C++][C#][Java]
PROEPRTY_IVCAM_MOTION_RANGE_TRADE_OFF
[C#/UWP]
"Intel.RealSense.SR300.MotionRangeTradeOff"

The motion vs. range trade off


option. The value is in the range of
0 (short exposure, short range, and
better motion) to 100 (long
exposure and long range.)

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Intel RealSense Camera: Model SR300


[C++][C#][Java]
PROEPRTY_SR300_COLOR_EXPOSURE_PRIORITY
[C#/UWP]
"Intel.RealSense.SR300.ColorExposurePriority
"

The color exposure priority setting.


The setting specifies constraints on
the exposure time control when
automatic exposure is turned on. If
the value is zero, the color frame
rate must remain constant. If the
value is 1, the color frame rate may
vary.

Intel RealSense Camera: Model R200

546

[C++][C#][Java]
PROPERTY_DS_COLOR_RECTIFICATION
[C#/UWP]
"Intel.RealSense.R200.ColorRectification"

A boolean value to indicate the


color image rectification mode. The
value is read only.

[C++][C#][Java]
PROPERTY_DS_CROP
[C#/UWP]
"Intel.RealSense.R200.Crop"

A boolean value to indicate the left


and right image cropping mode. If
true, the left/right images are
cropped to match the resolution of
the depth image.

[C++][C#][Java]
PROPERTY_DS_DEPTH_RECTIFICATION
[C#/UWP]
"Intel.RealSense.R200.DepthRectification"

A boolean value to indicate the


depth image rectification mode.
The value is read only.

[C++][C#][Java]
PROPERTY_DS_EMITTER
[C#/UWP]
"Intel.RealSense.R200.Emitter"

A boolean value to indicate the


infrared emitter status.

[C++][C#][Java]
PROPERTY_DS_DISPARITY_MULTIPLIER
[C#/UWP]
"Intel.RealSense.R200.DisparityMultiplier"

The disparity scale factor in the


disparity output mode. The default
value is 32.

[C++][C#][Java]
PROPERTY_DS_DISPARITY_OUTPUT
[C#/UWP]
"Intel.RealSense.R200.DisparityOutput"

A boolean value to indicate the


disparity output mode. If true, set
the output is the inverse distance.
Otherwise, the output is the
distance (Z).

[C++][C#][Java]
PROPERTY_DS_DISPARITY_SHIFT
[C#/UWP]
"Intel.RealSense.R200.DisparityShift"

The disparity shift value, in


millimeters. Both the minimum
depth value and the maximum

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

depth value are shifted to enhance


the resolution of depth values in
between.
[C++][C#][Java]
PROPERTY_DS_LEFTRIGHT_EXPOSURE
[C#/UWP]
"Intel.RealSense.R200.LeftRightExposure"

The depth stream exposure value,


in milliseconds.

[C++][C#][Java]
PROPERTY_DS_LEFTRIGHT_GAIN
[C#/UWP]
"Intel.RealSense.R200.LeftRightGain"

The depth stream gain adjustment,


with negative values darker and
positive value brighter, and zero as
normal.

[C++][C#][Java]
PROPERTY_DS_LR_THRESHOLD
[C#/UWP]
"Intel.RealSense.R200.LeftRightThreshold"

Specify the current threshold for


determining whether the left-right
match agrees with the right-left
match.

[C++][C#][Java]
PROPERTY_DS_MEDIAN_THRESHOLD
[C#/UWP]
"Intel.RealSense.R200.MedianThreshold"

Sets the threshold for how much


the winning score must beat the
median to be judged a reliable
depth measurement.

[C++][C#][Java]
PROPERTY_DS_MIN_MAX_Z
[C#/UWP]
"Intel.RealSense.R200.MinMaxZ"

Set the range of the depth value, in


the RangeF32 structure.

[C++][C#][Java]
PROPERTY_DS_NEIGHBOR_THRESHOLD
[C#/UWP]
"Intel.RealSense.R200.NeighborThreshold"

Set the threshold for how much at


least one adjacent disparity score
must differ from the minimum
score to be judged a reliable depth
measurement.

[C++][C#][Java]
Set the value to subtract when
PROPERTY_DS_ROBINS_MUNROE_MINUS_INCREMENT
estimating the median of the
[C#/UWP]
"Intel.RealSense.R200.RobinsMunroeMinusIncre correlation surface.
ment"
[C++][C#][Java]
Set the value to add when
PROPERTY_DS_ROBINS_MUNROE_PLUS_INCREMENT
estimating the median of the
[C#/UWP]
"Intel.RealSense.R200.RobinsMunroePlusIncrem correlation surface.
ent"
[C++][C#][Java]
PROPERTY_DS_SCORE_MAX_THRESHOLD

547

Intel RealSense SDK 2016 R2 Reference Manual

Set the maximum correlation score


that is considered acceptable.
2010-2016 Intel Corporation

[C#/UWP]
"Intel.RealSense.R200.ScoreMaxThreshold"
[C++][C#][Java]
PROPERTY_DS_SCORE_MIN_THRESHOLD
[C#/UWP]
"Intel.RealSense.R200.ScoreMinThreshold"

Sets the minimum correlation


score that is considered
acceptable.

[C++][C#][Java]
PROPERTY_DS_SECOND_PEAK_THRESHOLD
[C#/UWP]
"Intel.RealSense.R200.SecondPeakThreshold"

Set the threshold for how much


the minimum correlation score
must differ from the next best
score to be judged a reliable depth
measurement.

[C++][C#][Java]
Set parameter for determining how
PROPERTY_DS_TEXTURE_COUNT_THRESHOLD
much texture in the region is
[C#/UWP]
"Intel.RealSense.R200.TextureCountThreshold" sufficient to be judged a reliable

depth measurement.

[C++][C#][Java]
PROPERTY_DS_TEXTURE_DIFFERENCE_THRESHOLD
[C#/UWP]
"Intel.RealSense.R200.TextureDifferenceThres
hold"

Set parameter for determining


whether the texture in the region is
sufficient to justify a reliable depth
measurement.

Miscellaneous Properties
[C++][C#][Java]
PROPERTY_PROJECTION_SERIALIZABLE
[C#/UWP]
N/A
[C++][C#][Java]
PROPERTY_CUSTOMIZED
[C#/UWP]
N/A

The metadata identifier of the


Projection implementation,
attached to the session meta data.
Device specific customized
controls. Any customized controls
should have a label value equal to
or larger than
PROPERTY_CUSTOMIZED.

Remarks

548

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

V
al
u
e
0

Name

Description

Skeleton

Raw

Raw +
Gradients
filter
Very
close
range
Close
range

Reports the depth data for high fidelity (high confidence) pixels only,
and all other pixels as invalid. For SR300, the depth range is up to 4m.
Raw depth image without any post-processing filters. For SR300, the
depth range is up to 4m.
Raw depth image with the gradient filter applied. For SR300, the depth
range is up to 4m.

Midrange
[Default]
Far range

Very far
range

Very low smoothing effect with high sharpness, accuracy levels, and low
noise artifacts. Good for any distances of up to 350mm for F200, and up
to 2m for SR300.
Low smoothing effect with high sharpness and accuracy levels. The
noise artifacts are optimized for distances between 350mm to 550mm
for F200, and up to 2m for SR300.
Moderate smoothing effect optimized for distances between 550mm to
850mm for F200 and up to 2m for SR300 to balance between good
sharpness level, high accuracy and moderate noise artifacts.
High smoothing effect for distances between 850mm to 1000mm for
F200 and up to 4m for SR300 bringing good accuracy with moderate
sharpness level.
Very high smoothing effect to bring moderate accuracy level for
distances above 1m for F200, and 0.8-2.5m (up to 4m) for SR300. Use
together with the MotionRangeTradeOff property to increase the
depth range.
Table 4: The Filter Option Table

2.13.15 Rotation
Namespace Hierarchy
[C++]
PXCImage::Rotation
[C#]
PXCMImage.Rotation
[Java]
PXCMImage.Rotation

Description

549

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The Rotation enumerator itemizes supported image options.

Name/Description
ROTATION_0_DEGREE

Undefined rotation or no rotation.

ROTATION_90_DEGREE

90 degree rotation. If the original image


size is width x height, the rotated image
size becomes height x weight.

ROTATION_180_DEGREE

180 degree rotation.

ROTATION_270_DEGREE

270 degree rotation. If the original image


size is width x height, the rotated image
size becomes height x weight.

2.13.16 State
Namespace Hierarchy
[C++]
PXCPowerState::State
[C#]
PXCMPowerState.State
[Java]
PXCMPowerState.State

Description
The State enumerator itemizes application power state.
Name/Description
STATE_PERFORMANCE

The performance mode uses as much resources as available


for best user experience.

STATE_BATTERY

The battery mode reduces resources usage as needed to


save the platform level power requirements.

Remarks

550

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Regardless of power states, the application can expect the SDK modules to behave
the same from the SDK API point of view. For example, the application can expect an
asynchronous function to return immediately, regardless of the power state. The
synchronization of the computation result could take longer, or the quality of the
computation could be different due to the algorithms used in different power states.

2.13.17 Status (+JS,+UWP)


Namespace Hierarchy
[C++]
pxcStatus
[C#]
pxcmStatus
[Java]
pxcmStatus
[JavaScript]
intel.realsense.Status
[C#/UWP]
Intel.RealSense.Status

Description
[C++]

The Status enumerator itemizes status codes returned by SDK functions.


You need to prefix the status code with PXC_. For example, use PXC_STATUS_NO_ERROR
for the success status code.
[C#][Java]

The Status enumerator itemizes status codes returned by SDK functions.


You need to prefix the status code with PXCM_. For example, use
PXCM_STATUS_NO_ERROR for the success status code.
[JavaScript][C#/UWP]

The Status enumerator itemizes status codes returned by SDK functions.

Name/Description

551

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Successful operation
STATUS_NO_ERROR

The operation completed successfully.

Programming errors
STATUS_HANDLE_INVALID

The session/module instance or


pointer is invalid.

STATUS_ALLOC_FAILED

Failed to allocate memory or create an


instance of a module or resource.

Configuration-related errors or warnings


STATUS_FEATURE_UNSUPPORTED

The requested feature is not available


or not implemented.

STATUS_PARAM_UNSUPPORTED

There are invalid/unsupported


parameters in the configuration.

STATUS_ITEM_UNAVAILABLE

The item could not be found, or end of


stream.

STATUS_INIT_FAILED

General failure during algorithm


initialization.

STATUS_STREAM_CONFIG_CHANGED

The stream configuration has changed


during streaming.

STATUS_CAPTURE_CONFIG_ALREADY_SET

The capture configuration has already


been set.

Asynchronous operation-related errors or warnings

552

STATUS_EXEC_ABORTED

The asynchronous pipeline operation


is aborted in upstream components.
Check the status return code of
upstream components to determine
where the error occurred.

STATUS_EXEC_INPROGRESS

The asynchronous operation is in


progress.

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

STATUS_EXEC_TIMEOUT

553

Intel RealSense SDK 2016 R2 Reference Manual

The synchronization function timed


out. The asynchronous operation is still
in progress.

2010-2016 Intel Corporation

Hardware device-related errors or warnings


STATUS_DEVICE_FAILED

Unexpected device failure due to device


mulfunctioning, failed to allocate
acceleration resources, etc. The
application must close the module
instance and recreate it.

STATUS_DEVICE_LOST

Unexpected device failure due to the loss


of the device such as system sleep/
hibernation, or the peripheral device was
unplugged. The application can choose
to abort or wait for the device to
reconnect. In the latter case, the device
operation will resume.

STATUS_DEVICE_BUSY

The application does not have control of


the device thus cannot change the device
configuration. The application can only
use the existing configuration of the
device.

File-based errors or warnings


STATUS_FILE_WRITE_FAILED

Failed to open a file for write or write to a


file.

STATUS_FILE_READ_FAILED

Failed to open a file for read or read a


file.

STATUS_FILE_CLOSE_FAILED

Failed to close a file handle.

Data & process errors and warnings

554

STATUS_DATA_UNAVAILABLE

Data not available for module processing.

STATUS_DATA_NOT_INITIALIZED

Failed to initialize data.

STATUS_DATA_PENDING

There is additional data remaining in the


algorithm buffer.

STATUS_DATA_NOT_CHANGED

Data remains the same as no new input is


available.

STATUS_PROCESS_FAILED

General failure in algorithm processing.

Intel RealSense SDK 2016 R2 Reference Manual

STATUS_NOT_MATCHING_CALIBRATION

2010-2016 Intel Corporation

The calibration process failed to match


the data points.

See Also
Type Extension (C#, Java)
2.13.17.1 Type Extension (C#, Java)

The pxcmStatus enumerator exposes the following type extension:


Extension

Description

IsError

Return if the status code is an error.

IsWarning

Return if the status code is a warning.

IsSuccessful

Return if the status code is not an error.

2.13.17.1.1 IsError

Namespace Hierarchy
[C#]
pxcmStatus.IsError
[Java]
pxcmStatus.isError

Syntax
[C#]
Boolean IsError();
[Java]
boolean isError();

Parameters
None
Description
The IsError function returns true if the status code describes an error (less than
pxcmStatus.PXCM_STATUS_NO_ERROR.)
Return Status
Boolean if the status code is an error.

555

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.13.17.1.2 IsSuccessful

Namespace Hierarchy
[C#]
pxcmStatus.IsSuccessful
[Java]
pxcmStatus.isSuccessful

Syntax
[C#]
Boolean IsSuccessful();
[Java]
boolean isSuccessful();

Parameters
None
Description
The IsSuccessful function returns true if the status code is not an error (greater than
or equal to pxcmStatus.PXCM_STATUS_NO_ERROR.)
Return Status
Boolean if the status code is not an error.
2.13.17.1.3 IsWarning

Namespace Hierarchy
[C#]
pxcmStatus.IsWarning
[Java]
pxcmStatus.isWarning

Syntax
[C#]
Boolean IsWarning();
[Java]

556

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

boolean isWarning();

Parameters
None
Description
The IsWarning function returns true if the status code describes a warning (greater
than pxcmStatus.PXCM_STATUS_NO_ERROR.)
Return Status
Boolean if the status code is a warning.

2.13.18 StreamOption (+UWP)


Namespace Hierarchy
[C++]
PXCCapture::Device::StreamOption
[C#]
PXCMCapture.Device.StreamOption
[Java]
PXCMCapture.Device.StreamOption
[C#/UWP]
Intel.RealSense.StreamOption

Description
The StreamOption enumerator itemizes supported stream options. You can use bitOR to specify multiple options.
Name/Description

557

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

STREAM_OPTION_ANY

No option specified.

STREAM_OPTION_DEPTH_PRECALCULATE_UV A performance hint to anticipate using


MAP
UV map in subsequent operations.
STREAM_OPTION_STRONG_STREAM_SYNC

A hint to use hardware-based strong


stream synchronization.
Apply this flag to all streams you
plan to stream, or the mode is not
enabled.

STREAM_OPTION_UNRECTIFIED

The stream contains unrectified


samples.

STREAM_OPTION_DEPTH_CONFIDENCE

The stream contains depth confidence


map.

These flags are used to determine if the options are mandatory or optional.
STREAM_OPTION_OPTIONAL_MASK

The mask of all optional options.

STREAM_OPTION_MANDATORY_MASK

The mask of all mandatory options.

2.13.19 StreamType (+JS,+UWP)


Namespace Hierarchy
[C++]
PXCCapture::StreamType
[C#]
PXCMCapture.StreamType
[Java]
PXCMCapture.StreamType
[JavaScript]
intel.realsense.StreamType
[C#/UWP]
Intel.RealSense.StreamType

Description

558

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

The StreamType enumerator itemizes supported video stream types. The value can
be Bit-OR'ed to represent multiple stream combinations.
Name/Description
STREAM_TYPE_ANY

Any stream type. This is usually used to specify that a


stream type is not specified, for example, as the scope
parameter to the QueryStreamProfileSet function.

STREAM_TYPE_COLOR

The color stream.

STREAM_TYPE_DEPTH

The depth stream.

STREAM_TYPE_IR

The inferred stream.


Not available in camera model R200. Use
STREAM_TYPE_LEFT and STREAM_TYPE_RIGHT.

STREAM_TYPE_LEFT

The left imager stream of a stereotypical camera.


Not exposed in UWP.

STREAM_TYPE_RIGHT

The right imager stream of a stereotypical camera.


Not exposed in UWP.

See Also
Type Extension
2.13.19.1 Type Extension

The StreamType enumerator exposes the following type extension:


Extension

Description

ToString

Return the string representation of the stream type.

operator++ (C++)

Helper functions to traverse the stream types.

ToIndex (C#,Java)

Return the index given the stream type.

2.13.19.1.1 ToString (C#,Java)

Namespace Hierarchy
559

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C#]
PXCMCapture.StreamType.ToString
[Java]
PXCMCapture.StreamType.toString

Syntax
[C#]
String ToString();
[Java]
string toString();

Parameters
None

Description
The ToString function returns the string representation of the stream type.
Return Status
The string representation.
2.13.19.1.2 ToIndex (C#,Java)

Namespace Hierarchy
[C#]
PXCMCapture.StreamType.ToIndex
[Java]
PXCMCapture.StreamType.toIndex

Syntax
[C#]
Int32 ToIndex();
[Java]
int

toIndex();

Parameters

560

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

None

Description
The ToIndex function returns the zero-based stream index of the current stream
type.
Return Status
The stream index value.
2.13.19.1.3 operator++ (C++)

Namespace Hierarchy
PXCCapture::StreamType::operator++

Syntax
StreamType &operator++();
StreamType operator++(pxcI32);

// ++StreamType
// StreamType++

Parameters
None

Description
The operator++ functions (both the prefix and postfix versions) provides a
convenient way of enumerating all stream types as follows:
for (PXCCapture::StreamType st=PXCCapture::STREAM_TYPE_COLOR;
st!=PXCCapture::STREAM_TYPE_ANY;st++) {
...
}

Return Status
The string representation.

561

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.14

Samples
The SDK samples are located in the following directories:
[C++]
$(RSSDK_DIR)/sample
[C#/.NET4]
$(RSSDK_DIR)/framework/CSharp
[C#/Unity]
$(RSSDK_DIR)/framework/Unity
[Java]
$(RSSDK_DIR)/framework/Java
[Processing]
$(RSSDK_DIR)/framework/Processing
[JavaScript]
$(RSSDK_DIR)/framework/JavaScript
[C#/UWP]
$(RSSDK_DIR)/framework/UWP

The samples are prefixed with the following abbreviations to identify the camera model they
work with:
DF

Camera neutral samples (Dual Facing.)

FF

Camera model F200 or SR300 samples (Front Facing)

RF

Camera model R200 samples (Rear Facing)

Locate the sample and copy the sample source to a writable directory. Most samples require
a writable sample directory for building or execution.
See the following build and execution instructions:
[C++]

Build the sample using one of the Microsoft* Visual Studio* solution files. Then execute
the sample within the IDE.
You can also run the pre-built samples under $(RSSDK_DIR)/bin/win32 or
$(RSSDK_DIR)/bin/x64.
[C#/.NET4]

Build the sample using one of the Microsoft* Visual Studio* solution files. Then execute
the sample within the IDE.
You can also run the pre-built samples under $(RSSDK_DIR)/bin/win32 or
$(RSSDK_DIR)/bin/x64.

562

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

[C#/Unity]

Locate the Unity* scene and run the sample within the Unity Editor.
[Java]

Set the JAVA_HOME environment variable to the Java JDK installation directory and run the
script run.bat.
[Processing]
Copy the $(RSSDK_DIR)/framework/Processing/libraries directory to your sketch
location. You can find your sketch location from File->Preference. Then click on the

sample file to run the sample.


[JavaScript]

Click on the sample to run in your favorite browser.


[C#/UWP]

Build the sample using the Microsoft* Visual Studio* solution file. Then execute the sample
within the IDE.

563

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.14.1 Sample: DF_CameraViewer [C++]


The DF_CameraViewer sample is a simple C++ console application to stream and render
color and/or depth streams.
The sample can be used for quickly testing certain SDK interfaces.
DF_CameraViewer [-load <module name>] [-sdname <device name>]
[-csize <resolution>] [-dsize <resolution>] [-file <Output Filename>] [listio] [-record] [-help]
-load

Explicitly load the specified module.

-csize

Specify the color stream resolution and frame rate. For


example, use 640x480 to specify the resolution, or
640x480x30 to specify the resolution and the frame rate.

-dsize

Specify the depth stream resolution and frame rate. For


example, use 640x480 to specify the resolution, or
640x480x30 to specify the resolution and the frame rate.

sdname

Specify an input device name.

nframes

Specify the maximum number of frames to record.

listio

List the I/O devices.

-record

Enable file recording. Use the -file option to specify the


recording file name.

file

Specify the recording or playback file name. If -record is not


specified, the sample plays back the specified file. Otherwise,
the sample records the camera data to the specified file.
The SDK installation directory is privileged and not
writable. For file recording, please specify a file name in a
writable directory.

-help

Print out the help message.

Example:
DF_CameraViewer nframes 200

564

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.14.2 Sample: DF_CameraViewer (Java)


The $(RSSDK_DIR)/framework/Java/DF_CameraViewer sample shows how to stream
color and depth from the camera. The sample is tested under Java JDK 1.7.0_11.
Use the following steps to run the sample:
1. Set the JAVA_HOME environment variable to the Java JDK installation location.
2. Run the script $(RSSDK_DIR)/framework/Java/DF_CameraViewer/run.bat. You should
see the console output similar to Figure 14.

Figure 14: The Camera Viewer Sample Showing Color and Depth Streams

565

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.14.3 Sample: DF_Projection [C++]


The DF_Projection sample demonstrates how to use the SDK Projection functions. The
projection functions map or project coordinates among the color image coordinate system,
the depth image coordinate system, and the camera coordinate system.

Figure 15: The Sample Main Window

The main window is shown in Figure 15. It contains the following components:
The Menu bar contains the following tabs:
o Device Select the imaging device.
o Color, Depth Select the color/depth stream resolutions.
o Mode Select the live (default) or playback mode.
o Command Start or stop streaming.
The Image Panels visualize the color, depth and vertices data as similar to Figure 16.
Click on the QueryInvUVMap button to show the inverse UV map data, if not shown
initially. The inverse UV map provides coordinates mapping from the color image to
the depth image.
Click on the QueryUVMap button to show the UV map data, if not shown initially. The
UV map provides coordinates mapping from the depth image to the color image.
Click on the QueryVertices button to show the vertices data, if not shown initially.
The vertices data is in the 3D space. For rendering simplicity, the sample projects it to
a 2D plane for visualization. The sample applies some lighting effect when you move
your mouse to give a pseudo 3D effect.
566

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Figure 16: The Color/Depth/Vertices Visualization

You can draw on any of the three panels: color, depth and vertices. The sample maps
the coordinates to the other panels and draws on them accordingly, with the
mapping/projection functions marked for such operation. See Figure 17 - Figure 19.

567

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Figure 17: Map/Project Color Coordinates to Depth/Camera Coordinates

568

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Figure 18: Map Depth Coordinates to Color and Camera Coordinates

569

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Figure 19: Project Camera Coordinates to Color and Depth Image Coordinates.

The Control Panel contains the following buttons:


o CreateDepthImageMappedToColor and CreateColorImageMappedToDepth: Create
aligned images to the color and depth resolutions, respectively, as illustrated in Figure
20.

570

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Figure 20: Create Aligned Color/Depth Images

o Play the color stream (and the depth stream.)


o Pause the streaming.
o Stop the streaming.
o Mirror the stream horizontally.
The Status Bar provides the information during the sample operation such as selected
resolution, clip and streaming status.

571

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.14.4 Sample: DF_RawStreams [C++, C#]


The DF_RawStreams and DF_RawStreams.cs samples show how to visualize raw depth and
color streams.
The main window is shown as in Figure 21.

Figure 21: Raw Streams Main Window

From the menu, you can choose the following items:


Device: Select from a list of I/O devices for streaming.
Color, Depth, (IR), Left, or Right: Select the corresponding stream configuration.

The stream types are camera device specific.


Mode: Select whether to do live streaming, recording or playback. If the playback or

recording mode is selected, the sample will prompt for the playback or recording file
name.
C/D Sync (Sync SW) or No Sync: Select whether to use synchronous or asynchronous

color and depth streaming during visualization. The former synchronizes the color sample
with the corresponding depth sample, while the latter visualizing them in their own frame
rates.
Sync HW: Performs strong hardware-based synchronization on the enabled streams.

From the side buttons, you can choose the following options:

572

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Color: Visualize the color stream in the main display. If picture-in-picture is enabled, the

stream previously displayed in the main display goes to the picture-in-picture display.
Depth: Visualize the depth stream in the main display. If picture-in-picture is enabled, the

stream previously displayed in the main display goes to the picture-in-picture display.
IR: Visualize the infrared stream in the main display. If picture-in-picture is enabled, the

stream previously displayed in the main display goes to the picture-in-picture display.
Scale: Scale the image to the size of the display window, or the actual size.
Mirror: Flip the image horizontally to show the camera view or the user view.
PIP: Open a picture-in-picture window to visualize the second stream in streaming. Multiple

clicks can choose the window size and location.


Start: Start streaming.
Stop: Stop streaming.
Stop: Stop streaming.

Windows SDK 8.0 is required on user's system for successful compilation of


DF_RawStreams (C++) sample from SDK package sources.

573

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

2.14.5 Sample: DF_StreamViewer [UWP]


The DF_StreamViewer_UWP_CS sample is an UWP application to show how to visualize raw
depth and color streams.
The main window is shown as in Figure 22.

Figure 22: Stream Viewer Main Window

The sample shows available camera devices in the top left box, where you can select the
device of interest.
You can select multiple streams of interest by clicking on the Color, Depth, or IR buttons.
Also select whether you want to visualize the streams synchronously or asynchronous using
the Multistream Sync selection box.
Click the Start button to start streaming. The sample shows the selected streams in the
display panel.
Click the Stop button to stop streaming.

2.14.6 Sample: FF_IQSampleTool [C#]


Introduction
The FF_IQSampleTool.cs application is based on the RawSample sample. It showcases how
to create tests for image quality that can be used with your camera. It features:

574

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Automatic Marker tracking


XYZ on-hover output for depth streams
Test for UV Map alignment error
Test for depth uniformity
Test for absolute depth values
This application requires the use of a Port3 Test Chart. If you do not have one, you can print
your own (Included in the source is Port 3 Chart.pdf under the Assets directory), as
illustrated in Figure 23, but your test results for the protruding square will not be accurate.
(The protruding square measures 12cm x 12cm x 5cm you can also create your own out of
card stock paper and attach it to your printed chart).

Figure 23: Test Chart for use with IQ Sample Tool

Getting Started
1. Obtain a chart. If you have a Port3 test chart, go to the next step. If not, you will have to
create one.
2. Setup your test area. Position your camera 50 cm away from the test chart. Ensure that the
chart is parallel with the plane of the camera. If not parallel, test results can be skewed.
(You can use a box, a metallic frame, the test chart with included spacer, etc. to do this).
3. Launch the application. If the camera is loaded successfully, the Depth radio button will be
selectable. You will also see the camera under the Device drop down menu.
575

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

4. Select the Color radio button and click on Start Streaming to run video.
5. For landmark tracking, the program must know the location of the test chart. To do this,
you must outline the edges of the test chart. Drag your mouse cursor from one corner of
the chart to the other. When done, click on Set RGB Border. See Figure 24 for an
illustration.

Figure 24: Specifying the chart edges for the Depth video stream.

6. Ensure the fiducial markers have been located properly. You should see the black circles
outlined by red squares. You should also see the black crosshairs in the center of the black
circle markers. Look at Figure 25 for the proper alignment (left) and the improper
alignment (right). Improper alignment stems from poor lighting (for the RGB video) or from
the rounding error introduced during the edge selection. If the markers are not detected
properly, repeat step 5, but experiment with different selection sizes.

Figure 25: Left: Properly detected fiducial marker. Right: Detection Error

7. Your screen should look like Figure 26.

576

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Figure 26: Proper Located Fiducial Markers.

8. Now select the Depth radio button. The video will change to a depth-only view.
9. Specify the chart edges by dragging your mouse from one corner to the opposite corner.
Click on Set Depth Border (see Figure 74).

577

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Figure 27: Specifying chart edges for Depth stream.

10. Your view should now look like Figure 28:

Figure 28: Selected Depth Edges.

11. Notice that the fiducial markers are outlined in the white squares. The green squares are

578

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

an array of ROIs (Regions of Interest) that are used for the Uniformity test. Check that all
fiducial markers are properly aligned and that all green ROIs fall within the depth chart. If
not, repeat Step 9.
12. Click Run Tests to analyze data.
Tests
UV Map: Alignment Error
The UV Map aligns the RGB stream with the depth stream. This tests calculates the error in
this alignment. An example of this error can be visibly seen when using the test chart. See
Figure 29 for an example. Notice that the circular fiducial markers do not align. This is the UV
Map alignment error.

Figure 29 :Depth data (green dots) overlayed on color stream.

Absolute Depth Error


This measures the depth from the surface of the protruding square and the camera plane. It is
then compared to depth values recorded in the center of the black fiducial markers. Since
the protruding square has a measurement of 12cm x 12cm x 5cm, the difference measured
should equal 5 cm (50mm).
Uniformity Test
o This test creates an array of ROIs. The depth data of each ROI is then processed to get the
mean and standard deviation. Uniformity can then be measured.
o Any tilt error also becomes apparent with these results.

579

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Appendices
This section includes additional SDK definitions.

580

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

3.1

581

C++ Data Type Definitions


C++ Type Definition

C++ Type Definition

pxcBool

Boolean (32-bit integer)

pxcU16

pxcBYTE

8-bit unsigned char

pxcUID

16-bit unsigned
integer
32-bit integer

pxcCHAR

16-bit UNICODE

pxcF64

64-bit floating-point

pxcEnum

32-bit integer

pxcI32

32-bit integer

pxcF32

32-bit floating-point

pxcI16

16-bit integer

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

3.2

SDK API Conventions


A typical SDK interface is illustrated as follows:
class PXCMyInterface:public PXCBase {
public:
PXC_CUID_OVERWRITE(0x12345678); // my unique interface identifier
// my configurations
struct ProfileInfo {
.
};
// configuration inquiry and set working configuration
virtual pxcStatus PXCAPI QueryProfile(pxcI32 idx, ProfileInfo *pinfo)
=0;
virtual pxcStatus PXCAPI SetProfile(ProfileInfo *pinfo)=0;
// Now do something asynchronously
virtual pxcStatus PXCAPI ProcessAsync(, PXCScheduler::SyncPoint *sp)
=0;
};

Naming Conventions
All classes, functions, and structures in the global name space use PXC or pxc as a
prefix.
Minimize creating classes, functions, and structures in the global name space. Put
classes, functions, and structures in their respective class scopes.
The class and function names start with a capital letter.
The variable names start with a lower-case letter.
If a class, function, or variable name contains multiple words, usually the SDK
capitalizes the first letter of the second word.
class MyClass: public PXCBase {
public:
struct MyStruct {
MyStruct *myField1;
pxcI32 myField2;
};
};
The macros and enumerator definitions use all capital letters with words
separated by an underline.
#define PXC_DEFINE_UID()

Interface and Member Function Conventions


Each SDK interface is a C++ pure virtual class derived from the Base interface. The

582

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

SDK interface must have a unique class identifier. Use the PXC_CUID_OVERWRITE
macro to define the class identifier.
Each SDK interface must contain pure virtual functions only, with or without default
implementation. No constructor or desctructor.
Do not use exception handling or dynamic cast in interface definitions or module
implementations, as these features do not reliably work across multiple compilers.
Most SDK functions should return a status code, Status, unless the functions are
simple enough that they return some internal variables without any processing.
virtual pxcStatus
virtual pxcI64

PXCAPI
PXCAPI

SetTimeStamp(pxcI64 ts)=0;
QueryTimeStamp(void)=0;

For bit-ORed field enumerators, the SDK usually defines them as enumerators
with inline helper functions for bit-OR operations. The helper functions are not
needed if the SDK uses the values directly without the bit-OR operations.
enum ImplGroup {
IMPL_GROUP_CORE = 0x80000000,
IMPL_GROUP_USER = 0x40000000,
};
__inline static ImplGroup operator|(ImplGroup a, ImplGroup b) {
return (ImplGroup)((int)a | (int)b);
}
For consistency, use the following two functions for module configuration
query and setup:
virtual pxcStatus PXCAPI QueryProfile(pxcI32 pidx, ProfileInfo
*pinfo);
virtual pxcStatus PXCAPI SetProfile(ProfileInfo *pinfo);

Language Limitations
Observe different language limitations to facilitate the porting to these
languages. Here are a few most common ones:
Java* (as well as Microsoft* .NET*) does not support unsigned data types.
Use unsigned data types unless absolutely necessary.
Java does not support returning primitive data types through reference in
function arguments. Avoid using the following function signature:
Avoid:

virtual void PXCAPI QueryValue(pxcI32 &pidx);

Suggested: virtual pxcI32 PXCAPI QueryValue(void);

Data and Control Flow Conventions


Use the Image and Audio interfaces to abstract image and audio buffers. These
buffers may be in system memory buffers or in OS-specific surfaces.

583

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

Any SDK function that performs anything more than trivial tasks should be
asynchronous. The function returns immediately with an SP.
Design asynchronous I/O functions so that the functions can be chained into an
asynchronous pipeline for better performance. A counter example is that if there are
multiple faces in a picture, it is not a good design if the asynchronous function only
detects a single face. The application must make multiple calls on the picture. The
application cannot determine beforehand how many loops are needed. Instead,
design the function to detect all faces at once. Any subsequent asynchronous
functions should also process all faces.
Asynchronous functions and asynchronous pipelines work best if, with any input
data, each function in the pipeline generates some output and can be processed by
subsequent functions. It is not a good design when an asynchronous function
requires more inputs (worse, irregular amount of inputs) to generate an output.
Consider a callback design for this type of pattern of operations.

3.3

Recorded File Format


The CaptureManager interface records any captured samples to a file. This section describes
the recorded file format.
The recorded file contains a fixed-size header as follows:
struct Header {
pxcI32
ID;
// PXC_UID('R','S','C','F')
pxcI32
fileVersion;
// file version
pxcI32
firstFrameOffset;
// The byte offset to the meta data of
the first frame.
pxcI32
nstreams;
// The number of streams.
pxcI64
frameIndexingOffset;
// Optional frame indexing offset,
zero if not available.
CoordinateSystem coordinateSystem; // The coordinate system setting.
pxcI32
reserved[26];
};

Immediately following the header are multiple data chunks as follows. The chunk data
structure can contain any arbitrary data identified by the chunk identifier and the chunk size.
They can be configuration parameters as well as the image frame data. The order that the
trunk data present in the file is not important with the general rule that if there are
dependencies between two chunks, the dependent chunk should be placed later in the file.
struct ChunkData {
enum ChunkId {
CHUNK_DEVICEINFO
CHUNK_STREAMINFO
CHUNK_PROPERTIES
CHUNK_PROFILES
CHUNK_SERIALIZEABLE

584

Intel RealSense SDK 2016 R2 Reference Manual

=
=
=
=
=

1,
2,
3,
4,
5,

2010-2016 Intel Corporation

CHUNK_FRAME_META_DATA =
6,
CHUNK_FRAME_DATA
=
7,
CHUNK_IMAGE_META_DATA =
8,
CHUNK_FRAME_INDEXING
=
9,
}
chunkId;
// The chunk identifier
pxcI32
chunkSize;
// The chunk size in bytes-8.
pxcBYTE
chunkData[chunkSize]; // The chunk data buffer
} chunks[];

The image frame of any stream are recorded sequentially after the header and any chunks
needed for configurations as follows. The image data starts from ChunkFrameMetaData and
ends with ChunkFrameData. In between, there could be multiple data chunks that describe
the meta data of the image frame. The meta data should be interpreted as delta or changes
against what are defined in the file header section. This saves size if certain meta data are
common for all frames.
struct StreamFrame {
ChunkFrameMetaData frame_header;
// in no defined order
ChunkImageMetaData image_meta_data;
// there could be more chunks here.
ChunkFrameData
} frames[]

// if any.

frame_data;

The followings are the definitions of each trunk data structure:


struct ChunkDeviceInfo {
ChunkId
chunkId=CHUNK_DEVICEINFO;
pxcI32
chunkSize=sizeof(deviceInfo);
DeviceInfo deviceInfo;
};
struct ChunkStreamInfo {
ChunkId
chunkId=CHUNK_STREAMINFO;
pxcI32
chunkSize=sizeof(streamInfo);
struct {
StreamType streamType;
enum CompressionType {
COMPRESSION_NONE=0,
COMPRESSION_H264=1,
COMPRESSION_LZO =2,
} compressionType;
pxcI32 nframes;
// number of frames.
} streamInfo[header.nstreams];
};
struct ChunkProperties {
ChunkId
chunkId=CHUNK_PROPERTIES;
pxcI32
chunkSize=sizeof(properties);
DeviceCap properties[nproperties];

585

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

};
struct ChunkProfiles {
ChunkId
chunkId=CHUNK_PROFILES;
pxcI32
chunkSize=sizeof(profiles);
StreamProfileSet profiles;
};
struct ChunkSerializeable {
ChunkId
chunkId=CHUNK_SERIALIZEABLE;
pxcI32
chunkSize=sizeof(sdata)+sizeof(sdp);
Property sdp;
// The device property this serializable corresponds
to
pxcBYTE
sdata[sdata_bytes];
};
struct ChunkFrameMetaData {
ChunkId
chunkId=CHUNK_FRAME_META_DATA;
pxcI32
chunkSize=sizeof(metaData);
struct {
pxcI32
syncId; // synchronization id for color/depth pairs.
StreamType streamType;
pxcI64
captureTimeStamp;
PXCImage::Option options;
pxcI32
reserved;
// optional field, chunkSize may reduce
if this field does not exist.
pxcI64
arrivalTimeStamp; // optional field, chunkSize may reduce
if this field does not exist.
} metaData;
};
struct ChunkImageMetaData {
ChunkId
chunkId=CHUNK_IMAGE_META_DATA;
pxcI32
chunkSize=sizeof(buffer)+sizeof(id);
pxcUID
id; // meta data identifier
pxcBYTE
buffer[chunkSize-sizeof(id)];
};
struct ChunkFrameDataUncompressed {
ChunkId
chunkId=CHUNK_FRAME_DATA;
pxcI32
chunkSize=sizeof(imageData);
struct {
pxcI32 pitches[PXCImage::NUM_OF_PLANES];
pxcBYTE plane0[pitches[0]*height];
...
pxcBYTE planeN[pitches[PXCImage::NUM_OF_PLANES-1]*height];
} imageData
};
struct ChunkFrameDataCompressed {
ChunkId
chunkId=CHUNK_FRAME_DATA;
pxcI32
chunkSize=sizeof(imageData);
struct {

586

Intel RealSense SDK 2016 R2 Reference Manual

2010-2016 Intel Corporation

pxcI32 pitches[PXCImage::NUM_OF_PLANES]; // pitches of


uncompressed image planes.
enum {
H264=0x343632,
LZO=0x4f5a4c,
} CompressionIdentifier;
pxcBYTE compressed_data[];
} imageData
};
union ChunkFrameData {
ChunkFrameDataCompressed compressed;
CheckFrameDataUncompressed uncompressed;
};
struct ChunkFrameIndexing {
ChunkId
chunkId=CHUNK_FRAME_INDEXING;
pxcI32
chunkSize=sizeof(imageData);
pxcI32
nframes[PXCCapture::STREAM_LIMIT];
struct FrameIndexing {
PXCCapture::StreamType type;
//
pxcI64 offset;
//
the frame data is.
pxcI64 timeStamp;
//
100ns.
pxcI32 frameNumber;
//
number.
} frameIndexing[PXCCapture::STREAM_LIMIT]; //
};

587

Intel RealSense SDK 2016 R2 Reference Manual

the stream type


the byte offset of where
the frame time stamp, in
the absolute frame
the frame indexing.

2010-2016 Intel Corporation

You might also like