|
| OpenCVCamera () |
| Initialize the camera with the settings for the Kinect. More...
|
|
| OpenCVCamera (uint imageWidth_in, uint imageHeight_in, Quaternion rot_in, Vector3D trans_in, double fx_in, double fy_in, double cx_in, double cy_in, double k1_in, double k2_in, double p1_in, double p2_in, double k3_in) |
|
Point3D | project (Point3D p_world) |
| Takes a world space point and projects it to the image plane. More...
|
|
Point3D | worldToCamera (Point3D p_world) |
| Takes a world space point and transforms it into camera space. More...
|
|
Point3D | cameraToImage (Point3D p_camera) |
| Takes a point in camera space and transforms it to the image plane. More...
|
|
|
Vector3D | Translation [get, set] |
| The position component of the extrinsics matrix. More...
|
|
Quaternion | Rotation [get, set] |
| The rotation component of the extrinsics matrix. More...
|
|
uint | ImageWidth [get, set] |
| The width of the depth image, in pixels. More...
|
|
uint | ImageHeight [get, set] |
| The height of the depth image, in pixels. More...
|
|
|
double | Fx [get, set] |
| x focal length (in pixels). More...
|
|
double | Fy [get, set] |
| y focal length (in pixels). More...
|
|
|
double | Cx [get, set] |
| Camera center x coordinate (in pixels, from left). More...
|
|
double | Cy [get, set] |
| Camera center y coordinate (in pixels, from top). More...
|
|
double | K1 [get, set] |
| Radial distortion quadratic term. More...
|
|
double | K2 [get, set] |
| Radial distortion r^4 term. More...
|
|
double | K3 [get, set] |
| Radial distortion r^6 term. More...
|
|
double | P1 [get, set] |
| Tangential distortion term More...
|
|
double | P2 [get, set] |
| Tangential distortion quadratic term. More...
|
|
A class representing the intrinsic/extrinsic parameters of the depth camera.
Our camera model is identical to the one used in OpenCV (and in OpenNI). A full description can be found here: http://docs.opencv.org/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html
The extrinsic matrix is set up such that world space corresponds to the desk frame used in hand tracking, with y pointing up and z pointing toward the user.
Everything here will be in double precision, because this is necessary for dealing robustly with distortion (some distortion terms use the 6th power of the radius, which would cause precision loss when working with 32-bit floats).
One possible gotcha: in OpenCV camera space, the coordinate system has the positive z vector pointing into the frame and the positive y vector pointing down from the top of the image. Note that this is flipped from OpenGL (where the negative z vector points into the frame).
This class includes the worldToCamera and cameraToImage functions for projecting a world space point down to the image plane. Because inverting camera distortion is considerably complicated, the inverses of these functions are not provided. If you need undistortion functionality, you can find it within OpenCV; take a look at the undistortPoints function.