Kinect Get Depth Kinect Initialize navigation bar

Table of Contents

Kinect Get Image

Gets a colour or infrared image from the Kinect sensor.

Library

QUARC Targets/Multimedia

MATLAB Command Line

Click to copy the following command line to the clipboard. Then paste it in the MATLAB Command Window:

qc_open_library('quarc_library/Multimedia')

Description

Kinect Get Image

The Kinect Get Image block gets an RGB colour or infrared image from the Kinect sensor. The output is a three-dimensional matrix representing the red, green and blue components of each pixel in the image. The output dimensions are MxNx3, where M is the height of the image and N is the width of the image.

The Kinect Get Image block may also be configured to output the image as a grayscale image. In that case, the output is a two-dimensional MxN matrix where each element represents a shade of grey. The grayscale option is more suitable for the infrared camera or when colour is not required for image processing. A grayscale image takes less memory and is faster to process.

A variety of different output data types are supported that are compatible with The MathWorks'

Computer Vision System Toolbox

MATLAB Command Line

Click to copy the following command line to the clipboard. Then paste it in the MATLAB Command Window:

doc vision;
, including both integer and floating-point data types.

Other parameters allow various camera settings to be tuned to accomodate the environment. Note however that not all Kinect hardware supports tuning the camera settings. In that case, the camera settings are simply ignored and no error is generated. For example, the Kinect for XBox 360 does not support camera settings. When it is selected in the Kinect Initialize block the camera settings fields will be disabled.

A Kinect Initialize block must be present in the model to configure the Kinect sensor.

Limitations

QUARC Linux DuoVero Target

Warning Only the 640x480 resolution is currently supported on the QUARC Linux DuoVero target. Also, camera settings such as backlight compensation, flicker reduction, frame interval and the options on the exposure and color tabs are not supported.

Input Ports

This block has no input ports.

Output Ports

img

When the Output format is set to MATLAB RGB this output is a three-dimensional MxNx3 matrix where M is the image height and N is the image width. It contains the red, green and blue components for each pixel in the image.

When the Output format is set to MATLAB Greyscale this output is a two-dimensional MxN matrix where M is the image height and N is the image width. It contains the shade of grey for each pixel in the image.

The data type depends on the Output data type parameter. The matrix is compatible with The MathWorks'

Computer Vision System Toolbox

MATLAB Command Line

Click to copy the following command line to the clipboard. Then paste it in the MATLAB Command Window:

doc vision;
.

#

The frame number of the current frame. This output may be used to keep track of the number of frames per second being processed by the Kinect sensor.

time

The timestamp associated with the current frame. The timestamp is not necessarily related to the time the model was started.

Parameters and Dialog Box

Main Pane

The Main pane of the dialog appears as follows:

Kinect Get Image Main tab

The Main tab contains the core settings affecting the output of the block, such as the sensor type, image resolution and output format.

Kinect name

The identity of the associated Kinect Initialize block. The Kinect Get Image block must be associated with a Kinect Initialize block.

Image sensor type (tunable offline)

The type of sensor for which to get images. Both the colour RGB camera and the infrared camera of the Kinect sensor are supported.

Image resolution

The resolution of the image to retrieve. The Kinect sensor only supports a limited set of resolutions and not all resolutions are supported on all targets. The 640x480 resolution is supported on all targets that support the Kinect.

Output format

The format of the output image. The output format may be MATLAB RGB, in which the img output is a three-dimensional MxNx3 matrix, or MATLAB Greyscale, in which the img output is a two-dimensional MxN matrix.

Output data type

The data type to use for the img output. Both integral and floating-point data types are supported. The output data types are compatible with The MathWorks'

Computer Vision System Toolbox

MATLAB Command Line

Click to copy the following command line to the clipboard. Then paste it in the MATLAB Command Window:

doc vision;
.

Backlight compensation (tunable offline)

This option controls the backlight compensation used by the Kinect sensor, allowing the way that the camera captures data to be adjusted according to environmental conditions.

Flicker reduction (tunable offline)

This option may be used to reduce flicker caused by the frequency of the power line.

Frame interval (seconds) (tunable offline)

The frame interval at which images are taken. A value of zero causes the default frame rate to be used.

Sample time

The sampling period (in seconds) of the Kinect Get Image block. A sample time of 0 indicates that the block will be treated as a continuous time block. A positive sample time indicates that the block is a discrete time block with the given sample time.

A sample time of -1 indicates that the block inherits its sample time. Since this is a source block, only inherent the sample time when it is placed in a conditionally executed subsystem, like a Triggered or Enabled Subsystem, or in a referenced model.

The default sample time is set to qc_get_step_size * ceil(0.033 / qc_get_step_size). The qc_get_step_size function is a QUARC function that returns the fundamental sampling time of the model. Hence, the default sample time is a discrete sample time which is a multiple of the fixed step size of the model and close to 1/30 of a second.

Exposure Pane

The Exposure pane of the dialog appears as follows:

Kinect Get Image Exposure tab

The Exposure tab contains settings related to the exposure of the image, such as the brightness and contrast.

Brightness (tunable offline)

The brightness of the image. Valid values range from 0.0 to 1.0, denoting 0% to 100% brightness. The default value is 0.2156.

Gain (tunable offline)

The multiplier to apply to the RGB colour values. Valid values range from 1.0 to 16.0. The default value is 1.0.

Gamma (tunable offline)

Sets the gamma correction, which is a non-linear operation for coding luminance values in video. Valid values range from 1.0 to 2.8. The default value is 2.2.

Use automatic exposure (tunable offline)

Check this option to enable the camera to automatically determine proper exposure times. If this option is not checked then the exposure time should be set manually via the Exposure time parameter.

Exposure time (seconds) (tunable offline)

The time to expose the image, in seconds. This option is only enabled if the Use automatic exposure option is not checked.

Contrast (tunable offline)

The contrast for the image. Valid values range from 0.5 to 2.0. The default value is 1.0.

Sharpness (tunable offline)

The amount of detail visible in the image. Valid values range from 0.0 to 1.0. The default value is 0.5.

Color Pane

The Color pane of the dialog appears as follows:

Kinect Get Image Color tab

The Color tab contains settings like hue and saturation affecting the colour of the image.

Hue (tunable offline)

The shade of colours in the image. Valid values range from -22.0 to +22.0. The default value is 0.0.

Saturation (tunable offline)

The intensity of the colours in the image relative to their brightness. Valid values range from 0.0 to 2.0. When the saturation is zero the colours become shades of grey. The default value is 1.0.

Use automatic white balancing (tunable offline)

Check this option to enable the camera to automatically determine the proper white balancing. If this option is not checked then the white balance must be set manually via the White balance parameter.

White balance (tunable offline)

The colour temperature in degrees Kelvin. Valid values range from 2700 to 6500. The default value is 2700.

Targets

Target Name

Compatible*

Model Referencing

Comments

QUARC Win32 Target

Yes

Yes

QUARC Win64 Target

Yes

Yes

QUARC Linux Nvidia Target

Yes

Yes

QUARC Linux QBot Platform Target

Yes

Yes

QUARC Linux QCar 2 Target

Yes

Yes

QUARC Linux QDrone 2 Target

Yes

Yes

QUARC Linux Raspberry Pi 3 Target

Yes

Yes

QUARC Linux Raspberry Pi 4 Target

Yes

Yes

QUARC Linux RT ARMv7 Target

Yes

Yes

QUARC Linux x64 Target

Yes

Yes

QUARC Linux DuoVero Target

Yes

Yes

Only the 640x480 resolution is presently supported. Player information is not currently supported.

QUARC Linux DuoVero 2016 Target

Yes

Yes

QUARC Linux Verdex Target

No

No

Not supported.

QUARC QNX x86 Target

No

No

Not supported.

Rapid Simulation (RSIM) Target

Yes

Yes

Fully supported.

S-Function Target

No

N/A

Old technology. Use model referencing instead.

Normal simulation

Yes

Yes

Fully supported.

* Compatible means that the block can be compiled for the target.

 

navigation bar