public class CoordinateConverter
extends java.lang.Object
VideoStream
object must be provided to these
functions. The VideoStream
object is used to determine parameters for the specific points
to be converted.
Since Depth coordinates are a projective, the apparent size of objects in depth coordinates
(measured in pixels) will increase as an object moves closer to the sensor. The size of objects
in the World coordinate system is independent of distance from the sensor.
Note that converting from Depth to World coordinates is relatively expensive computationally. It
is generally not practical to convert the entire raw depth map to World coordinates. A better
approach is to have your computer vision algorithm work in Depth coordinates for as long as
possible, and only converting a few specific points to World coordinates right before output.
Note that when converting from Depth to World or vice versa, the Z value remains the same.Constructor and Description |
---|
CoordinateConverter() |
Modifier and Type | Method and Description |
---|---|
static Point2D<java.lang.Integer> |
convertDepthToColor(VideoStream depthStream,
VideoStream colorStream,
int depthX,
int depthY,
short depthZ)
For a given depth point, provides the coordinates of the corresponding color value.
|
static Point3D<java.lang.Float> |
convertDepthToWorld(VideoStream depthStream,
float depthX,
float depthY,
float depthZ)
Converts a single point from a floating point representation of the Depth coordinate system to
the World coordinate system.
|
static Point3D<java.lang.Float> |
convertDepthToWorld(VideoStream depthStream,
int depthX,
int depthY,
short depthZ)
Converts a single point from the Depth coordinate system to the World coordinate system.
|
static Point3D<java.lang.Float> |
convertWorldToDepthFloat(VideoStream depthStream,
float worldX,
float worldY,
float worldZ)
Converts a single point from the World coordinate system to a floating point representation of
the Depth coordinate system
|
static Point3D<java.lang.Integer> |
convertWorldToDepthInt(VideoStream depthStream,
float worldX,
float worldY,
float worldZ)
Converts a single point from the World coordinate system to the Depth coordinate system.
|
public static Point3D<java.lang.Integer> convertWorldToDepthInt(VideoStream depthStream, float worldX, float worldY, float worldZ)
depthStream
- Reference to an openni::VideoStream that will be used to determine the
format of the Depth coordinatesworldX
- The X coordinate of the point to be converted, measured in millimeters in World
coordinatesworldY
- The Y coordinate of the point to be converted, measured in millimeters in World
coordinatesworldZ
- The Z coordinate of the point to be converted, measured in millimeters in World
coordinatesPixelFormat
of depthStreampublic static Point3D<java.lang.Float> convertWorldToDepthFloat(VideoStream depthStream, float worldX, float worldY, float worldZ)
depthStream
- Reference to an openni::VideoStream that will be used to determine the
format of the Depth coordinatesworldX
- The X coordinate of the point to be converted, measured in millimeters in World
coordinatesworldY
- The Y coordinate of the point to be converted, measured in millimeters in World
coordinatesworldZ
- The Z coordinate of the point to be converted, measured in millimeters in World
coordinates
public static Point3D<java.lang.Float> convertDepthToWorld(VideoStream depthStream, int depthX, int depthY, short depthZ)
depthStream
- Reference to an VideoStream
that will be used to determine the
format of the Depth coordinatesdepthX
- The X coordinate of the point to be converted, measured in pixels with 0 at the
far left of the imagedepthY
- The Y coordinate of the point to be converted, measured in pixels with 0 at the
top of the imagedepthZ
- the Z(depth) coordinate of the point to be converted, measured in the
PixelFormat
of depthStreampublic static Point3D<java.lang.Float> convertDepthToWorld(VideoStream depthStream, float depthX, float depthY, float depthZ)
depthStream
- Reference to an openni::VideoStream that will be used to determine the
format of the Depth coordinatesdepthX
- The X coordinate of the point to be converted, measured in pixels with 0.0 at the
far left of the imagedepthY
- The Y coordinate of the point to be converted, measured in pixels with 0.0 at the
top of the imagedepthZ
- Z(depth) coordinate of the point to be converted, measured in the
PixelFormat
of depthStreampublic static Point2D<java.lang.Integer> convertDepthToColor(VideoStream depthStream, VideoStream colorStream, int depthX, int depthY, short depthZ)
depthStream
- Reference to a openni::VideoStream that produced the depth valuecolorStream
- Reference to a openni::VideoStream that we want to find the appropriate
color pixel indepthX
- value of the depth point, given in Depth coordinates and measured in pixelsdepthY
- value of the depth point, given in Depth coordinates and measured in pixelsdepthZ
- value of the depth point, given in the PixelFormat
of depthStream