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::HomographyRectification< InputStorageType, OutputStorageType > Class Template Reference

#include <Image/HomographyRectification.hh>

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

Public Member Functions

virtual int Disp2Depth (const Image< float > &DisparityMap, Image< float > &DepthMap, unsigned int border)
 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)
 
virtual int Rectify ()
 Rectify with same internal parameters for both. More...
 
virtual int RectifyMinImageSize ()
 Rectify so that images have minimal size. More...
 
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::HomographyRectification< InputStorageType, OutputStorageType >

Definition at line 35 of file HomographyRectification.hh.

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 
)
staticinherited

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 
)
staticinherited

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 >
int HomographyRectification::Disp2Depth ( const Image< float > &  DisparityMap,
Image< float > &  DepthMap,
unsigned int  border 
)
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

Implements BIAS::RectificationBase< InputStorageType, OutputStorageType >.

Definition at line 54 of file HomographyRectification.cpp.

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

Definition at line 221 of file RectificationBase.cpp.

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

Definition at line 229 of file RectificationBase.cpp.

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

Definition at line 205 of file RectificationBase.cpp.

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

Definition at line 212 of file RectificationBase.cpp.

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

Definition at line 237 of file RectificationBase.cpp.

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

Definition at line 246 of file RectificationBase.cpp.

template<class InputStorageType , class OutputStorageType >
bool HomographyRectification::IsInputCameraValid ( const BIAS::Image< InputStorageType > &  img,
const BIAS::ProjectionParametersBase proj 
)
virtual
template<class InputStorageType , class OutputStorageType >
bool BIAS::RectificationBase< InputStorageType, OutputStorageType >::IsInputCameraValid ( BIAS::Camera< InputStorageType > &  cam)
inherited

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 >
int HomographyRectification::Rectify ( )
virtual

Rectify with same internal parameters for both.

Implements BIAS::RectificationBase< InputStorageType, OutputStorageType >.

Definition at line 32 of file HomographyRectification.cpp.

template<class InputStorageType , class OutputStorageType >
int HomographyRectification::RectifyMinImageSize ( )
virtual

Rectify so that images have minimal size.

Definition at line 47 of file HomographyRectification.cpp.

template<class InputStorageType , class OutputStorageType >
int BIAS::RectificationBase< InputStorageType, OutputStorageType >::SetCameraA ( BIAS::Camera< InputStorageType > &  cam)
virtualinherited
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 
)
virtualinherited
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)
virtualinherited
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 
)
virtualinherited
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_
protectedinherited

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_
protectedinherited

local copy of passed image

Definition at line 184 of file RectificationBase.hh.

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

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_
protectedinherited

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_
protectedinherited

Results of rectification.

Definition at line 187 of file RectificationBase.hh.

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

Results of rectification.

Definition at line 190 of file RectificationBase.hh.


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