Medical Imaging Interaction Toolkit  2018.4.99-bd7b41ba
Medical Imaging Interaction Toolkit
mitk::CameraIntrinsics Class Reference

class representing camera intrinsics and related functions More...

#include <mitkCameraIntrinsics.h>

Inheritance diagram for mitk::CameraIntrinsics:
Collaboration diagram for mitk::CameraIntrinsics:

Public Member Functions

 mitkClassMacroItkParent (CameraIntrinsics, itk::Object)
 
Pointer Clone () const
 
void Copy (const CameraIntrinsics *other)
 
bool Equals (const CameraIntrinsics *other) const
 
vnl_matrix_fixed< mitk::ScalarType, 3, 3 > GetVnlCameraMatrix () const
 
vnl_matrix_fixed< mitk::ScalarType, 3, 4 > GetVnlCameraMatrix3x4 () const
 
bool IsValid () const
 
void SetValid (bool valid)
 
cv::Mat GetCameraMatrix () const
 
cv::Mat GetDistorsionCoeffs ()
 
cv::Mat GetDistorsionCoeffs () const
 
void ToXML (TiXmlElement *elem) const override
 
std::string ToString () const
 
std::string GetString ()
 
double GetFocalLengthX () const
 
double GetFocalLengthY () const
 
double GetPrincipalPointX () const
 
double GetPrincipalPointY () const
 
mitk::Point4D GetDistorsionCoeffsAsPoint4D () const
 
mitk::Point3D GetFocalPoint () const
 
mitk::Point3D GetPrincipalPoint () const
 
vnl_vector_fixed< mitk::ScalarType, 2 > GetFocalPointAsVnlVector () const
 
vnl_vector_fixed< mitk::ScalarType, 2 > GetPrincipalPointAsVnlVector () const
 
void SetCameraMatrix (const vnl_matrix_fixed< mitk::ScalarType, 3, 3 > &_CameraMatrix)
 
void SetIntrinsics (const cv::Mat &_CameraMatrix, const cv::Mat &_DistorsionCoeffs)
 
void SetFocalLength (double x, double y)
 
void SetPrincipalPoint (double x, double y)
 
void SetDistorsionCoeffs (double k1, double k2, double p1, double p2)
 
void SetIntrinsics (const mitk::Point3D &focalPoint, const mitk::Point3D &principalPoint, const mitk::Point4D &distortionCoefficients)
 
void FromXML (TiXmlElement *elem) override
 
void FromGMLCalibrationXML (TiXmlElement *elem)
 
std::string ToOctaveString (const std::string &varName="CameraIntrinsics")
 
 ~CameraIntrinsics () override
 
- Public Member Functions inherited from mitk::XMLSerializable
virtual const char * GetNameOfClass () const =0
 
virtual void ToXMLFile (const std::string &file, const std::string &elemName="")
 
virtual void FromXMLFile (const std::string &file, const std::string &elemName="")
 
std::string GetXMLFileName () const
 

Static Public Member Functions

static Pointer New ()
 

Protected Member Functions

 CameraIntrinsics ()
 
 CameraIntrinsics (const CameraIntrinsics &other)
 

Protected Attributes

cv::Mat m_CameraMatrix
 
cv::Mat m_DistorsionCoeffs
 
bool m_Valid
 
itk::FastMutexLock::Pointer m_Mutex
 

Friends

int mitkCameraIntrinsicsTest (int argc, char *argv[])
 

Additional Inherited Members

- Static Public Attributes inherited from mitk::XMLSerializable
static const std::string FILE_REFERENCE_ATTRIBUTE_NAME
 
static const std::string ROOT_NAME
 

Detailed Description

class representing camera intrinsics and related functions

Definition at line 34 of file mitkCameraIntrinsics.h.

Constructor & Destructor Documentation

◆ ~CameraIntrinsics()

mitk::CameraIntrinsics::~CameraIntrinsics ( )
override

Definition at line 35 of file mitkCameraIntrinsics.cpp.

◆ CameraIntrinsics() [1/2]

mitk::CameraIntrinsics::CameraIntrinsics ( )
protected

Definition at line 18 of file mitkCameraIntrinsics.cpp.

References m_CameraMatrix, and m_DistorsionCoeffs.

◆ CameraIntrinsics() [2/2]

mitk::CameraIntrinsics::CameraIntrinsics ( const CameraIntrinsics other)
protected

Definition at line 26 of file mitkCameraIntrinsics.cpp.

References Copy().

Member Function Documentation

◆ Clone()

Pointer mitk::CameraIntrinsics::Clone ( ) const

make a clone of this intrinsics

◆ Copy()

void mitk::CameraIntrinsics::Copy ( const CameraIntrinsics other)

copy information from other to this

Definition at line 50 of file mitkCameraIntrinsics.cpp.

References GetCameraMatrix(), GetDistorsionCoeffs(), m_Valid, SetIntrinsics(), and SetValid().

Referenced by CameraIntrinsics().

◆ Equals()

bool mitk::CameraIntrinsics::Equals ( const CameraIntrinsics other) const

checks two intrinsics for equality

Definition at line 40 of file mitkCameraIntrinsics.cpp.

References GetDistorsionCoeffsAsPoint4D(), GetFocalPoint(), and GetPrincipalPoint().

◆ FromGMLCalibrationXML()

void mitk::CameraIntrinsics::FromGMLCalibrationXML ( TiXmlElement *  elem)

Definition at line 248 of file mitkCameraIntrinsics.cpp.

References endoAssert, m_CameraMatrix, m_DistorsionCoeffs, m_Mutex, and m_Valid.

Referenced by FromXML().

◆ FromXML()

void mitk::CameraIntrinsics::FromXML ( TiXmlElement *  elem)
overridevirtual

◆ GetCameraMatrix()

cv::Mat mitk::CameraIntrinsics::GetCameraMatrix ( ) const

Definition at line 179 of file mitkCameraIntrinsics.cpp.

References m_CameraMatrix, and m_Mutex.

Referenced by Copy().

◆ GetDistorsionCoeffs() [1/2]

cv::Mat mitk::CameraIntrinsics::GetDistorsionCoeffs ( )

Definition at line 191 of file mitkCameraIntrinsics.cpp.

References GetDistorsionCoeffs().

Referenced by Copy(), and GetDistorsionCoeffs().

◆ GetDistorsionCoeffs() [2/2]

cv::Mat mitk::CameraIntrinsics::GetDistorsionCoeffs ( ) const

Definition at line 185 of file mitkCameraIntrinsics.cpp.

References m_DistorsionCoeffs, and m_Mutex.

◆ GetDistorsionCoeffsAsPoint4D()

mitk::Point4D mitk::CameraIntrinsics::GetDistorsionCoeffsAsPoint4D ( ) const

Definition at line 425 of file mitkCameraIntrinsics.cpp.

References m_DistorsionCoeffs, and m_Mutex.

Referenced by Equals().

◆ GetFocalLengthX()

double mitk::CameraIntrinsics::GetFocalLengthX ( ) const

Definition at line 400 of file mitkCameraIntrinsics.cpp.

References m_CameraMatrix, and m_Mutex.

Referenced by GetFocalPoint(), GetFocalPointAsVnlVector(), and ToOctaveString().

◆ GetFocalLengthY()

double mitk::CameraIntrinsics::GetFocalLengthY ( ) const

Definition at line 407 of file mitkCameraIntrinsics.cpp.

References m_CameraMatrix, and m_Mutex.

Referenced by GetFocalPoint(), GetFocalPointAsVnlVector(), and ToOctaveString().

◆ GetFocalPoint()

mitk::Point3D mitk::CameraIntrinsics::GetFocalPoint ( ) const

Definition at line 438 of file mitkCameraIntrinsics.cpp.

References GetFocalLengthX(), and GetFocalLengthY().

Referenced by Equals().

◆ GetFocalPointAsVnlVector()

vnl_vector_fixed< mitk::ScalarType, 2 > mitk::CameraIntrinsics::GetFocalPointAsVnlVector ( ) const

Definition at line 457 of file mitkCameraIntrinsics.cpp.

References GetFocalLengthX(), and GetFocalLengthY().

◆ GetPrincipalPoint()

mitk::Point3D mitk::CameraIntrinsics::GetPrincipalPoint ( ) const

Definition at line 447 of file mitkCameraIntrinsics.cpp.

References GetPrincipalPointX(), and GetPrincipalPointY().

Referenced by Equals().

◆ GetPrincipalPointAsVnlVector()

vnl_vector_fixed< mitk::ScalarType, 2 > mitk::CameraIntrinsics::GetPrincipalPointAsVnlVector ( ) const

Definition at line 466 of file mitkCameraIntrinsics.cpp.

References GetPrincipalPointX(), and GetPrincipalPointY().

◆ GetPrincipalPointX()

double mitk::CameraIntrinsics::GetPrincipalPointX ( ) const

◆ GetPrincipalPointY()

double mitk::CameraIntrinsics::GetPrincipalPointY ( ) const

◆ GetString()

std::string mitk::CameraIntrinsics::GetString ( )

Definition at line 480 of file mitkCameraIntrinsics.cpp.

References ToString().

◆ GetVnlCameraMatrix()

vnl_matrix_fixed< mitk::ScalarType, 3, 3 > mitk::CameraIntrinsics::GetVnlCameraMatrix ( ) const
Returns
the intrinsic parameter matrix as a 3x3 vnl matrix

Definition at line 64 of file mitkCameraIntrinsics.cpp.

References m_CameraMatrix, and m_Mutex.

Referenced by GetVnlCameraMatrix3x4().

◆ GetVnlCameraMatrix3x4()

vnl_matrix_fixed< mitk::ScalarType, 3, 4 > mitk::CameraIntrinsics::GetVnlCameraMatrix3x4 ( ) const
Returns
the intrinsic parameter matrix as a 3x4 vnl matrix (the last column only containing zeros)

Definition at line 93 of file mitkCameraIntrinsics.cpp.

References GetVnlCameraMatrix().

◆ IsValid()

bool mitk::CameraIntrinsics::IsValid ( ) const
Returns
true if the intrinsics are set (some plausibility checks may be done here)

Definition at line 57 of file mitkCameraIntrinsics.cpp.

References m_Mutex, and m_Valid.

◆ mitkClassMacroItkParent()

mitk::CameraIntrinsics::mitkClassMacroItkParent ( CameraIntrinsics  ,
itk::Object   
)

smartpointer typedefs

◆ New()

◆ SetCameraMatrix()

void mitk::CameraIntrinsics::SetCameraMatrix ( const vnl_matrix_fixed< mitk::ScalarType, 3, 3 > &  _CameraMatrix)

set a new camera matrix utilizing a vnl matrix

Definition at line 81 of file mitkCameraIntrinsics.cpp.

References m_CameraMatrix, and m_Mutex.

◆ SetDistorsionCoeffs()

void mitk::CameraIntrinsics::SetDistorsionCoeffs ( double  k1,
double  k2,
double  p1,
double  p2 
)

Definition at line 164 of file mitkCameraIntrinsics.cpp.

References m_DistorsionCoeffs, and m_Mutex.

◆ SetFocalLength()

void mitk::CameraIntrinsics::SetFocalLength ( double  x,
double  y 
)

Definition at line 144 of file mitkCameraIntrinsics.cpp.

References m_CameraMatrix, and m_Mutex.

◆ SetIntrinsics() [1/2]

void mitk::CameraIntrinsics::SetIntrinsics ( const cv::Mat &  _CameraMatrix,
const cv::Mat &  _DistorsionCoeffs 
)

Definition at line 102 of file mitkCameraIntrinsics.cpp.

References endoAssertMsg, m_CameraMatrix, m_DistorsionCoeffs, m_Mutex, and m_Valid.

Referenced by Copy().

◆ SetIntrinsics() [2/2]

void mitk::CameraIntrinsics::SetIntrinsics ( const mitk::Point3D focalPoint,
const mitk::Point3D principalPoint,
const mitk::Point4D distortionCoefficients 
)

Definition at line 123 of file mitkCameraIntrinsics.cpp.

References m_CameraMatrix, m_DistorsionCoeffs, and m_Mutex.

◆ SetPrincipalPoint()

void mitk::CameraIntrinsics::SetPrincipalPoint ( double  x,
double  y 
)

Definition at line 154 of file mitkCameraIntrinsics.cpp.

References m_CameraMatrix, and m_Mutex.

◆ SetValid()

void mitk::CameraIntrinsics::SetValid ( bool  valid)

Definition at line 496 of file mitkCameraIntrinsics.cpp.

References m_Mutex, and m_Valid.

Referenced by Copy().

◆ ToOctaveString()

std::string mitk::CameraIntrinsics::ToOctaveString ( const std::string &  varName = "CameraIntrinsics")

◆ ToString()

std::string mitk::CameraIntrinsics::ToString ( ) const

◆ ToXML()

void mitk::CameraIntrinsics::ToXML ( TiXmlElement *  elem) const
overridevirtual

write your values here to elem

Implements mitk::XMLSerializable.

Definition at line 219 of file mitkCameraIntrinsics.cpp.

References mitk::XMLSerializable::GetNameOfClass(), m_CameraMatrix, m_DistorsionCoeffs, m_Mutex, and m_Valid.

Friends And Related Function Documentation

◆ mitkCameraIntrinsicsTest

int mitkCameraIntrinsicsTest ( int  argc,
char *  argv[] 
)
friend

for testing purposes

Member Data Documentation

◆ m_CameraMatrix

◆ m_DistorsionCoeffs

cv::Mat mitk::CameraIntrinsics::m_DistorsionCoeffs
protected

◆ m_Mutex

◆ m_Valid

bool mitk::CameraIntrinsics::m_Valid
protected

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