OpenNI2 SDK  v2.3.0.81
| Public 成员函数 | 静态 Public 成员函数 | 所有成员列表
org.openni.Device类 参考

interface  OniDeviceOpenListener
 

Public 成员函数

void switchIRCamera (IRCameraType type)
 
void close ()
 
final DeviceInfo getDeviceInfo ()
 
boolean hasSensor (SensorType sensorType)
 
final SensorInfo getSensorInfo (SensorType sensorType)
 
long getHandle ()
 
PlaybackControl getPlaybackControl ()
 
boolean isImageRegistrationModeSupported (ImageRegistrationMode mode)
 
ImageRegistrationMode getImageRegistrationMode ()
 
void setImageRegistrationMode (ImageRegistrationMode mode)
 
boolean isFile ()
 
void setDepthColorSyncEnabled (boolean isEnabled)
 
boolean getDepthColorSyncEnabled ()
 
void setDepthOptimizationEnable (boolean enable)
 
boolean getDepthOptimizationEnabled ()
 
boolean getMultiDistanceCalibrationEnabled ()
 
void setMultiDistanceCalibrationEnable (boolean enable)
 
void setLaserEnable (boolean enable)
 
boolean getAeEnable ()
 
void setAeEnable (boolean enable)
 
void setGain (int gain)
 
int getGain ()
 
String getDeviceType ()
 
int getIrExp ()
 
void setIrExp (int irExp)
 
boolean getLdpEnableRegister ()
 
void setLdpEnableRegister (boolean ldpEnable)
 
void setLdpEnable (boolean ldpEnable)
 
boolean getEmitterEnable ()
 
void setEmitterEnable (boolean enable)
 
boolean getIrFloodEnable ()
 
void setIrFloodEnable (boolean enable)
 
DepthIrMode getDepthIrAlternateMode ()
 
void setDepthIrAlternateMode (DepthIrMode nMode)
 
int getUSBSpeed ()
 
double getIrRealTimeTemperature ()
 
double getLdmpRealTimeTemperature ()
 
OBCameraParams getOBCameraParams ()
 
String getFirmwareVersion ()
 
String getSerialNumber ()
 
void setThirdSoftwareFrameSyncEnabled (boolean isEnabled)
 
void setHardwareFrameSyncEnabled (boolean isEnabled)
 
void setHardwareFrameSyncFps (HardwareFrameSyncFpsType fpsType)
 
void setIrFaceAe (boolean enable, int left, int top, int width, int height)
 

静态 Public 成员函数

static Device open (String uri)
 
static Device open (String uri, OniDeviceOpenListener listener)
 
static Device open ()
 
static Device open (OniDeviceOpenListener listener)
 

详细描述

The Device object abstracts a specific device; either a single hardware device, or a file device holding a recording from a hardware device. It offers the ability to connect to the device, and obtain information about its configuration and the data streams it can offer.

It provides the means to query and change all configuration parameters that apply to the device as a whole. This includes enabling depth/color image registration and frame synchronization.

Devices are used when creating and initializing VideoStream "VideoStreams" – you will need a a Device in order to use the VideoStream.create() function. This, along with configuration, is the primary use of this class for application developers.

Before devices can be created, org.openni.OpenNI#initialize() must have been run to make the device drivers on the system available to the API.

成员函数说明

◆ close()

void org.openni.Device.close ( )
inline

Closes the device. This properly closes any files or shuts down hardware, as appropriate. This function is currently called by the destructor if not called manually by application code, but it is considered a best practice to manually close any device that was opened.

◆ getAeEnable()

boolean org.openni.Device.getAeEnable ( )
inline

获取AE使能状态。

返回

◆ getDepthIrAlternateMode()

DepthIrMode org.openni.Device.getDepthIrAlternateMode ( )
inline

get depth and ir alternate mode (need firmware support)

返回
0 :depth and NIR alternate ;1 :speckle ir

◆ getDepthOptimizationEnabled()

boolean org.openni.Device.getDepthOptimizationEnabled ( )
inline

Used to get Optimization switch state.

返回

◆ getDeviceInfo()

final DeviceInfo org.openni.Device.getDeviceInfo ( )
inline

Provides information about this device in the form of a DeviceInfo object. This object can be used to access the URI of the device, as well as various USB descriptor strings that might be useful to an application.

Note that valid device info will not be available if this device has not yet been opened. If you are trying to obtain a URI to open a device, use OpenNI::enumerateDevices() instead.

返回
DeviceInfo object for this Device

◆ getDeviceType()

String org.openni.Device.getDeviceType ( )
inline

获取设备的类型

返回

◆ getEmitterEnable()

boolean org.openni.Device.getEmitterEnable ( )
inline

Astra pro plus,大白,Gemini,projector,支持这个接口,astra系列的产品没有获取激光状态的接口。

返回

◆ getFirmwareVersion()

String org.openni.Device.getFirmwareVersion ( )
inline

Get firmware version

返回

◆ getHandle()

long org.openni.Device.getHandle ( )
inline

This function return device handle.

返回
OpenNI device handle.

◆ getImageRegistrationMode()

ImageRegistrationMode org.openni.Device.getImageRegistrationMode ( )
inline

Gets the current image registration mode of this device. Image registration is used to properly superimpose two images from cameras located at different points in space. Please see the OpenNi 2.0 Programmer's Guide for more information about registration.

返回
Current image registration mode. See ImageRegistrationMode for possible return values.

◆ getIrExp()

int org.openni.Device.getIrExp ( )
inline

获取 IR 曝光

返回

◆ getIrFloodEnable()

boolean org.openni.Device.getIrFloodEnable ( )
inline

设置泛光灯,需要设备支持泛光灯功能,如:Gemini支持泛光灯。

返回

◆ getIrRealTimeTemperature()

double org.openni.Device.getIrRealTimeTemperature ( )
inline

Request IR real time temperature.

返回

◆ getLdmpRealTimeTemperature()

double org.openni.Device.getLdmpRealTimeTemperature ( )
inline

Request LDMP real time temperature.

返回

◆ getLdpEnableRegister()

boolean org.openni.Device.getLdpEnableRegister ( )
inline

Astra pro plus,大白,Gemini,projector等带LDP功能的设备支持这个接口,这个接口断电不会保存,Astra系列的设备不支持这个接口。

返回
false disable;true enable

◆ getMultiDistanceCalibrationEnabled()

boolean org.openni.Device.getMultiDistanceCalibrationEnabled ( )
inline

Used to get Multi distance calibration switch state enable.

返回

◆ getOBCameraParams()

OBCameraParams org.openni.Device.getOBCameraParams ( )
inline

Get Device internal and external parameters, can be used as needed.

返回
org.openni.OBCameraParams

◆ getPlaybackControl()

PlaybackControl org.openni.Device.getPlaybackControl ( )
inline

Gets an object through which playback of a file device can be controlled.

返回
null if this device is not a file device.

◆ getSensorInfo()

final SensorInfo org.openni.Device.getSensorInfo ( SensorType  sensorType)
inline

Get the SensorInfo for a specific sensor type on this device. The SensorInfo is useful primarily for determining which video modes are supported by the sensor.

参数
sensorTypeof sensor to get information about.
返回
SensorInfo object corresponding to the sensor type specified, or NULL if such a sensor is not available from this device.

◆ getSerialNumber()

String org.openni.Device.getSerialNumber ( )
inline

Get device of SerialNumber.

返回

◆ getUSBSpeed()

int org.openni.Device.getUSBSpeed ( )
inline

This interface can get the type of transmission used by the current USB device. the return value can be compared with the USB speed type in DeviceUSBSpeed class.The result may be: USB_LOW_SPEED, USB_FULL_SPEED, USB_HIGH_SPEED or USB_SUPER_SPEED.

See DeviceUSBSpeed for USB speed type.

返回

◆ hasSensor()

boolean org.openni.Device.hasSensor ( SensorType  sensorType)
inline

This function checks to see if one of the specific sensor types defined in SensorType is available on this device. This allows an application to, for example, query for the presence of a depth sensor, or color sensor.

参数
sensorTypeof sensor to query for
返回
true if the Device supports the sensor queried, false otherwise.

◆ isFile()

boolean org.openni.Device.isFile ( )
inline

Checks whether this device is a file device (i.e. a recording).

返回
true if this is a file device, false otherwise.

◆ isImageRegistrationModeSupported()

boolean org.openni.Device.isImageRegistrationModeSupported ( ImageRegistrationMode  mode)
inline

Checks to see if this device can support registration of color video and depth video. Image registration is used to properly superimpose two images from cameras located at different points in space. Please see the OpenNi 2.0 Programmer's Guide for more information about registration.

返回
true if image registration is supported by this device, false otherwise.

◆ open() [1/4]

static Device org.openni.Device.open ( )
inlinestatic

Opens a any device. This can either open a any device. If multiple devices are connected to the system, then one of them will be opened. This procedure is most useful when it is known that exactly one device is (or can be) connected to the system. In that case, requesting a list of all devices and iterating through it would be a waste of effort.

◆ open() [2/4]

static Device org.openni.Device.open ( OniDeviceOpenListener  listener)
inlinestatic

Opens a any device. This can either open a any device. If multiple devices are connected to the system, then one of them will be opened. This procedure is most useful when it is known that exactly one device is (or can be) connected to the system. In that case, requesting a list of all devices and iterating through it would be a waste of effort.

Adds a new Listener to receive this Device open event. See OniDeviceOpenListener for more information on implementing an event driven device open architecture.

参数
listenerObject which implements OniDeviceOpenListener that will respond to this event.

◆ open() [3/4]

static Device org.openni.Device.open ( String  uri)
inlinestatic

Opens a device. This can either open a device chosen arbitrarily from all devices on the system, or open a specific device selected by passing this function the device URI.

To open any device, simply Device#open() function. If multiple devices are connected to the system, then one of them will be opened. This procedure is most useful when it is known that exactly one device is (or can be) connected to the system. In that case, requesting a list of all devices and iterating through it would be a waste of effort.

If multiple devices are (or may be) connected to a system, then a URI will be required to select a specific device to open. There are two ways to obtain a URI: from a DeviceConnected event, or by calling org.openni.OpenNI#enumerateDevices().

In the case of a DeviceConnected event, the OpenNI.DeviceConnectedListener will be provided with a DeviceInfo object as an argument to its {} OpenNI.DeviceConnectedListener#onDeviceConnected(DeviceInfo) function. The org.openni.DeviceInfo#getUri() function can then be used to obtain the URI.

If the application is not using event handlers, then it can also call the static function org.openni.OpenNI#enumerateDevices(). This will return an array of DeviceInfo objects, one for each device currently available to the system. The application can then iterate through this list and select the desired device. The URI is again obtained via the org.openni.DeviceInfo#getUri() function.

Standard codes of type Status are returned indicating whether opening was successful. For opening a recording file, pass the file path as a uri.

参数
uriString containing the URI of the device to be opened.

◆ open() [4/4]

static Device org.openni.Device.open ( String  uri,
OniDeviceOpenListener  listener 
)
inlinestatic

Opens a device. This can either open a device chosen arbitrarily from all devices on the system, or open a specific device selected by passing this function the device URI.

To open any device, simply Device#open() function. If multiple devices are connected to the system, then one of them will be opened. This procedure is most useful when it is known that exactly one device is (or can be) connected to the system. In that case, requesting a list of all devices and iterating through it would be a waste of effort.

If multiple devices are (or may be) connected to a system, then a URI will be required to select a specific device to open. There are two ways to obtain a URI: from a DeviceConnected event, or by calling org.openni.OpenNI#enumerateDevices().

In the case of a DeviceConnected event, the OpenNI.DeviceConnectedListener will be provided with a DeviceInfo object as an argument to its {} OpenNI.DeviceConnectedListener#onDeviceConnected(DeviceInfo) function. The org.openni.DeviceInfo#getUri() function can then be used to obtain the URI.

If the application is not using event handlers, then it can also call the static function org.openni.OpenNI#enumerateDevices(). This will return an array of DeviceInfo objects, one for each device currently available to the system. The application can then iterate through this list and select the desired device. The URI is again obtained via the org.openni.DeviceInfo#getUri() function.

Standard codes of type Status are returned indicating whether opening was successful. For opening a recording file, pass the file path as a uri.

Adds a new Listener to receive this Device open event. See OniDeviceOpenListener for more information on implementing an event driven device open architecture.

参数
uriString containing the URI of the device to be opened.
listenerObject which implements OniDeviceOpenListener that will respond to this event.

◆ setAeEnable()

void org.openni.Device.setAeEnable ( boolean  enable)
inline

设置AE开关

参数
enable

◆ setDepthColorSyncEnabled()

void org.openni.Device.setDepthColorSyncEnabled ( boolean  isEnabled)
inline

Used to turn the depth/color frame synchronization feature on and off. When frame synchronization is enabled, the device will deliver depth and image frames that are separated in time by some maximum value. When disabled, the phase difference between depth and image frame generation cannot be guaranteed.

参数
isEnabledSet to TRUE to enable synchronization, FALSE to disable it

◆ setDepthIrAlternateMode()

void org.openni.Device.setDepthIrAlternateMode ( DepthIrMode  nMode)
inline

set depth and ir alternate mode (need firmware support)

参数

◆ setDepthOptimizationEnable()

void org.openni.Device.setDepthOptimizationEnable ( boolean  enable)
inline

Used to turn the depth Optimization on and off.

参数
enable

◆ setEmitterEnable()

void org.openni.Device.setEmitterEnable ( boolean  enable)
inline

设置LDM激光开关 ,与 setLaserEnable(boolean) 效果一致

参数
enable

◆ setHardwareFrameSyncEnabled()

void org.openni.Device.setHardwareFrameSyncEnabled ( boolean  isEnabled)
inline

Used to turn the hardware frame synchronization feature on and off. It is used for third platform settings such as p3x.

参数
isEnabledSet to TRUE to enable synchronization, FALSE to disable it

◆ setHardwareFrameSyncFps()

void org.openni.Device.setHardwareFrameSyncFps ( HardwareFrameSyncFpsType  fpsType)
inline

Used to set hardware frame synchronization frame rate type. It is used for third platform settings such as p3x.

参数
fpsTypeSet hardware frame synchronization frame rate type

◆ setImageRegistrationMode()

void org.openni.Device.setImageRegistrationMode ( ImageRegistrationMode  mode)
inline

Sets the image registration on this device. Image registration is used to properly superimpose two images from cameras located at different points in space. Please see the OpenNi 2.0 Programmer's Guide for more information about registration.

See ImageRegistrationMode for a list of valid settings to pass to this function.

It is a good practice to first check if the mode is supported by calling isImageRegistrationModeSupported(ImageRegistrationMode) .

参数
modeDesired new value for the image registration mode.

◆ setIrExp()

void org.openni.Device.setIrExp ( int  irExp)
inline

设置 IR 曝光

参数
irExp

◆ setIrFloodEnable()

void org.openni.Device.setIrFloodEnable ( boolean  enable)
inline

获取泛光灯状态,需要设备支持泛光灯功能,如:Gemini支持泛光灯。

参数
enable

◆ setLaserEnable()

void org.openni.Device.setLaserEnable ( boolean  enable)
inline

Used to turn the device laser on and off setEmitterEnable(boolean)

参数
enable

◆ setLdpEnable()

void org.openni.Device.setLdpEnable ( boolean  ldpEnable)
inline

这个扩展API,一代Astra系列和一代升级的Astra 系列某些带LDP产品有这个功能 接口写的是flash,断电后,LDP设置的状态会保存

参数
ldpEnabletrue或者false

◆ setLdpEnableRegister()

void org.openni.Device.setLdpEnableRegister ( boolean  ldpEnable)
inline

LDP 使能,写的是寄存器,断电重启后,设置的值不会保存。 Astra pro plus,大白,Gemini,projector,支持这个接口,Astra系列的设备不支持这个接口

参数
ldpEnabletrue或者false

◆ setMultiDistanceCalibrationEnable()

void org.openni.Device.setMultiDistanceCalibrationEnable ( boolean  enable)
inline

Set multi distance calibration switch state to enable.

参数
enable

◆ setThirdSoftwareFrameSyncEnabled()

void org.openni.Device.setThirdSoftwareFrameSyncEnabled ( boolean  isEnabled)
inline

Used to turn the software frame synchronization feature on and off. It is used for third platform settings such as p3x.

参数
isEnabledSet to TRUE to enable synchronization, FALSE to disable it

◆ switchIRCamera()

void org.openni.Device.switchIRCamera ( IRCameraType  type)
inline

Switching left and right IR camera.

参数
typeorg.openni.IRCameraType

该类的文档由以下文件生成: