OTB  9.0.0
Orfeo Toolbox
Public Types | Public Member Functions | Static Public Member Functions | List of all members
otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage > Class Template Reference

#include <otbStereorectificationDisplacementFieldSource.h>

+ Inheritance diagram for otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >:
+ Collaboration diagram for otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >:

Public Types

typedef itk::SmartPointer< const SelfConstPointer
 
typedef InputImageType::Pointer InputImagePointerType
 
typedef TInputImage InputImageType
 
typedef OutputImageType::Pointer OutputImagePointerType
 
typedef TOutputImage OutputImageType
 
typedef itk::SmartPointer< SelfPointer
 
typedef OutputImageType::PointType PointType
 
typedef OutputImageType::RegionType RegionType
 
typedef RSTransformType::Pointer RSTransformPointerType
 
typedef otb::GenericRSTransform< double, 3, 3 > RSTransformType
 
typedef StereorectificationDisplacementFieldSource Self
 
typedef OutputImageType::SizeType SizeType
 
typedef OutputImageType::SpacingType SpacingType
 
typedef itk::ImageSource< TOutputImage > Superclass
 
typedef RSTransformType::InputPointType TDPointType
 

Public Member Functions

virtual ::itk::LightObject::Pointer CreateAnother (void) const
 
virtual const char * GetNameOfClass () const
 

Static Public Member Functions

static Pointer New ()
 
double m_ElevationOffset
 
double m_Scale
 
double m_GridStep
 
InputImagePointerType m_LeftImage
 
InputImagePointerType m_RightImage
 
RSTransformPointerType m_LeftToRightTransform
 
RSTransformPointerType m_RightToLeftTransform
 
SizeType m_RectifiedImageSize
 
TDPointType m_OutputOriginInLeftImage
 
double m_MeanBaselineRatio
 
bool m_UseDEM
 
virtual void SetScale (double _arg)
 
virtual const double & GetScale () const
 
virtual void SetGridStep (double _arg)
 
virtual double GetGridStep ()
 
virtual void SetLeftImage (InputImageType *_arg)
 
 itkGetObjectMacro (LeftImage, InputImageType)
 
virtual void SetRightImage (InputImageType *_arg)
 
 itkGetObjectMacro (RightImage, InputImageType)
 
virtual const SizeTypeGetRectifiedImageSize () const
 
virtual const double & GetMeanBaselineRatio () const
 
const OutputImageTypeGetLeftDisplacementFieldOutput () const
 
OutputImageTypeGetLeftDisplacementFieldOutput ()
 
const OutputImageTypeGetRightDisplacementFieldOutput () const
 
OutputImageTypeGetRightDisplacementFieldOutput ()
 
virtual void SetUseDEM (bool _arg)
 
virtual bool GetUseDEM ()
 
virtual void UseDEMOn ()
 
virtual void UseDEMOff ()
 
 StereorectificationDisplacementFieldSource (void)
 
 ~StereorectificationDisplacementFieldSource (void) override
 
void GenerateOutputInformation () override
 
void EnlargeOutputRequestedRegion (itk::DataObject *) override
 
void GenerateData () override
 
void PrintSelf (std::ostream &os, itk::Indent indent) const override
 
 StereorectificationDisplacementFieldSource (const Self &)
 
void operator= (const Self &)=delete
 

Detailed Description

template<class TInputImage, class TOutputImage>
class otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >

Compute the deformation fields for stereo-rectification.

The geometry of acqusition related to stereo pairs is such that the displacement related to the elevation between the two images of the pair always occurs along lines that are called epipolar lines.

In the case of conic acqusition, these lines are perfectly parallel by definition, while in push-broom geometry, these lines might not be exactly parallel due to perturbations during acquisition, especially when considering a large field of view.

The purpose of stereo-rectification is to warp both images of the pairs so that the displacement related to the elevation only occurs in the horizontal direction (i.e. epipolar lines are horizontal). This operation is useful for mainly two reasons: it allows searching for disparities in one direction only, and it allows deriving anaglyph for 3D viewing with 3D glasses.

This filter allows you to compute the deformation fields up to the sensor model precision needed to warp a pair of stereo images into epipolar geometry. Warping can be done using the otb::StreamingWarpImageFilter.

Since lines might not be perfectly regular, the algorithm performed by this filter uses the otb::GenericRSTransform capabilities to compute the local epipolar lines, and iteratively build a resampling grid by propagating along these locally estimated lines.

Epipolar images will have a null origin and a size as given by the GetRectifiedImageSize() method. The deformation fields and size are derived to produce epipolar images covering the whole extent of the left image.

The SetAverageElevation() method allows you to set the elevation hypothesis on which the epipolar geometry is built. It means that any pair of pixels in the stereo pair whose elevation is exactly equal to the average elevation will have a null disparity (no displacement). The SetElevationOffset() method allows tuning the elevation offset which is only used for local epipolar lines estimation. The default value of 50 meters should do.

Additionally, the SetScale() method allows deriving deformation fields and images size at a coarser (scale > 1) or finer (scale < 1) resolution. The SetGridStep() allows tuning the step of the resampling grid. Please keep in mind that the whole grid is loaded into memory, and that the epipolar lines direction may only vary smoothly. When working with large images, a coarse grid-step will generally be accurate enough and will preserve the memory resources.

See also
StreamingWarpImageFilter
StereoSensorModelToElevationMapFilter

Definition at line 90 of file otbStereorectificationDisplacementFieldSource.h.

Member Typedef Documentation

◆ ConstPointer

template<class TInputImage , class TOutputImage >
typedef itk::SmartPointer<const Self> otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::ConstPointer

◆ InputImagePointerType

template<class TInputImage , class TOutputImage >
typedef InputImageType::Pointer otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::InputImagePointerType

◆ InputImageType

template<class TInputImage , class TOutputImage >
typedef TInputImage otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::InputImageType

◆ OutputImagePointerType

template<class TInputImage , class TOutputImage >
typedef OutputImageType::Pointer otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::OutputImagePointerType

◆ OutputImageType

template<class TInputImage , class TOutputImage >
typedef TOutputImage otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::OutputImageType

◆ Pointer

template<class TInputImage , class TOutputImage >
typedef itk::SmartPointer<Self> otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::Pointer

◆ PointType

template<class TInputImage , class TOutputImage >
typedef OutputImageType::PointType otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::PointType

◆ RegionType

template<class TInputImage , class TOutputImage >
typedef OutputImageType::RegionType otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::RegionType

◆ RSTransformPointerType

template<class TInputImage , class TOutputImage >
typedef RSTransformType::Pointer otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::RSTransformPointerType

◆ RSTransformType

template<class TInputImage , class TOutputImage >
typedef otb::GenericRSTransform<double, 3, 3> otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::RSTransformType

◆ Self

template<class TInputImage , class TOutputImage >
typedef StereorectificationDisplacementFieldSource otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::Self

Standard class typedefs

Definition at line 94 of file otbStereorectificationDisplacementFieldSource.h.

◆ SizeType

template<class TInputImage , class TOutputImage >
typedef OutputImageType::SizeType otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::SizeType

◆ SpacingType

template<class TInputImage , class TOutputImage >
typedef OutputImageType::SpacingType otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::SpacingType

◆ Superclass

template<class TInputImage , class TOutputImage >
typedef itk::ImageSource<TOutputImage> otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::Superclass

◆ TDPointType

template<class TInputImage , class TOutputImage >
typedef RSTransformType::InputPointType otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::TDPointType

Constructor & Destructor Documentation

◆ StereorectificationDisplacementFieldSource() [1/2]

template<class TInputImage , class TOutputImage >
otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::StereorectificationDisplacementFieldSource ( void  )
protected

◆ ~StereorectificationDisplacementFieldSource()

template<class TInputImage , class TOutputImage >
otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::~StereorectificationDisplacementFieldSource ( void  )
inlineoverrideprotected

Destructor

Definition at line 172 of file otbStereorectificationDisplacementFieldSource.h.

◆ StereorectificationDisplacementFieldSource() [2/2]

template<class TInputImage , class TOutputImage >
otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::StereorectificationDisplacementFieldSource ( const Self )
private

This elevation offset is used to compute the epipolar direction

Member Function Documentation

◆ CreateAnother()

template<class TInputImage , class TOutputImage >
virtual::itk::LightObject::Pointer otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::CreateAnother ( void  ) const

◆ EnlargeOutputRequestedRegion()

template<class TInputImage , class TOutputImage >
void otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::EnlargeOutputRequestedRegion ( itk::DataObject *  output)
overrideprotected

Enlarge output requested region (no streaming)

Definition at line 277 of file otbStereorectificationDisplacementFieldSource.hxx.

◆ GenerateData()

template<class TInputImage , class TOutputImage >
void otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::GenerateData
overrideprotected

◆ GenerateOutputInformation()

template<class TInputImage , class TOutputImage >
void otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::GenerateOutputInformation
overrideprotected

Generate output images information

Definition at line 107 of file otbStereorectificationDisplacementFieldSource.hxx.

References otb::CONST_PI, and otb::DEMHandler::GetInstance().

◆ GetGridStep()

template<class TInputImage , class TOutputImage >
virtual double otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::GetGridStep ( )
virtual

This elevation offset is used to compute the epipolar direction

◆ GetLeftDisplacementFieldOutput() [1/2]

template<class TInputImage , class TOutputImage >
OutputImageType* otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::GetLeftDisplacementFieldOutput ( )

Return the left deformation field

◆ GetLeftDisplacementFieldOutput() [2/2]

template<class TInputImage , class TOutputImage >
StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::OutputImageType * otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::GetLeftDisplacementFieldOutput

Return the left deformation field (const version)

Definition at line 64 of file otbStereorectificationDisplacementFieldSource.hxx.

◆ GetMeanBaselineRatio()

template<class TInputImage , class TOutputImage >
virtual const double& otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::GetMeanBaselineRatio ( ) const
virtual

Get the estimated mean baseline ratio

◆ GetNameOfClass()

template<class TInputImage , class TOutputImage >
virtual const char* otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::GetNameOfClass ( ) const
virtual

Run-time type information (and related methods).

◆ GetRectifiedImageSize()

template<class TInputImage , class TOutputImage >
virtual const SizeType& otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::GetRectifiedImageSize ( ) const
virtual

Get the size of the rectified image

◆ GetRightDisplacementFieldOutput() [1/2]

template<class TInputImage , class TOutputImage >
OutputImageType* otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::GetRightDisplacementFieldOutput ( )

Return the left deformation field

◆ GetRightDisplacementFieldOutput() [2/2]

template<class TInputImage , class TOutputImage >
StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::OutputImageType * otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::GetRightDisplacementFieldOutput

Return the left deformation field (const version)

Definition at line 86 of file otbStereorectificationDisplacementFieldSource.hxx.

◆ GetScale()

template<class TInputImage , class TOutputImage >
virtual const double& otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::GetScale ( ) const
virtual

This elevation offset is used to compute the epipolar direction

◆ GetUseDEM()

template<class TInputImage , class TOutputImage >
virtual bool otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::GetUseDEM ( )
virtual

This elevation offset is used to compute the epipolar direction

◆ itkGetObjectMacro() [1/2]

template<class TInputImage , class TOutputImage >
otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::itkGetObjectMacro ( LeftImage  ,
InputImageType   
)

This elevation offset is used to compute the epipolar direction

◆ itkGetObjectMacro() [2/2]

template<class TInputImage , class TOutputImage >
otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::itkGetObjectMacro ( RightImage  ,
InputImageType   
)

This elevation offset is used to compute the epipolar direction

◆ New()

template<class TInputImage , class TOutputImage >
static Pointer otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::New ( )
static

Method for creation through the object factory.

◆ operator=()

template<class TInputImage , class TOutputImage >
void otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::operator= ( const Self )
privatedelete

This elevation offset is used to compute the epipolar direction

◆ PrintSelf()

template<class TInputImage , class TOutputImage >
void otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const
overrideprotected

PrintSelf method

Definition at line 515 of file otbStereorectificationDisplacementFieldSource.hxx.

◆ SetGridStep()

template<class TInputImage , class TOutputImage >
virtual void otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::SetGridStep ( double  _arg)
virtual

Get/Set the grid scale

◆ SetLeftImage()

template<class TInputImage , class TOutputImage >
virtual void otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::SetLeftImage ( InputImageType _arg)
virtual

Get/Set left image for stereo-rectification

◆ SetRightImage()

template<class TInputImage , class TOutputImage >
virtual void otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::SetRightImage ( InputImageType _arg)
virtual

Get/Set right image for stereo-rectification

◆ SetScale()

template<class TInputImage , class TOutputImage >
virtual void otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::SetScale ( double  _arg)
virtual

Get/Set the scale

◆ SetUseDEM()

template<class TInputImage , class TOutputImage >
virtual void otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::SetUseDEM ( bool  _arg)
virtual

This elevation offset is used to compute the epipolar direction

◆ UseDEMOff()

template<class TInputImage , class TOutputImage >
virtual void otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::UseDEMOff ( )
virtual

This elevation offset is used to compute the epipolar direction

◆ UseDEMOn()

template<class TInputImage , class TOutputImage >
virtual void otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::UseDEMOn ( )
virtual

This elevation offset is used to compute the epipolar direction

Member Data Documentation

◆ m_ElevationOffset

template<class TInputImage , class TOutputImage >
double otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::m_ElevationOffset
private

This elevation offset is used to compute the epipolar direction

Definition at line 193 of file otbStereorectificationDisplacementFieldSource.h.

◆ m_GridStep

template<class TInputImage , class TOutputImage >
double otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::m_GridStep
private

Controls the step of the resampling grid (in pixels). A finer step will lead to more memory consumption.

Definition at line 202 of file otbStereorectificationDisplacementFieldSource.h.

◆ m_LeftImage

template<class TInputImage , class TOutputImage >
InputImagePointerType otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::m_LeftImage
private

Left image

Definition at line 205 of file otbStereorectificationDisplacementFieldSource.h.

◆ m_LeftToRightTransform

template<class TInputImage , class TOutputImage >
RSTransformPointerType otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::m_LeftToRightTransform
private

◆ m_MeanBaselineRatio

template<class TInputImage , class TOutputImage >
double otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::m_MeanBaselineRatio
private

This variable contains the estimated mean baseline ratio over the image

Definition at line 224 of file otbStereorectificationDisplacementFieldSource.h.

◆ m_OutputOriginInLeftImage

template<class TInputImage , class TOutputImage >
TDPointType otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::m_OutputOriginInLeftImage
private

Output origin in left image (internal use)

Definition at line 220 of file otbStereorectificationDisplacementFieldSource.h.

◆ m_RectifiedImageSize

template<class TInputImage , class TOutputImage >
SizeType otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::m_RectifiedImageSize
private

Size of the rectified images

Definition at line 217 of file otbStereorectificationDisplacementFieldSource.h.

◆ m_RightImage

template<class TInputImage , class TOutputImage >
InputImagePointerType otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::m_RightImage
private

Right image

Definition at line 208 of file otbStereorectificationDisplacementFieldSource.h.

◆ m_RightToLeftTransform

template<class TInputImage , class TOutputImage >
RSTransformPointerType otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::m_RightToLeftTransform
private

◆ m_Scale

template<class TInputImage , class TOutputImage >
double otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::m_Scale
private

A scale greater than 1 will lead to zoomed stereo-rectified pairs

Definition at line 197 of file otbStereorectificationDisplacementFieldSource.h.

◆ m_UseDEM

template<class TInputImage , class TOutputImage >
bool otb::StereorectificationDisplacementFieldSource< TInputImage, TOutputImage >::m_UseDEM
private

If set to true, elevation is retrieved through DEMHandler::GetHeightAboveEllipsoid(). If false, elevation is retrieved from DEMHandler::GetDefaultHeightAboveEllipsoid()

Definition at line 229 of file otbStereorectificationDisplacementFieldSource.h.


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