Zivid C++ API 2.13.1+18e79e79-1
Zivid::CameraIntrinsics Class Reference

Information about the intrinsic parameters of the camera (OpenCV model) More...

#include <Zivid/CameraIntrinsics.h>

Classes

class  CameraMatrix
 The camera matrix K (=[fx,0,cx;0,fy,cy;0,0,1]) More...
 
class  Distortion
 The radial and tangential distortion parameters. More...
 

Public Types

using Descendants
 

Public Member Functions

 CameraIntrinsics ()
 Default constructor.
 
 CameraIntrinsics (const std::string &fileName)
 Construct CameraIntrinsics by loading from file.
 
std::string serialize () const
 Serialize to a string.
 
template<typename... Args>
 CameraIntrinsics (Args &&...args)
 Constructor taking variadic number of arguments.
 
template<typename... Args>
void set (Args &&...args)
 Set multiple arguments.
 
template<typename... Args>
CameraIntrinsics copyWith (Args &&...args) const
 Returns a copy of this object with the given argument(s) set to the new value(s)
 
const CameraMatrixcameraMatrix () const
 Get CameraMatrix.
 
CameraMatrixcameraMatrix ()
 Get CameraMatrix.
 
CameraIntrinsicsset (const CameraMatrix &value)
 Set CameraMatrix.
 
CameraIntrinsicsset (const CameraMatrix::CX &value)
 Set CameraMatrix::CX.
 
CameraIntrinsicsset (const CameraMatrix::CY &value)
 Set CameraMatrix::CY.
 
CameraIntrinsicsset (const CameraMatrix::FX &value)
 Set CameraMatrix::FX.
 
CameraIntrinsicsset (const CameraMatrix::FY &value)
 Set CameraMatrix::FY.
 
const Distortiondistortion () const
 Get Distortion.
 
Distortiondistortion ()
 Get Distortion.
 
CameraIntrinsicsset (const Distortion &value)
 Set Distortion.
 
CameraIntrinsicsset (const Distortion::K1 &value)
 Set Distortion::K1.
 
CameraIntrinsicsset (const Distortion::K2 &value)
 Set Distortion::K2.
 
CameraIntrinsicsset (const Distortion::K3 &value)
 Set Distortion::K3.
 
CameraIntrinsicsset (const Distortion::P1 &value)
 Set Distortion::P1.
 
CameraIntrinsicsset (const Distortion::P2 &value)
 Set Distortion::P2.
 
template<typename T , typename std::enable_if< std::is_same< T, CameraIntrinsics::CameraMatrix >::value, int >::type = 0>
const CameraIntrinsics::CameraMatrixget () const
 
template<typename T , typename std::enable_if< std::is_same< T, CameraIntrinsics::CameraMatrix::CX >::value, int >::type = 0>
const CameraIntrinsics::CameraMatrix::CXget () const
 
template<typename T , typename std::enable_if< std::is_same< T, CameraIntrinsics::CameraMatrix::CY >::value, int >::type = 0>
const CameraIntrinsics::CameraMatrix::CYget () const
 
template<typename T , typename std::enable_if< std::is_same< T, CameraIntrinsics::CameraMatrix::FX >::value, int >::type = 0>
const CameraIntrinsics::CameraMatrix::FXget () const
 
template<typename T , typename std::enable_if< std::is_same< T, CameraIntrinsics::CameraMatrix::FY >::value, int >::type = 0>
const CameraIntrinsics::CameraMatrix::FYget () const
 
template<typename T , typename std::enable_if< std::is_same< T, CameraIntrinsics::Distortion >::value, int >::type = 0>
const CameraIntrinsics::Distortionget () const
 
template<typename T , typename std::enable_if< std::is_same< T, CameraIntrinsics::Distortion::K1 >::value, int >::type = 0>
const CameraIntrinsics::Distortion::K1get () const
 
template<typename T , typename std::enable_if< std::is_same< T, CameraIntrinsics::Distortion::K2 >::value, int >::type = 0>
const CameraIntrinsics::Distortion::K2get () const
 
template<typename T , typename std::enable_if< std::is_same< T, CameraIntrinsics::Distortion::K3 >::value, int >::type = 0>
const CameraIntrinsics::Distortion::K3get () const
 
template<typename T , typename std::enable_if< std::is_same< T, CameraIntrinsics::Distortion::P1 >::value, int >::type = 0>
const CameraIntrinsics::Distortion::P1get () const
 
template<typename T , typename std::enable_if< std::is_same< T, CameraIntrinsics::Distortion::P2 >::value, int >::type = 0>
const CameraIntrinsics::Distortion::P2get () const
 
template<size_t i, typename std::enable_if< i==0, int >::type = 0>
const CameraIntrinsics::CameraMatrixget () const
 
template<size_t i, typename std::enable_if< i==1, int >::type = 0>
const CameraIntrinsics::Distortionget () const
 
template<typename F >
void forEach (const F &f) const
 Run the given function on each direct member with the value of the member as parameter.
 
template<typename F >
void forEach (const F &f)
 Run the given function on each direct member with the value of the member as parameter.
 
bool operator== (const CameraIntrinsics &other) const
 Equality operator.
 
bool operator!= (const CameraIntrinsics &other) const
 Inequality operator.
 
std::string toString () const
 Get the value as string.
 
void save (const std::string &fileName) const
 Save to the given file.
 
void load (const std::string &fileName)
 Load from the given file.
 

Static Public Member Functions

static ZIVID_NODISCARD CameraIntrinsics fromSerialized (const std::string &value)
 Construct a new CameraIntrinsics instance from a previously serialized string.
 

Static Public Attributes

static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group
 The type of this node.
 
static constexpr const char * path { "" }
 The full path for this value.
 
static constexpr const char * name { "CameraIntrinsics" }
 The name of this value.
 
static constexpr const char * description
 The description for this value.
 
static constexpr size_t version { 1 }
 

Friends

struct DataModel::Detail::Befriend< CameraIntrinsics >
 
std::ostream & operator<< (std::ostream &stream, const CameraIntrinsics &value)
 Operator to send the value as string to a stream.
 

Detailed Description

Information about the intrinsic parameters of the camera (OpenCV model)

Member Typedef Documentation

◆ Descendants

Initial value:
std::tuple<
CameraIntrinsics::CameraMatrix,
CameraIntrinsics::CameraMatrix::CX,
CameraIntrinsics::CameraMatrix::CY,
CameraIntrinsics::CameraMatrix::FX,
CameraIntrinsics::CameraMatrix::FY,
CameraIntrinsics::Distortion,
CameraIntrinsics::Distortion::K1,
CameraIntrinsics::Distortion::K2,
CameraIntrinsics::Distortion::K3,
CameraIntrinsics::Distortion::P1,
CameraIntrinsics::Distortion::P2>

Constructor & Destructor Documentation

◆ CameraIntrinsics() [1/3]

Zivid::CameraIntrinsics::CameraIntrinsics ( )

Default constructor.

◆ CameraIntrinsics() [2/3]

Zivid::CameraIntrinsics::CameraIntrinsics ( const std::string & fileName)
explicit

Construct CameraIntrinsics by loading from file.

◆ CameraIntrinsics() [3/3]

template<typename... Args>
Zivid::CameraIntrinsics::CameraIntrinsics ( Args &&... args)
inlineexplicit

Constructor taking variadic number of arguments.

One or more descendant types can be provided. All types not provided will be set to their default value. The result is the same as default constructing CameraIntrinsics then invoking set(args).

The provided arguments must be descendants of CameraIntrinsics. These types can be provided:

Member Function Documentation

◆ cameraMatrix() [1/2]

CameraMatrix & Zivid::CameraIntrinsics::cameraMatrix ( )
inline

◆ cameraMatrix() [2/2]

const CameraMatrix & Zivid::CameraIntrinsics::cameraMatrix ( ) const
inline

◆ copyWith()

template<typename... Args>
CameraIntrinsics Zivid::CameraIntrinsics::copyWith ( Args &&... args) const
inline

Returns a copy of this object with the given argument(s) set to the new value(s)

Creates a copy of this CameraIntrinsics object, then invokes set(args) on the copy, and finally returns the copy. This method does not modify the original object.

The provided arguments must be descendants of CameraIntrinsics. These types can be provided:

◆ distortion() [1/2]

Distortion & Zivid::CameraIntrinsics::distortion ( )
inline

Get Distortion.

◆ distortion() [2/2]

const Distortion & Zivid::CameraIntrinsics::distortion ( ) const
inline

Get Distortion.

◆ forEach() [1/2]

template<typename F >
void Zivid::CameraIntrinsics::forEach ( const F & f)
inline

Run the given function on each direct member with the value of the member as parameter.

◆ forEach() [2/2]

template<typename F >
void Zivid::CameraIntrinsics::forEach ( const F & f) const
inline

Run the given function on each direct member with the value of the member as parameter.

◆ fromSerialized()

static ZIVID_NODISCARD CameraIntrinsics Zivid::CameraIntrinsics::fromSerialized ( const std::string & value)
static

Construct a new CameraIntrinsics instance from a previously serialized string.

See also serialize.

◆ get() [1/13]

template<typename T , typename std::enable_if< std::is_same< T, CameraIntrinsics::CameraMatrix >::value, int >::type = 0>
const CameraIntrinsics::CameraMatrix & Zivid::CameraIntrinsics::get ( ) const
inline

◆ get() [2/13]

template<typename T , typename std::enable_if< std::is_same< T, CameraIntrinsics::CameraMatrix::CX >::value, int >::type = 0>
const CameraIntrinsics::CameraMatrix::CX & Zivid::CameraIntrinsics::get ( ) const
inline

◆ get() [3/13]

template<typename T , typename std::enable_if< std::is_same< T, CameraIntrinsics::CameraMatrix::CY >::value, int >::type = 0>
const CameraIntrinsics::CameraMatrix::CY & Zivid::CameraIntrinsics::get ( ) const
inline

◆ get() [4/13]

template<typename T , typename std::enable_if< std::is_same< T, CameraIntrinsics::CameraMatrix::FX >::value, int >::type = 0>
const CameraIntrinsics::CameraMatrix::FX & Zivid::CameraIntrinsics::get ( ) const
inline

◆ get() [5/13]

template<typename T , typename std::enable_if< std::is_same< T, CameraIntrinsics::CameraMatrix::FY >::value, int >::type = 0>
const CameraIntrinsics::CameraMatrix::FY & Zivid::CameraIntrinsics::get ( ) const
inline

◆ get() [6/13]

template<typename T , typename std::enable_if< std::is_same< T, CameraIntrinsics::Distortion >::value, int >::type = 0>
const CameraIntrinsics::Distortion & Zivid::CameraIntrinsics::get ( ) const
inline

◆ get() [7/13]

template<typename T , typename std::enable_if< std::is_same< T, CameraIntrinsics::Distortion::K1 >::value, int >::type = 0>
const CameraIntrinsics::Distortion::K1 & Zivid::CameraIntrinsics::get ( ) const
inline

◆ get() [8/13]

template<typename T , typename std::enable_if< std::is_same< T, CameraIntrinsics::Distortion::K2 >::value, int >::type = 0>
const CameraIntrinsics::Distortion::K2 & Zivid::CameraIntrinsics::get ( ) const
inline

◆ get() [9/13]

template<typename T , typename std::enable_if< std::is_same< T, CameraIntrinsics::Distortion::K3 >::value, int >::type = 0>
const CameraIntrinsics::Distortion::K3 & Zivid::CameraIntrinsics::get ( ) const
inline

◆ get() [10/13]

template<typename T , typename std::enable_if< std::is_same< T, CameraIntrinsics::Distortion::P1 >::value, int >::type = 0>
const CameraIntrinsics::Distortion::P1 & Zivid::CameraIntrinsics::get ( ) const
inline

◆ get() [11/13]

template<typename T , typename std::enable_if< std::is_same< T, CameraIntrinsics::Distortion::P2 >::value, int >::type = 0>
const CameraIntrinsics::Distortion::P2 & Zivid::CameraIntrinsics::get ( ) const
inline

◆ get() [12/13]

template<size_t i, typename std::enable_if< i==0, int >::type = 0>
const CameraIntrinsics::CameraMatrix & Zivid::CameraIntrinsics::get ( ) const
inline

◆ get() [13/13]

template<size_t i, typename std::enable_if< i==1, int >::type = 0>
const CameraIntrinsics::Distortion & Zivid::CameraIntrinsics::get ( ) const
inline

◆ load()

void Zivid::CameraIntrinsics::load ( const std::string & fileName)

Load from the given file.

◆ operator!=()

bool Zivid::CameraIntrinsics::operator!= ( const CameraIntrinsics & other) const

Inequality operator.

◆ operator==()

bool Zivid::CameraIntrinsics::operator== ( const CameraIntrinsics & other) const

Equality operator.

◆ save()

void Zivid::CameraIntrinsics::save ( const std::string & fileName) const

Save to the given file.

◆ serialize()

std::string Zivid::CameraIntrinsics::serialize ( ) const

Serialize to a string.

See also fromSerialized. The returned string is formatted in YAML, and is compatible with the contents of files saved using save.

◆ set() [1/12]

template<typename... Args>
void Zivid::CameraIntrinsics::set ( Args &&... args)
inline

◆ set() [2/12]

CameraIntrinsics & Zivid::CameraIntrinsics::set ( const CameraMatrix & value)
inline

◆ set() [3/12]

CameraIntrinsics & Zivid::CameraIntrinsics::set ( const CameraMatrix::CX & value)
inline

◆ set() [4/12]

CameraIntrinsics & Zivid::CameraIntrinsics::set ( const CameraMatrix::CY & value)
inline

◆ set() [5/12]

CameraIntrinsics & Zivid::CameraIntrinsics::set ( const CameraMatrix::FX & value)
inline

◆ set() [6/12]

CameraIntrinsics & Zivid::CameraIntrinsics::set ( const CameraMatrix::FY & value)
inline

◆ set() [7/12]

CameraIntrinsics & Zivid::CameraIntrinsics::set ( const Distortion & value)
inline

Set Distortion.

◆ set() [8/12]

CameraIntrinsics & Zivid::CameraIntrinsics::set ( const Distortion::K1 & value)
inline

◆ set() [9/12]

CameraIntrinsics & Zivid::CameraIntrinsics::set ( const Distortion::K2 & value)
inline

◆ set() [10/12]

CameraIntrinsics & Zivid::CameraIntrinsics::set ( const Distortion::K3 & value)
inline

◆ set() [11/12]

CameraIntrinsics & Zivid::CameraIntrinsics::set ( const Distortion::P1 & value)
inline

◆ set() [12/12]

CameraIntrinsics & Zivid::CameraIntrinsics::set ( const Distortion::P2 & value)
inline

◆ toString()

std::string Zivid::CameraIntrinsics::toString ( ) const

Get the value as string.

Friends And Related Symbol Documentation

◆ DataModel::Detail::Befriend< CameraIntrinsics >

friend struct DataModel::Detail::Befriend< CameraIntrinsics >
friend

◆ operator<<

std::ostream & operator<< ( std::ostream & stream,
const CameraIntrinsics & value )
friend

Operator to send the value as string to a stream.

Member Data Documentation

◆ description

const char* Zivid::CameraIntrinsics::description
staticconstexpr
Initial value:
{
R"description(Information about the intrinsic parameters of the camera (OpenCV model))description"
}

The description for this value.

◆ name

const char* Zivid::CameraIntrinsics::name { "CameraIntrinsics" }
staticconstexpr

The name of this value.

◆ nodeType

DataModel::NodeType Zivid::CameraIntrinsics::nodeType = DataModel::NodeType::group
staticconstexpr

The type of this node.

◆ path

const char* Zivid::CameraIntrinsics::path { "" }
staticconstexpr

The full path for this value.

◆ version

size_t Zivid::CameraIntrinsics::version { 1 }
staticconstexpr

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