dlr::computerVision::CameraIntrinsicsPlumbBob Class Reference

This class represents calibration parameters for cameras conforming to Brown-Conrady "plumb bob" camera model, as described in [1]. More...

#include <cameraIntrinsicsPlumbBob.h>

Inheritance diagram for dlr::computerVision::CameraIntrinsicsPlumbBob:
[legend]
Collaboration diagram for dlr::computerVision::CameraIntrinsicsPlumbBob:
[legend]

List of all members.

Public Member Functions

 CameraIntrinsicsPlumbBob ()
 The default constructor initializes the CameraIntrinsicsPlumbBob instance to a consistent (but not terribly useful) state.
 CameraIntrinsicsPlumbBob (size_t numPixelsX, size_t numPixelsY, double focalLengthX, double focalLengthY, double centerU, double centerV, double skewCoefficient, double radialCoefficient0, double radialCoefficient1, double radialCoefficient2, double tangentialCoefficient0, double tangentialCoefficient1)
 This constructor allows the caller to explicitly set the camera intrinsic parameters.
virtual ~CameraIntrinsicsPlumbBob ()
 Destructor.
double getCenterU () const
 This member function provides access to the value of parameter centerU, as described in the constructor documentation.
double getCenterV () const
 This member function provides access to the value of parameter centerV, as described in the constructor documentation.
double getFocalLengthX () const
 This member function provides access to the value of parameter focalLengthX, as described in the constructor documentation.
double getFocalLengthY () const
 This member function provides access to the value of parameter focalLengthY, as described in the constructor documentation.
virtual size_t getNumPixelsX () const
 This member function returns the number of columns in images produced by the camera corresponding to *this.
virtual size_t getNumPixelsY () const
 This member function returns the number of rows in images produced by the camera corresponding to *this.
double getRadialCoefficient0 () const
 This member function provides access to the value of parameter radialCoefficient0, as described in the constructor documentation.
double getRadialCoefficient1 () const
 This member function provides access to the value of parameter radialCoefficient1, as described in the constructor documentation.
double getRadialCoefficient2 () const
 This member function provides access to the value of parameter radialCoefficient2, as described in the constructor documentation.
double getSkewCoefficient () const
 This member function provides access to the value of parameter skewCoefficient, as described in the constructor documentation.
double getTangentialCoefficient0 () const
 This member function provides access to the value of parameter tangentialCoefficient0, as described in the constructor documentation.
double getTangentialCoefficient1 () const
 This member function provides access to the value of parameter tangentialCoefficient1, as described in the constructor documentation.
virtual dlr::numeric::Vector2D project (const dlr::numeric::Vector3D &point) const
 This member function takes a point in 3D camera coordinates and projects it into pixel coordinates.
std::istream & readFromStream (std::istream &inputStream)
 This member function sets the calibration from an input stream.
virtual dlr::geometry::Ray3D reverseProject (const dlr::numeric::Vector2D &pixelPosition, bool normalize=true) const
 This member function takes a point in 2D pixel coordinates and computes a ray in 3D camera coordinates passing through all of the 3D points that project to the specified 2D position.
std::ostream & writeToStream (std::ostream &outputStream) const
 This member function writes the calibration to an outputstream in a format which is compatible with member function readFromStream().
virtual geometry::Ray3D reverseProject (const dlr::numeric::Index2D &pixelPosition, bool normalize=true) const
 This function returns a ray in 3D camera coordinates starting at the camera focus, and passing through the center of the specified pixel.

Protected Member Functions

void projectWithPartialDerivatives (double xNorm, double yNorm, double &uValue, double &vValue, double &dUdX, double &dUdY, double &dVdX, double &dVdY) const

Protected Attributes

double m_centerU
double m_centerV
double m_kX
double m_kY
size_t m_numPixelsX
size_t m_numPixelsY
double m_radialCoefficient0
double m_radialCoefficient1
double m_radialCoefficient2
double m_skewCoefficient
double m_tangentialCoefficient0
double m_tangentialCoefficient1

Friends

class privateCode::PlumbBobObjective


Detailed Description

This class represents calibration parameters for cameras conforming to Brown-Conrady "plumb bob" camera model, as described in [1].

This is the intrinsic model used by the Matlab camera calibration toolbox.

Our representation differs from the matlab convention in two respects. The first difference is that the order of distortion coefficients in the constructor arguments differs slightly from the order used by the toolbox. This first difference is described in the constructor documentation. The second difference is that matlab places the pixel coordinate (0, 0) in the center of the upper left pixel of the image, whereas we place (0, 0) at the upper left corner of the upper left pixel of the image. In practice, you can often neglect this second difference because it is dominated by uncertainty in the principal point (centerU, centerV). If you want to be absolutely correct, just modify constructor arguments as described in the constructor documentation.

In our implementation, we continue to use the two coordinate systems described in the CameraIntrinsicsPinhole class documentation: the 3D camera coordinate system, and the 2D pixel coordinate system. Note that distortion parameters are applied in a third coordinate system: a physical 2D coordinate system coincident with the image plane. The CameraIntrinsicsPlumbBob interface provides no access to this third coordinate system, so you can just ignore it.

[1] D.C. Brown, Decentering Distortion of Lenses. Photometric Engineering, pp. 444-462, Vol. 32, No. 3, 1966.

Definition at line 68 of file cameraIntrinsicsPlumbBob.h.


Constructor & Destructor Documentation

dlr::computerVision::CameraIntrinsicsPlumbBob::CameraIntrinsicsPlumbBob (  ) 

The default constructor initializes the CameraIntrinsicsPlumbBob instance to a consistent (but not terribly useful) state.

Definition at line 42 of file cameraIntrinsicsPlumbBob.cpp.

dlr::computerVision::CameraIntrinsicsPlumbBob::CameraIntrinsicsPlumbBob ( size_t  numPixelsX,
size_t  numPixelsY,
double  focalLengthX,
double  focalLengthY,
double  centerU,
double  centerV,
double  skewCoefficient,
double  radialCoefficient0,
double  radialCoefficient1,
double  radialCoefficient2,
double  tangentialCoefficient0,
double  tangentialCoefficient1 
)

This constructor allows the caller to explicitly set the camera intrinsic parameters.

Parameters:
numPixelsX This argument specifies how many columns there are in the camera images.
numPixelsY This argument specifies how many rows there are in the camera images.
focalLengthX This argument the distance from the camera focus to the image plane, expressed in pixel-width sized units. Generally this number should be positive, indicating that the the image plane lies at a positive Z coordinate in the 3D camera coordinate frame.
focalLengthY This argument the distance from the camera focus to the image plane, expressed in pixel-height sized units. Generally this number should be positive, indicating that the the image plane lies at a positive Z coordinate in the 3D camera coordinate frame.
centerU This argument and the next specify the position in pixel coordinates at which the Z axis passes through the image plane. If you are calling the constructor using parameters computed by matlab, add 0.5 to matlab's first principal point value to get the correct value for this argument (see the documentation for CameraIntrinsicsPlumbBob for more information).
centerV This argument and the previous specify the position in pixel coordinates at which the Z axis passes through the image plane. If you are calling the construtor using parameters computed by matlab, add 0.5 to matlab's second principal point value to get the correct value for this argument (see the documentation for CameraIntrinsicsPlumbBob for more information).
skewCoefficient This argument specifies any deviation from squareness in the pixel grid. For most modern cameras, this parameter will be zero. Specifically, skewCoefficient is the cosine of the angle between the x and y axes, where the nominal angle is positive pi/2 radians.
radialCoefficient0 This argument specifies the quadratic term of the radial distortion model. It corresponds to kc(1) in the matlab representation.
radialCoefficient1 This argument specifies the 4th power term of the radial distortion model. It corresponds to kc(2) in the matlab representation.
radialCoefficient2 This argument specifies the 6th power term of the radial distortion model. It corresponds to kc(5) in the matlab representation.
tangentialCoefficient0 This argument specifies the first term of the tangential distortion model. It corresponds to kc(3) in the matlab representation.
tangentialCoefficient1 This argument specifies the second term of the tangential distortion model. It corresponds to kc(4) in the matlab representation.

Definition at line 64 of file cameraIntrinsicsPlumbBob.cpp.

virtual dlr::computerVision::CameraIntrinsicsPlumbBob::~CameraIntrinsicsPlumbBob (  )  [inline, virtual]

Destructor.

Definition at line 165 of file cameraIntrinsicsPlumbBob.h.


Member Function Documentation

double dlr::computerVision::CameraIntrinsicsPlumbBob::getCenterU (  )  const [inline]

This member function provides access to the value of parameter centerU, as described in the constructor documentation.

Returns:
The return value is the requested parameter.

Definition at line 176 of file cameraIntrinsicsPlumbBob.h.

double dlr::computerVision::CameraIntrinsicsPlumbBob::getCenterV (  )  const [inline]

This member function provides access to the value of parameter centerV, as described in the constructor documentation.

Returns:
The return value is the requested parameter.

Definition at line 187 of file cameraIntrinsicsPlumbBob.h.

double dlr::computerVision::CameraIntrinsicsPlumbBob::getFocalLengthX (  )  const [inline]

This member function provides access to the value of parameter focalLengthX, as described in the constructor documentation.

Returns:
The return value is the requested parameter.

Definition at line 198 of file cameraIntrinsicsPlumbBob.h.

double dlr::computerVision::CameraIntrinsicsPlumbBob::getFocalLengthY (  )  const [inline]

This member function provides access to the value of parameter focalLengthY, as described in the constructor documentation.

Returns:
The return value is the requested parameter.

Definition at line 209 of file cameraIntrinsicsPlumbBob.h.

virtual size_t dlr::computerVision::CameraIntrinsicsPlumbBob::getNumPixelsX (  )  const [inline, virtual]

This member function returns the number of columns in images produced by the camera corresponding to *this.

Returns:
The return value is the number of pixels in each image row.

Definition at line 220 of file cameraIntrinsicsPlumbBob.h.

virtual size_t dlr::computerVision::CameraIntrinsicsPlumbBob::getNumPixelsY (  )  const [inline, virtual]

This member function returns the number of rows in images produced by the camera corresponding to *this.

Returns:
The return value is the number of pixels in each image column.

Definition at line 231 of file cameraIntrinsicsPlumbBob.h.

double dlr::computerVision::CameraIntrinsicsPlumbBob::getRadialCoefficient0 (  )  const [inline]

This member function provides access to the value of parameter radialCoefficient0, as described in the constructor documentation.

Returns:
The return value is the requested parameter.

Definition at line 242 of file cameraIntrinsicsPlumbBob.h.

double dlr::computerVision::CameraIntrinsicsPlumbBob::getRadialCoefficient1 (  )  const [inline]

This member function provides access to the value of parameter radialCoefficient1, as described in the constructor documentation.

Returns:
The return value is the requested parameter.

Definition at line 253 of file cameraIntrinsicsPlumbBob.h.

double dlr::computerVision::CameraIntrinsicsPlumbBob::getRadialCoefficient2 (  )  const [inline]

This member function provides access to the value of parameter radialCoefficient2, as described in the constructor documentation.

Returns:
The return value is the requested parameter.

Definition at line 264 of file cameraIntrinsicsPlumbBob.h.

double dlr::computerVision::CameraIntrinsicsPlumbBob::getSkewCoefficient (  )  const [inline]

This member function provides access to the value of parameter skewCoefficient, as described in the constructor documentation.

Returns:
The return value is the requested parameter.

Definition at line 275 of file cameraIntrinsicsPlumbBob.h.

double dlr::computerVision::CameraIntrinsicsPlumbBob::getTangentialCoefficient0 (  )  const [inline]

This member function provides access to the value of parameter tangentialCoefficient0, as described in the constructor documentation.

Returns:
The return value is the requested parameter.

Definition at line 286 of file cameraIntrinsicsPlumbBob.h.

double dlr::computerVision::CameraIntrinsicsPlumbBob::getTangentialCoefficient1 (  )  const [inline]

This member function provides access to the value of parameter tangentialCoefficient1, as described in the constructor documentation.

Returns:
The return value is the requested parameter.

Definition at line 297 of file cameraIntrinsicsPlumbBob.h.

virtual dlr::numeric::Vector2D dlr::computerVision::CameraIntrinsicsPlumbBob::project ( const dlr::numeric::Vector3D &  point  )  const [virtual]

This member function takes a point in 3D camera coordinates and projects it into pixel coordinates.

Parameters:
point This argument specifies the 3D point to be projected.
Returns:
The return value gives the point in pixel coordinates to which the input point will project.

Implements dlr::computerVision::CameraIntrinsics.

std::istream & dlr::computerVision::CameraIntrinsicsPlumbBob::readFromStream ( std::istream &  inputStream  ) 

This member function sets the calibration from an input stream.

*this is modified only if the read was successful, otherwise it is not modified, and failbit is set in the stream state.

Parameters:
inputStream This is the stream from which to read the data.
Returns:
The return value is a reference to inputStream.

Definition at line 138 of file cameraIntrinsicsPlumbBob.cpp.

Referenced by dlr::computerVision::operator>>().

dlr::geometry::Ray3D dlr::computerVision::CameraIntrinsics::reverseProject ( const dlr::numeric::Index2D &  pixelPosition,
bool  normalize = true 
) const [inline, virtual, inherited]

This function returns a ray in 3D camera coordinates starting at the camera focus, and passing through the center of the specified pixel.

Parameters:
pixelPosition This argument is the pixel through which the ray should pass.
normalize This argument indicates whether the ray should be normalized to unit length before being returned.
Returns:
The return value is the resulting ray.

Definition at line 131 of file cameraIntrinsics.h.

virtual dlr::geometry::Ray3D dlr::computerVision::CameraIntrinsicsPlumbBob::reverseProject ( const dlr::numeric::Vector2D &  pixelPosition,
bool  normalize = true 
) const [virtual]

This member function takes a point in 2D pixel coordinates and computes a ray in 3D camera coordinates passing through all of the 3D points that project to the specified 2D position.

We don't currently have a closed form solution, so this member function runs an iterative approximation.

Parameters:
pixelPosition This argument is the point to be projected out into 3D camera coordinates.
normalize This argument indicates whether the returned vector should be normalized to unit length. Setting this to false saves a few arithmetic operations. Note that reverse projection is quite expensive for this camera model, so this savings is insignificant.
Returns:
The return value is the ray in 3D camera coordinates corresponding to the input 2D point.

Implements dlr::computerVision::CameraIntrinsics.

std::ostream & dlr::computerVision::CameraIntrinsicsPlumbBob::writeToStream ( std::ostream &  outputStream  )  const

This member function writes the calibration to an outputstream in a format which is compatible with member function readFromStream().

Parameters:
outputStream This is the stream to which to write the data.
Returns:
The return value is a reference to outputStream.

Definition at line 263 of file cameraIntrinsicsPlumbBob.cpp.

Referenced by dlr::computerVision::operator<<().


The documentation for this class was generated from the following files:

Generated on Wed Nov 25 12:15:09 2009 for dlrComputerVision Utility Library by  doxygen 1.5.8