Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Protected Attributes | List of all members
BIAS::RectificationBase< InputStorageType, OutputStorageType > Class Template Referenceabstract

base class for rectification implementations and wrappers More...

#include <Image/RectificationBase.hh>

+ Inheritance diagram for BIAS::RectificationBase< InputStorageType, OutputStorageType >:
+ Collaboration diagram for BIAS::RectificationBase< InputStorageType, OutputStorageType >:

Public Member Functions

virtual int Disp2Depth (const Image< float > &DisparityMap, Image< float > &DepthMap, unsigned int border)=0
 Uses the passed disparity map for camera A to calculate the corresponding depth map. More...
 
virtual bool IsInputCameraValid (const BIAS::Image< InputStorageType > &img, const BIAS::ProjectionParametersBase *proj)=0
 
 RectificationBase ()
 
virtual int Rectify ()=0
 Fundamental method which contains the rectification implementation. More...
 
virtual ~RectificationBase ()
 
Input data

fundamental setters.

virtual int SetCameraA (BIAS::Camera< InputStorageType > &cam)
 
virtual int SetCameraA (const BIAS::Image< InputStorageType > &img, const BIAS::ProjectionParametersBase *proj)
 
virtual int SetCameraB (BIAS::Camera< InputStorageType > &cam)
 
virtual int SetCameraB (const BIAS::Image< InputStorageType > &img, const BIAS::ProjectionParametersBase *proj)
 
Getters

Return stored results.

If there are.

void GetRectifiedImageA (Image< OutputStorageType > &rectImg)
 
void GetRectifiedImageB (Image< OutputStorageType > &rectImg)
 
bool IsInputCameraValid (BIAS::Camera< InputStorageType > &cam)
 Method calls two parameteric pure virtual method. More...
 
Grabbing/RT Utils

Methods granting direct access to data structures of rectification.

Attention
Use this with caution, methods were introduced to allow direct image grabbing into rectification object and efficient rectification readout when camera parameter do not change!
Use of methods belonging to this group does not trigger ANY state update! Methods were designed for following scenario:
  1. Use Set methods to initialize rectification and trigger state update.
  2. Use pointer aquired by GetImagePointerA()/B() to set original image content! It is not possible to set the ProjectionParamters this way!
  3. Call Rectify(): running this the first time will take some calculational effort because LUT will be constructed.
  4. Use pointer aquired GetRectifiedImagePointerA()/B(): to readout the result. If camera parameters do not change repeat all but the first dash to aquire rectified images.
Camera< InputStorageType > * GetImagePointerA ()
 
Camera< InputStorageType > * GetImagePointerB ()
 
const Image< OutputStorageType > * GetRectifiedImagePointerA ()
 
const Image< OutputStorageType > * GetRectifiedImagePointerB ()
 

Static Public Member Functions

Utility functions

Methods connected with rectification but are rather unspecific.

static int CalculateRectifiedBases (const Pose &poseA, const Pose &poseB, Pose &poseResA, Pose &poseResB, bool failIfForwardMove=false)
 Method determines two orthonormal bases suitable for rectification. More...
 
static int CalculateMeanOrientation (const Pose &poseLeft, const Pose &poseCenter, const Pose &poseRight, Quaternion< double > &orientation)
 Method calculates an intermediate orientation for rectification from all three poses. More...
 

Protected Attributes

Camera< InputStorageType > imageA_
 local copy of passed image More...
 
Camera< InputStorageType > imageB_
 local copy of passed image More...
 
ProjectionParametersBaseppBA_
 local copy of passed projection parameters More...
 
ProjectionParametersBaseppBB_
 local copy of passed projection parameters More...
 
Image< OutputStorageType > rectImageA_
 Results of rectification. More...
 
Image< OutputStorageType > rectImageB_
 Results of rectification. More...
 

Detailed Description

template<class InputStorageType, class OutputStorageType>
class BIAS::RectificationBase< InputStorageType, OutputStorageType >

base class for rectification implementations and wrappers

Author
bartczak 11/2006
Examples:
ExampleRectification.cpp, and ExampleXB3Rectification.cpp.

Definition at line 43 of file RectificationBase.hh.

Constructor & Destructor Documentation

template<class InputStorageType , class OutputStorageType >
BIAS::RectificationBase< InputStorageType, OutputStorageType >::~RectificationBase ( )
virtual

Definition at line 33 of file RectificationBase.cpp.

template<class InputStorageType , class OutputStorageType >
BIAS::RectificationBase< InputStorageType, OutputStorageType >::RectificationBase ( )

Definition at line 41 of file RectificationBase.cpp.

Member Function Documentation

template<class InputStorageType , class OutputStorageType >
int BIAS::RectificationBase< InputStorageType, OutputStorageType >::CalculateMeanOrientation ( const Pose poseLeft,
const Pose poseCenter,
const Pose poseRight,
Quaternion< double > &  orientation 
)
static

Method calculates an intermediate orientation for rectification from all three poses.

Does not check for forward movement now! Fails if two of the cameras are the same!

Definition at line 254 of file RectificationBase.cpp.

References BIAS::Vector3< T >::CrossProduct(), BIAS::Equal(), BIAS::CoordinateTransform3D::GetC(), BIAS::Matrix3x3< T >::GetDeterminant(), BIAS::RMatrixBase::GetQuaternion(), BIAS::Pose::GetZAxis(), BIAS::Vector3< T >::Normalize(), and BIAS::Vector3< T >::ScalarProduct().

template<class InputStorageType , class OutputStorageType >
int BIAS::RectificationBase< InputStorageType, OutputStorageType >::CalculateRectifiedBases ( const Pose poseA,
const Pose poseB,
Pose poseResA,
Pose poseResB,
bool  failIfForwardMove = false 
)
static

Method determines two orthonormal bases suitable for rectification.

This bases are parallel to oneanother. The x-basevector is parallel to the line connecting the origins of poseA and poseB. The z-basevector is chosen so that it is in between the z-vectors of original poses.

Parameters
failIfForwardMoveif true will have an error code(<0) returned if one of the original z-basevectors is parallel to baseline

Definition at line 317 of file RectificationBase.cpp.

References BIAS::Vector3< T >::CrossProduct(), BIAS::Equal(), BIAS::CoordinateTransform3D::GetC(), BIAS::RMatrixBase::GetQuaternion(), BIAS::CoordinateTransform3D::GetR(), BIAS::Vector3< T >::Normalize(), BIAS::Vector3< T >::NormL2(), BIAS::Vector3< T >::ScalarProduct(), BIAS::Pose::Set(), and BIAS::Vector3< T >::Set().

template<class InputStorageType, class OutputStorageType>
virtual int BIAS::RectificationBase< InputStorageType, OutputStorageType >::Disp2Depth ( const Image< float > &  DisparityMap,
Image< float > &  DepthMap,
unsigned int  border 
)
pure virtual

Uses the passed disparity map for camera A to calculate the corresponding depth map.

Parameters
DisparityMapdisparity map for camera A.
DepthMapresulting depth map for camera A.
borderimage border of depth map that will be ignored

Implemented in BIAS::RectificationViaProjectionMappingBase< InputStorageType, OutputStorageType >, and BIAS::HomographyRectification< InputStorageType, OutputStorageType >.

template<class InputStorageType , class OutputStorageType >
Camera< InputStorageType > * BIAS::RectificationBase< InputStorageType, OutputStorageType >::GetImagePointerA ( )

Definition at line 221 of file RectificationBase.cpp.

template<class InputStorageType , class OutputStorageType >
Camera< InputStorageType > * BIAS::RectificationBase< InputStorageType, OutputStorageType >::GetImagePointerB ( )

Definition at line 229 of file RectificationBase.cpp.

template<class InputStorageType , class OutputStorageType >
void BIAS::RectificationBase< InputStorageType, OutputStorageType >::GetRectifiedImageA ( Image< OutputStorageType > &  rectImg)

Definition at line 205 of file RectificationBase.cpp.

template<class InputStorageType , class OutputStorageType >
void BIAS::RectificationBase< InputStorageType, OutputStorageType >::GetRectifiedImageB ( Image< OutputStorageType > &  rectImg)

Definition at line 212 of file RectificationBase.cpp.

template<class InputStorageType , class OutputStorageType >
const Image< OutputStorageType > * BIAS::RectificationBase< InputStorageType, OutputStorageType >::GetRectifiedImagePointerA ( )

Definition at line 237 of file RectificationBase.cpp.

template<class InputStorageType , class OutputStorageType >
const Image< OutputStorageType > * BIAS::RectificationBase< InputStorageType, OutputStorageType >::GetRectifiedImagePointerB ( )

Definition at line 246 of file RectificationBase.cpp.

template<class InputStorageType , class OutputStorageType >
bool BIAS::RectificationBase< InputStorageType, OutputStorageType >::IsInputCameraValid ( BIAS::Camera< InputStorageType > &  cam)

Method calls two parameteric pure virtual method.

Method is called by SetCamera* methods and returns true if arguments are accepted by rectification implementations. E.g. a rectification method specialised on perspective images will refuse to handle spherical parameters. If method returns false the SetCamera* routines will also fail.

Definition at line 46 of file RectificationBase.cpp.

References BIAS::Projection::GetParameters(), BIAS::Camera< StorageType >::GetProj(), and BIAS::Camera< StorageType >::ParseMetaData().

template<class InputStorageType, class OutputStorageType>
virtual bool BIAS::RectificationBase< InputStorageType, OutputStorageType >::IsInputCameraValid ( const BIAS::Image< InputStorageType > &  img,
const BIAS::ProjectionParametersBase proj 
)
pure virtual
template<class InputStorageType, class OutputStorageType>
virtual int BIAS::RectificationBase< InputStorageType, OutputStorageType >::Rectify ( )
pure virtual

Fundamental method which contains the rectification implementation.

Returns
0 on successfull rectification.

Implemented in BIAS::RectificationViaProjectionMappingBase< InputStorageType, OutputStorageType >, and BIAS::HomographyRectification< InputStorageType, OutputStorageType >.

template<class InputStorageType , class OutputStorageType >
int BIAS::RectificationBase< InputStorageType, OutputStorageType >::SetCameraA ( BIAS::Camera< InputStorageType > &  cam)
virtual
Returns
-1 if rectification class is not supporting the specified projection type (what includes invalid projections).
1 if argument projection is already set.

Reimplemented in BIAS::RectificationViaProjectionMappingBase< InputStorageType, OutputStorageType >.

Definition at line 55 of file RectificationBase.cpp.

References BIAS::Projection::GetParameters(), BIAS::Camera< StorageType >::GetProj(), and BIAS::Camera< StorageType >::ParseMetaData().

template<class InputStorageType , class OutputStorageType >
int BIAS::RectificationBase< InputStorageType, OutputStorageType >::SetCameraA ( const BIAS::Image< InputStorageType > &  img,
const BIAS::ProjectionParametersBase proj 
)
virtual
Returns
-1 if rectification class is not supporting the specified projection type (what includes invalid projections).
1 if argument projection is already set. Will only use pointer for polymorphism. Will aquire copy of projection.

Reimplemented in BIAS::RectificationViaProjectionMappingBase< InputStorageType, OutputStorageType >.

Definition at line 86 of file RectificationBase.cpp.

References BIAS::ProjectionParametersBase::Clone(), and BIAS::ImageBase::IsEmpty().

template<class InputStorageType , class OutputStorageType >
int BIAS::RectificationBase< InputStorageType, OutputStorageType >::SetCameraB ( BIAS::Camera< InputStorageType > &  cam)
virtual
Returns
-1 if rectification class is not supporting the specified projection type (what includes invalid projections).
1 if argument projection is already set.

Reimplemented in BIAS::RectificationViaProjectionMappingBase< InputStorageType, OutputStorageType >.

Definition at line 129 of file RectificationBase.cpp.

References BIAS::Projection::GetParameters(), BIAS::Camera< StorageType >::GetProj(), and BIAS::Camera< StorageType >::ParseMetaData().

template<class InputStorageType , class OutputStorageType >
int BIAS::RectificationBase< InputStorageType, OutputStorageType >::SetCameraB ( const BIAS::Image< InputStorageType > &  img,
const BIAS::ProjectionParametersBase proj 
)
virtual
Returns
-1 if rectification class is not supporting the specified projection type (what includes invalid projections).
1 if argument projection is already set. Will only use pointer for polymorphism. Will aquire copy of projection.

Reimplemented in BIAS::RectificationViaProjectionMappingBase< InputStorageType, OutputStorageType >.

Definition at line 164 of file RectificationBase.cpp.

References BIAS::ProjectionParametersBase::Clone(), and BIAS::ImageBase::IsEmpty().

Member Data Documentation

template<class InputStorageType, class OutputStorageType>
Camera<InputStorageType> BIAS::RectificationBase< InputStorageType, OutputStorageType >::imageA_
protected

local copy of passed image

Definition at line 178 of file RectificationBase.hh.

template<class InputStorageType, class OutputStorageType>
Camera<InputStorageType> BIAS::RectificationBase< InputStorageType, OutputStorageType >::imageB_
protected

local copy of passed image

Definition at line 184 of file RectificationBase.hh.

template<class InputStorageType, class OutputStorageType>
ProjectionParametersBase* BIAS::RectificationBase< InputStorageType, OutputStorageType >::ppBA_
protected

local copy of passed projection parameters

Definition at line 175 of file RectificationBase.hh.

template<class InputStorageType, class OutputStorageType>
ProjectionParametersBase* BIAS::RectificationBase< InputStorageType, OutputStorageType >::ppBB_
protected

local copy of passed projection parameters

Definition at line 181 of file RectificationBase.hh.

template<class InputStorageType, class OutputStorageType>
Image<OutputStorageType> BIAS::RectificationBase< InputStorageType, OutputStorageType >::rectImageA_
protected

Results of rectification.

Definition at line 187 of file RectificationBase.hh.

template<class InputStorageType, class OutputStorageType>
Image<OutputStorageType> BIAS::RectificationBase< InputStorageType, OutputStorageType >::rectImageB_
protected

Results of rectification.

Definition at line 190 of file RectificationBase.hh.


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