Package org.robwork.sdurw
Class StereoCameraModel
- java.lang.Object
-
- org.robwork.sdurw_kinematics.Stateless
-
- org.robwork.sdurw.SensorModel
-
- org.robwork.sdurw.StereoCameraModel
-
public class StereoCameraModel extends SensorModel
The Camera class defines a general interface to a stereo camera.
A stereo camera consists of two cameras with the same intrinsic parameters,
but with different extrinsic parameters.
Since ideal cameras are assumed, the intrinsics are given as a horizontal/vertical
pixel resolution as well as a horizontal field of view (FOV).
The extrinsic parameters are given simply as two transformation matrices,
which give the pose of the cameras relative some external frame.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
StereoCameraModel.CalibrationFormat
output calibration file format for SaveCalibration()static class
StereoCameraModel.FOVDirection
FOV direction
-
Constructor Summary
Constructors Constructor Description StereoCameraModel(long cPtr, boolean cMemoryOwn)
StereoCameraModel(java.lang.String name, double fov, double width, double height, Transform3Dd TL, Transform3Dd TR, Frame frame)
constructorStereoCameraModel(java.lang.String name, double fov, double width, double height, Transform3Dd TL, Transform3Dd TR, Frame frame, java.lang.String modelInfo)
constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
delete()
static long
getCPtr(StereoCameraModel obj)
ImagePtr
getLeftImage(State state)
get left imageImagePtr
getRightImage(State state)
get right imagestatic boolean
SaveCalibration(java.lang.String filename, double fov, double wx, double wy, Transform3Dd TL, Transform3Dd TR)
utility function for saving a stereo calibration to a file
static boolean
SaveCalibration(java.lang.String filename, double fov, double wx, double wy, Transform3Dd TL, Transform3Dd TR, StereoCameraModel.FOVDirection direction)
utility function for saving a stereo calibration to a file
static boolean
SaveCalibration(java.lang.String filename, double fov, double wx, double wy, Transform3Dd TL, Transform3Dd TR, StereoCameraModel.FOVDirection direction, StereoCameraModel.CalibrationFormat format)
utility function for saving a stereo calibration to a file
void
setLeftImage(ImagePtr img, State state)
set left imagevoid
setRightImage(ImagePtr img, State state)
set right imagestatic void
WriteCalibration(SWIGTYPE_p_std__ostream os, double fov, double wx, double wy, Transform3Dd T)
utility function for writing a camera calibration to a stream
static void
WriteCalibration(SWIGTYPE_p_std__ostream os, double fov, double wx, double wy, Transform3Dd T, VectorDouble dist)
utility function for writing a camera calibration to a stream
static void
WriteCalibration(SWIGTYPE_p_std__ostream os, double fov, double wx, double wy, Transform3Dd T, VectorDouble dist, StereoCameraModel.FOVDirection direction)
utility function for writing a camera calibration to a stream
static void
WriteCalibration(SWIGTYPE_p_std__ostream os, double fov, double wx, double wy, Transform3Dd T, VectorDouble dist, StereoCameraModel.FOVDirection direction, StereoCameraModel.CalibrationFormat format)
utility function for writing a camera calibration to a stream
-
Methods inherited from class org.robwork.sdurw.SensorModel
attachTo, getCPtr, getDescription, getFrame, getName, getPropertyMap, setDescription, setName
-
Methods inherited from class org.robwork.sdurw_kinematics.Stateless
getCPtr, getStateStructure, isRegistered, registerIn, registerIn, unregister
-
-
-
-
Constructor Detail
-
StereoCameraModel
public StereoCameraModel(long cPtr, boolean cMemoryOwn)
-
StereoCameraModel
public StereoCameraModel(java.lang.String name, double fov, double width, double height, Transform3Dd TL, Transform3Dd TR, Frame frame, java.lang.String modelInfo)
constructor- Parameters:
name
- [in] name of sensorfov
- [in] horizontal field of viewwidth
- [in] width of imageheight
- [in] height of imageTL
- [in] transform from sensor frame to left camera frameTR
- [in] transform from sensor frame to right camera frameframe
- [in] sensor framemodelInfo
- [in] info string
-
StereoCameraModel
public StereoCameraModel(java.lang.String name, double fov, double width, double height, Transform3Dd TL, Transform3Dd TR, Frame frame)
constructor- Parameters:
name
- [in] name of sensorfov
- [in] horizontal field of viewwidth
- [in] width of imageheight
- [in] height of imageTL
- [in] transform from sensor frame to left camera frameTR
- [in] transform from sensor frame to right camera frameframe
- [in] sensor frame
-
-
Method Detail
-
getCPtr
public static long getCPtr(StereoCameraModel obj)
-
delete
public void delete()
- Overrides:
delete
in classSensorModel
-
SaveCalibration
public static boolean SaveCalibration(java.lang.String filename, double fov, double wx, double wy, Transform3Dd TL, Transform3Dd TR, StereoCameraModel.FOVDirection direction, StereoCameraModel.CalibrationFormat format)
utility function for saving a stereo calibration to a file
- Parameters:
filename
- [in] file to save tofov
- [in] field of view (FOV) [rad]wx
- [in] horizontal pixelswy
- [in] vertical pixelsTL
- [in] transformation of left camera frameTR
- [in] transformation of right camera framedirection
- [in] the direction of the specified FOVformat
- [in] calibration file format to use- Returns:
- true if the file was successfully saved, false otherwise
-
SaveCalibration
public static boolean SaveCalibration(java.lang.String filename, double fov, double wx, double wy, Transform3Dd TL, Transform3Dd TR, StereoCameraModel.FOVDirection direction)
utility function for saving a stereo calibration to a file
- Parameters:
filename
- [in] file to save tofov
- [in] field of view (FOV) [rad]wx
- [in] horizontal pixelswy
- [in] vertical pixelsTL
- [in] transformation of left camera frameTR
- [in] transformation of right camera framedirection
- [in] the direction of the specified FOV
- Returns:
- true if the file was successfully saved, false otherwise
-
SaveCalibration
public static boolean SaveCalibration(java.lang.String filename, double fov, double wx, double wy, Transform3Dd TL, Transform3Dd TR)
utility function for saving a stereo calibration to a file
- Parameters:
filename
- [in] file to save tofov
- [in] field of view (FOV) [rad]wx
- [in] horizontal pixelswy
- [in] vertical pixelsTL
- [in] transformation of left camera frameTR
- [in] transformation of right camera frame
- Returns:
- true if the file was successfully saved, false otherwise
-
WriteCalibration
public static void WriteCalibration(SWIGTYPE_p_std__ostream os, double fov, double wx, double wy, Transform3Dd T, VectorDouble dist, StereoCameraModel.FOVDirection direction, StereoCameraModel.CalibrationFormat format)
utility function for writing a camera calibration to a stream
- Parameters:
os
- the stream to write tofov
- field of view (FOV) [rad]wx
- horizontal pixelswy
- vertical pixelsT
- [in] transformation of the camera framedist
- [in] distortion parametersdirection
- [in] the direction of the specified FOVformat
- [in] calibration file format to use
-
WriteCalibration
public static void WriteCalibration(SWIGTYPE_p_std__ostream os, double fov, double wx, double wy, Transform3Dd T, VectorDouble dist, StereoCameraModel.FOVDirection direction)
utility function for writing a camera calibration to a stream
- Parameters:
os
- the stream to write tofov
- field of view (FOV) [rad]wx
- horizontal pixelswy
- vertical pixelsT
- [in] transformation of the camera framedist
- [in] distortion parametersdirection
- [in] the direction of the specified FOV
-
WriteCalibration
public static void WriteCalibration(SWIGTYPE_p_std__ostream os, double fov, double wx, double wy, Transform3Dd T, VectorDouble dist)
utility function for writing a camera calibration to a stream
- Parameters:
os
- the stream to write tofov
- field of view (FOV) [rad]wx
- horizontal pixelswy
- vertical pixelsT
- [in] transformation of the camera framedist
- [in] distortion parameters
-
WriteCalibration
public static void WriteCalibration(SWIGTYPE_p_std__ostream os, double fov, double wx, double wy, Transform3Dd T)
utility function for writing a camera calibration to a stream
- Parameters:
os
- the stream to write tofov
- field of view (FOV) [rad]wx
- horizontal pixelswy
- vertical pixelsT
- [in] transformation of the camera frame
-
-