Raytrix Light Field SDK  4.0
Logo
Public Types | Public Member Functions | List of all members
Rx::LFR::CCalibration Class Reference

Detailed Description

Defines a single camera or ray image calibration, including a possible gray image.

Inherits Rx::LFR::CParametersPimpl< CCalibration_Impl, Params::ECalib::ID, Interfaces::ECalib::ID >.

Public Types

typedef Interfaces::ECalib::ID EnumInterfaceType
 
typedef Params::ECalib::ID EnumType
 The type of the parameter enum. Is used by managed wrapper classes. More...
 

Public Member Functions

 CCalibration ()
 Default constructor. Creates an uninitialized calibration. Call SetToDefault to initialize it. More...
 
 CCalibration (CCalibration &&xCalibration)
 Move constructor. More...
 
 ~CCalibration ()
 Destructor. Frees all used memory including the gray image. More...
 
const void * GetCameraFormat () const
 Gets the pointer to the internal camera format. Only for internal purposes. More...
 
const CRxMapping3DGetDepthCorrectionVolume () const
 Gets the depth correction volume. More...
 
CRxMapping3DGetDepthCorrectionVolume ()
 Gets the depth correction volume. More...
 
const CRxImageGetGrayImage () const
 Gets the gray image. The gray image is invalid if this calibration has no gray image. More...
 
CRxImageGetGrayImage ()
 Gets the gray image. The gray image is invalid if this calibration has no gray image. More...
 
void GetGridData (CRxArray2DDouble &adLensData2D, bool bMLI) const
 Gets the grid data of this calibration. More...
 
CCalibration_Impl & GetImpl ()
 Gets the non constant implementation. More...
 
const CCalibration_Impl & GetImpl () const
 Gets the constant implementation. More...
 
void * GetInterface (Interfaces::ECalib::ID eInterface)
 Gets the interface defined by the given interface ID. More...
 
const void * GetInterface (Interfaces::ECalib::ID eInterface) const
 Gets the interface defined by the given interface ID. More...
 
TInterface * GetInterface (Interfaces::ECalib::ID eInterface)
 Gets the interface defined by the given interface ID. More...
 
const TInterface * GetInterface (Interfaces::ECalib::ID eInterface) const
 Gets the interface defined by the given interface ID. More...
 
CParameters< Params::ECalib::ID > & GetParams ()
 
const CParameters< Params::ECalib::ID > & GetParams () const
 
void GetRawImagePointsFromVirtualMM_s (CRxArray< double > &adRawPoints, double dSrcX, double dSrcY, double dSrcZ, int iRadiusLU) const
 Projects the given 3D point given in virtual space in sensor frame in millimeters through all suitable micro lenses. More...
 
void GetRawImagePointsFromVirtualMM_s (CRxArray< double > &adRawPoints, double dSrcX, double dSrcY, double dSrcZ, int iRadiusLU, int iMinAllowedDistanceToLensBorderPX) const
 Projects the given 3D point given in virtual space in sensor frame in millimeters through all suitable micro lenses. More...
 
void GetVirtualMM_sFromRawImagePoint (double &dTrgX, double &dTrgY, double &dTrgZ, double dSrcX, double dSrcY, double dSrcZ) const
 Projects from the given pixel position in the raw image with the given standard depth through the micro lenses into virtual space. More...
 
bool HasDepthCorrectionVolume () const
 Query if this object has a depth correction volume. More...
 
bool HasGrayImage () const
 Queries if this calibration has a gray image. More...
 
bool HasInterface (Interfaces::ECalib::ID eInterface)
 Queries if this object has the given interface. More...
 
CCalibrationoperator= (CCalibration &&xCalibration)
 Move assignment operator. More...
 
bool Project (CRxArrayDouble &adTrgPoints, const CRxArrayDouble &adSrcPoints, LF::ESpace::ID eTrgSpace, LF::ESpace::ID eSrcSpace, const CRxImageFormat &xFormat) const
 Projects an array of points from the given source space into the given target space. More...
 
double ProjectDepth (double dSrcDepth, LF::ESpace::ID eSrcSpace, bool bSrcVD, LF::ESpace::ID eTrgSpace, bool bTrgVD) const
 Projects the given source depth value into the given target space. More...
 
void SaveAsXmlFile (const CRxString &sxFilename)
 Saves some details of this calibration as a XML file. More...
 
void SaveAsXmlString (CRxString &sxXml)
 Saves some details of this calibration as a XML string. More...
 
void SetCameraFormat (const void *pvData)
 Sets the camera format by pointer. Only for internal purposes. More...
 
void SetDepthCorrectionVolume (CRxMapping3D &&xMapping)
 Sets the depth correction volume. This moves the given mapping into this calibration. More...
 
void SetGrayImage (const Interop::Runtime28::IImage *pxImg)
 Sets the given image as the gray image. This copies the given image into this calibration. More...
 
void SetGrayImage (const CRxImage &xImg)
 Sets the given image as the gray image. This copies the given image into this calibration. More...
 
void SetGrayImage (CRxImage &&xImg)
 Sets the given image as the gray image. This moves the given image into this calibration. More...
 
void SetToDefault (int iHeightPX, int iWidthPX)
 Sets this calibration to default. All applied parameters are reset. The gray image is not affected. More...
 

Member Typedef Documentation

The type of the parameter enum. Is used by managed wrapper classes.

Constructor & Destructor Documentation

Rx::LFR::CCalibration::CCalibration ( )

Default constructor. Creates an uninitialized calibration. Call SetToDefault to initialize it.

Rx::LFR::CCalibration::CCalibration ( CCalibration &&  xCalibration)

Move constructor.

Parameters
xCalibration[in,out]The calibration instance.
Rx::LFR::CCalibration::~CCalibration ( )

Destructor. Frees all used memory including the gray image.

Member Function Documentation

const void* Rx::LFR::CCalibration::GetCameraFormat ( ) const

Gets the pointer to the internal camera format. Only for internal purposes.

Returns
The pointer to the internal camera format.
const CRxMapping3D& Rx::LFR::CCalibration::GetDepthCorrectionVolume ( ) const

Gets the depth correction volume.

Returns
The depth correction volume.
CRxMapping3D& Rx::LFR::CCalibration::GetDepthCorrectionVolume ( )

Gets the depth correction volume.

Returns
The depth correction volume.
const CRxImage& Rx::LFR::CCalibration::GetGrayImage ( ) const

Gets the gray image. The gray image is invalid if this calibration has no gray image.

Returns
The gray image.
CRxImage& Rx::LFR::CCalibration::GetGrayImage ( )

Gets the gray image. The gray image is invalid if this calibration has no gray image.

Returns
The gray image.
void Rx::LFR::CCalibration::GetGridData ( CRxArray2DDouble adLensData2D,
bool  bMLI 
) const

Gets the grid data of this calibration.

The grid data is a 2D vector of lens information. For each lens on the grid exists a four component entry with the following values:

  • 1. X position of the lens center given in pixels on the PXA
  • 2. Y position of the lens center given in pixels on the PXA
  • 3. The effective radius of the lens
  • 4. The lens type of the lens.
Parameters
adLensData2D[out] The 2D lens information vector.
bMLITrue to get the MLI grid. False to get the MLA grid.
CCalibration_Impl & Rx::LFR::CPimpl< CCalibration_Impl , Interfaces::ECalib::ID >::GetImpl ( )
inlineinherited

Gets the non constant implementation.

Returns
The implementation.
const CCalibration_Impl & Rx::LFR::CPimpl< CCalibration_Impl , Interfaces::ECalib::ID >::GetImpl ( ) const
inlineinherited

Gets the constant implementation.

Returns
The implementation.
void* Rx::LFR::CPimpl< CCalibration_Impl , Interfaces::ECalib::ID >::GetInterface ( Interfaces::ECalib::ID  eInterface)
inherited

Gets the interface defined by the given interface ID.

Parameters
eInterfaceThe interface ID.
Returns
Null if it fails, else the interface.
const void* Rx::LFR::CPimpl< CCalibration_Impl , Interfaces::ECalib::ID >::GetInterface ( Interfaces::ECalib::ID  eInterface) const
inherited

Gets the interface defined by the given interface ID.

Parameters
eInterfaceThe interface ID.
Returns
Null if it fails, else the interface.
TInterface* Rx::LFR::CPimpl< CCalibration_Impl , Interfaces::ECalib::ID >::GetInterface ( Interfaces::ECalib::ID  eInterface)
inlineinherited

Gets the interface defined by the given interface ID.

Template Parameters
TInterfaceThe interface type.
Parameters
eInterfaceThe interface.
Returns
Null if it fails, else the interface.
const TInterface* Rx::LFR::CPimpl< CCalibration_Impl , Interfaces::ECalib::ID >::GetInterface ( Interfaces::ECalib::ID  eInterface) const
inlineinherited

Gets the interface defined by the given interface ID.

Template Parameters
TInterfaceThe interface type.
Parameters
eInterfaceThe interface ID.
Returns
Null if it fails, else the interface.
const CParameters<Params::ECalib::ID >& Rx::LFR::CParametersPimpl< CCalibration_Impl , Params::ECalib::ID , Interfaces::ECalib::ID >::GetParams ( ) const
inherited
void Rx::LFR::CCalibration::GetRawImagePointsFromVirtualMM_s ( CRxArray< double > &  adRawPoints,
double  dSrcX,
double  dSrcY,
double  dSrcZ,
int  iRadiusLU 
) const

Projects the given 3D point given in virtual space in sensor frame in millimeters through all suitable micro lenses.

Parameters
adRawPoints[out] The projected points. This array contains three entries per projected point. The first and the second entry are the X and the Y coordinates of the projected point given in pixels in the raw image. The third entry is the corresponding lens type.
dSrcXThe X coordinate of the source point in virtual space in millimeters.
dSrcYThe Y coordinate of the source point in virtual space in millimeters.
dSrcZThe Z coordinate of the source point in virtual space in millimeters.
iRadiusLUThe radius given in lens units that is used to find the suitable micro lenses. A radius of 2 or 3 lens units is recommended.
void Rx::LFR::CCalibration::GetRawImagePointsFromVirtualMM_s ( CRxArray< double > &  adRawPoints,
double  dSrcX,
double  dSrcY,
double  dSrcZ,
int  iRadiusLU,
int  iMinAllowedDistanceToLensBorderPX 
) const

Projects the given 3D point given in virtual space in sensor frame in millimeters through all suitable micro lenses.

Parameters
adRawPoints[out] The projected points. This array contains three entries per projected point. The first and the second entry are the X and the Y coordinates of the projected point given in pixels in the raw image. The third entry is the corresponding lens type.
dSrcXThe X coordinate of the source point in virtual space in millimeters.
dSrcYThe Y coordinate of the source point in virtual space in millimeters.
dSrcZThe Z coordinate of the source point in virtual space in millimeters.
iRadiusLUThe radius given in lens units that is used to find the suitable micro lenses. A radius of 2 or 3 lens units is recommended.
iMinAllowedDistanceToLensBorderPXThe minimal allowed distance to lens border in pixels.
void Rx::LFR::CCalibration::GetVirtualMM_sFromRawImagePoint ( double &  dTrgX,
double &  dTrgY,
double &  dTrgZ,
double  dSrcX,
double  dSrcY,
double  dSrcZ 
) const

Projects from the given pixel position in the raw image with the given standard depth through the micro lenses into virtual space.

Parameters
dTrgX[in,out] The X coordinate of the target point in virtual space in mm.
dTrgY[in,out] The Y coordinate of the target point in virtual space in mm.
dTrgZ[in,out] The Z coordinate of the target point in virtual space in mm.
dSrcXThe X coordinate of the source point in pixels in raw image format.
dSrcYThe Y coordinate of the target point in pixels in raw image format.
dSrcZThe Z coordinate of the target point in standard depths (Between 0.5 and 1.0)
bool Rx::LFR::CCalibration::HasDepthCorrectionVolume ( ) const

Query if this object has a depth correction volume.

Returns
True if there is a depth correction volume, false if not.
bool Rx::LFR::CCalibration::HasGrayImage ( ) const

Queries if this calibration has a gray image.

Returns
True if this calibration has a gray image, false if not.
bool Rx::LFR::CPimpl< CCalibration_Impl , Interfaces::ECalib::ID >::HasInterface ( Interfaces::ECalib::ID  eInterface)
inlineinherited

Queries if this object has the given interface.

Parameters
eInterfaceThe interface to query.
Returns
True if this class has the given interface, false if not.
CCalibration& Rx::LFR::CCalibration::operator= ( CCalibration &&  xCalibration)

Move assignment operator.

Parameters
xCalibration[in,out] The calibration instance.
Returns
The instance.
bool Rx::LFR::CCalibration::Project ( CRxArrayDouble adTrgPoints,
const CRxArrayDouble adSrcPoints,
LF::ESpace::ID  eTrgSpace,
LF::ESpace::ID  eSrcSpace,
const CRxImageFormat xFormat 
) const

Projects an array of points from the given source space into the given target space.

Parameters
adTrgPoints[out] The array of projected points.
adSrcPointsThe array of points to project.
eTrgSpaceThe target space.
eSrcSpaceThe source space.
xFormatThe image format of the source and/or target space. Only required if the space is a view. This parameter limits this function to allow only projections from an image format to the same image format.
Returns
True if all projections succeeded, false if at least one projection failed (out of sensor or image).
double Rx::LFR::CCalibration::ProjectDepth ( double  dSrcDepth,
LF::ESpace::ID  eSrcSpace,
bool  bSrcVD,
LF::ESpace::ID  eTrgSpace,
bool  bTrgVD 
) const

Projects the given source depth value into the given target space.

Parameters
dSrcDepthThe source depth value in millimeter or virtual depths.
eSrcSpaceThe source space.
bSrcVDTrue if the source depth value is given in virtual depths. Is ignored if the source space isn't virtual.
eTrgSpaceThe target space.
bTrgVDTrue if the target depth value should be given in virtual depths. Is ignored if the target space isn't virtual.
Returns
The resultant target depth value in millimeter or virtual depths.
void Rx::LFR::CCalibration::SaveAsXmlFile ( const CRxString sxFilename)

Saves some details of this calibration as a XML file.

Parameters
sxFilenameThe file name.
void Rx::LFR::CCalibration::SaveAsXmlString ( CRxString sxXml)

Saves some details of this calibration as a XML string.

Parameters
sxXml[out] The XML string.
void Rx::LFR::CCalibration::SetCameraFormat ( const void *  pvData)

Sets the camera format by pointer. Only for internal purposes.

Parameters
pvData[in] The pointer to the camera format to set.
void Rx::LFR::CCalibration::SetDepthCorrectionVolume ( CRxMapping3D &&  xMapping)

Sets the depth correction volume. This moves the given mapping into this calibration.

Parameters
xMapping[in] The mapping is invalid after this call.
void Rx::LFR::CCalibration::SetGrayImage ( const Interop::Runtime28::IImage pxImg)

Sets the given image as the gray image. This copies the given image into this calibration.

Parameters
pxImgThe image.
void Rx::LFR::CCalibration::SetGrayImage ( const CRxImage xImg)

Sets the given image as the gray image. This copies the given image into this calibration.

Parameters
xImgThe gray image.
void Rx::LFR::CCalibration::SetGrayImage ( CRxImage &&  xImg)

Sets the given image as the gray image. This moves the given image into this calibration.

Parameters
xImgThe gray image. Is invalid after this call.
void Rx::LFR::CCalibration::SetToDefault ( int  iHeightPX,
int  iWidthPX 
)

Sets this calibration to default. All applied parameters are reset. The gray image is not affected.

Parameters
iHeightPXThe height of the camera sensor in pixels.
iWidthPXThe width of the camera sensor in pixels.