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

class  CameraSettings
 
interface  NewFrameListener
 

Public 成员函数

void destroy ()
 
ParamsRegistrationMode getSoftwareRegistratorMode ()
 
void setSoftwareRegistrator (ParamsRegistrationMode mode)
 
void setSoftFilterEnable (boolean isEnabled)
 
final SensorInfo getSensorInfo ()
 
void start ()
 
void stop ()
 
VideoFrameRef readFrame ()
 
void addNewFrameListener (NewFrameListener streamListener)
 
void removeNewFrameListener (NewFrameListener streamListener)
 
long getHandle ()
 
CameraSettings getCameraSettings ()
 
final VideoMode getVideoMode ()
 
void setVideoMode (VideoMode videoMode)
 
int getMaxPixelValue ()
 
int getMinPixelValue ()
 
boolean isCroppingSupported ()
 
CropArea getCropping ()
 
void setCropping (CropArea cropping)
 
void resetCropping ()
 
void filterSpeckles (ByteBuffer buf, int newVal, int maxSpeckleSize, int maxDiff)
 
boolean getMirroringEnabled ()
 
void setMirroringEnabled (boolean isEnabled)
 
float getHorizontalFieldOfView ()
 
float getVerticalFieldOfView ()
 
SensorType getSensorType ()
 
void setStreamMinDepth (int minDepth)
 
void setStreamMaxDepth (int maxDepth)
 
void setStreamInputFormat (StreamInputFormat inputFormat)
 
void setStreamDepthRotate (int enable)
 
void setStreamHoleFilter (int holeFilter)
 
void setSoftFilter (SoftFilterType softFilter)
 

静态 Public 成员函数

static VideoStream create (Device device, SensorType sensorType)
 

详细描述

The VideoStream object encapsulates a single video stream from a device. Once created, it is used to start data flow from the device, and to read individual frames of data. This is the central class used to obtain data in OpenNI. It provides the ability to manually read data in a polling loop, as well as providing events and a Listener class that can be used to implement event-driven data acquisition.

Aside from the video data frames themselves, the class offers a number of functions used for obtaining information about a VideoStream. Field of view, available video modes, and minimum and maximum valid pixel values can all be obtained.

In addition to obtaining data, the VideoStream object is used to set all configuration properties that apply to a specific stream (rather than to an entire device). In particular, it is used to control cropping, mirroring, and video modes.

A valid, initialized device that provides the desired stream type is required to create a stream.

Several video streams can be created to stream data from the same sensor. This is useful if several components of an application need to read frames separately.

While some device might allow different streams from the same sensor to have different configurations, most devices will have a single configuration for the sensor, shared by all streams.

成员函数说明

◆ addNewFrameListener()

void org.openni.VideoStream.addNewFrameListener ( NewFrameListener  streamListener)
inline

Adds a new Listener to receive this VideoStream onNewFrame event. See NewFrameListener for more information on implementing an event driven frame reading architecture.

参数
streamListenerObject which implements NewFrameListener that will respond to this event.

◆ create()

static VideoStream org.openni.VideoStream.create ( Device  device,
SensorType  sensorType 
)
inlinestatic

Creates a stream of frames from a specific sensor type of a specific device. You must supply a reference to a Device that supplies the sensor type requested. You can use Device#hasSensor(SensorType) to check whether a given sensor is available on your target device before calling create().

参数
deviceA reference to the Device you want to create the stream on.
sensorTypeThe type of sensor the stream should produce data from.

◆ destroy()

void org.openni.VideoStream.destroy ( )
inline

Destroy this stream. This function is currently called automatically by the destructor, but it is considered a best practice for applications to manually call this function on any VideoStream that they call create() for.

◆ getCameraSettings()

CameraSettings org.openni.VideoStream.getCameraSettings ( )
inline

Gets an object through which several camera settings can be configured.

返回
null if the stream doesn't support camera settings.

◆ getCropping()

CropArea org.openni.VideoStream.getCropping ( )
inline

Obtains the current cropping settings for this stream.

返回
CropArea CropArea object which encapsulated cropping info.

◆ getHandle()

long org.openni.VideoStream.getHandle ( )
inline

This function return stream handle.

返回
OpenNI stream handle.

◆ getHorizontalFieldOfView()

float org.openni.VideoStream.getHorizontalFieldOfView ( )
inline

Gets the horizontal field of view of frames received from this stream.

返回
Horizontal field of view, in radians.

◆ getMaxPixelValue()

int org.openni.VideoStream.getMaxPixelValue ( )
inline

Provides the maximum possible value for pixels obtained by this stream. This is most useful for getting the maximum possible value of depth streams.

返回
Maximum possible pixel value.

◆ getMinPixelValue()

int org.openni.VideoStream.getMinPixelValue ( )
inline

Provides the smallest possible value for pixels obtains by this VideoStream. This is most useful for getting the minimum possible value that will be reported by a depth stream.

返回
Minimum possible pixel value that can come from this stream.

◆ getMirroringEnabled()

boolean org.openni.VideoStream.getMirroringEnabled ( )
inline

Check whether mirroring is currently turned on for this stream.

返回
true if mirroring is currently enabled, false otherwise.

◆ getSensorInfo()

final SensorInfo org.openni.VideoStream.getSensorInfo ( )
inline

Provides the SensorInfo object associated with the sensor that is producing this VideoStream.

SensorInfo is useful primarily as a means of learning which video modes are valid for this VideoStream.

返回
SensorInfo object associated with the sensor providing this stream.

◆ getSensorType()

SensorType org.openni.VideoStream.getSensorType ( )
inline

Gets the sensor type for this stream.

返回
sensor type.

◆ getVerticalFieldOfView()

float org.openni.VideoStream.getVerticalFieldOfView ( )
inline

Gets the vertical field of view of frames received from this stream.

返回
Vertical field of view, in radians.

◆ getVideoMode()

final VideoMode org.openni.VideoStream.getVideoMode ( )
inline

Get the current video mode information for this video stream. This includes its resolution, fps and stream format.

返回
Current video mode information for this video stream.

◆ isCroppingSupported()

boolean org.openni.VideoStream.isCroppingSupported ( )
inline

Checks whether this stream supports cropping.

返回
true if the stream supports cropping, false if it does not.

◆ readFrame()

VideoFrameRef org.openni.VideoStream.readFrame ( )
inline

Read the next frame from this video stream, delivered as a VideoFrameRef. This is the primary method for manually obtaining frames of video data. If no new frame is available, the call will block until one is available. To avoid blocking, use NewFrameListener to implement an event driven architecture. Another alternative is to use OpenNI#waitForAnyStream(java.util.List, int) to wait for new frames from several streams

返回
VideoFrameRef object which hold the data of the new frame.

◆ removeNewFrameListener()

void org.openni.VideoStream.removeNewFrameListener ( NewFrameListener  streamListener)
inline

Removes a Listener from this video stream list. The listener removed will no longer receive new frame events from this stream.

参数
streamListenerObject of the listener to be removed.

◆ resetCropping()

void org.openni.VideoStream.resetCropping ( )
inline

Disables cropping.

◆ setCropping()

void org.openni.VideoStream.setCropping ( CropArea  cropping)
inline

Changes the cropping settings for this stream. You can use the isCroppingSupported() function to make sure cropping is supported before calling this function.

参数
croppingCropArea object which set corresponding cropping information.

◆ setMirroringEnabled()

void org.openni.VideoStream.setMirroringEnabled ( boolean  isEnabled)
inline

Enable or disable mirroring for this stream.

参数
isEnabledtrue to enable mirroring, false to disable it.

◆ setSoftFilter()

void org.openni.VideoStream.setSoftFilter ( SoftFilterType  softFilter)
inline

设置软件滤波

参数
softFilterCLOSE-> close;OPEN-> open

◆ setStreamDepthRotate()

void org.openni.VideoStream.setStreamDepthRotate ( int  enable)
inline

atlas depth rotate

参数
enable1-> enable Rotate,0-> unEnableRotate

◆ setStreamHoleFilter()

void org.openni.VideoStream.setStreamHoleFilter ( int  holeFilter)
inline

设置 HoleFilter「HoleFilter代表窗口滤波器的大小」

参数
holeFilter0->close HoleFilter 1-> 3*3,2-> 5*5,3-> 7*7,4-> 9*9

◆ setStreamInputFormat()

void org.openni.VideoStream.setStreamInputFormat ( StreamInputFormat  inputFormat)
inline

6.6设置Depth传输格式

参数
inputFormat2-> 10bit「atlas only」,3-> 11bit, 4-> 12bit

◆ setStreamMaxDepth()

void org.openni.VideoStream.setStreamMaxDepth ( int  maxDepth)
inline

设置 Depth 最大值

参数
maxDepthmax Depth

◆ setStreamMinDepth()

void org.openni.VideoStream.setStreamMinDepth ( int  minDepth)
inline

设置 Depth 最小值

参数
minDepthMin Depth

◆ setVideoMode()

void org.openni.VideoStream.setVideoMode ( VideoMode  videoMode)
inline

Changes the current video mode of this stream. Recommended practice is to use Device#getSensorInfo(SensorType), and then SensorInfo#getSupportedVideoModes() to obtain a list of valid video mode settings for this stream. Then, pass a valid VideoMode to setVideoMode(VideoMode) to ensure correct operation.

参数
videoModeDesired new video mode for this stream. returns Status code indicating success or failure of this operation.

◆ start()

void org.openni.VideoStream.start ( )
inline

Starts data generation from this video stream.

◆ stop()

void org.openni.VideoStream.stop ( )
inline

Stops data generation from this video stream.


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