OTB
9.0.0
Orfeo Toolbox
|
#include <otbPixelWiseBlockMatchingImageFilter.h>
Public Types | |
typedef TBlockMatchingFunctor | BlockMatchingFunctorType |
typedef itk::ConstNeighborhoodIterator< TInputImage > | ConstNeighborhoodIteratorType |
typedef itk::SmartPointer< const Self > | ConstPointer |
typedef OutputDisparityImageType::PixelType | DisparityPixelType |
typedef InputImageType::IndexType | IndexType |
typedef TInputImage | InputImageType |
typedef TMaskImage | InputMaskImageType |
typedef TOutputMetricImage::ValueType | MetricValueType |
typedef TOutputDisparityImage | OutputDisparityImageType |
typedef TOutputMetricImage | OutputMetricImageType |
typedef itk::SmartPointer< Self > | Pointer |
typedef InputImageType::PointType | PointType |
typedef InputImageType::RegionType | RegionType |
typedef PixelWiseBlockMatchingImageFilter | Self |
typedef InputImageType::SizeType | SizeType |
typedef InputImageType::SpacingType | SpacingType |
typedef itk::ImageToImageFilter< TInputImage, TOutputDisparityImage > | Superclass |
Public Member Functions | |
virtual ::itk::LightObject::Pointer | CreateAnother (void) const |
virtual const char * | GetNameOfClass () const |
void | SetLeftInput (const TInputImage *image) |
void | SetLeftMaskInput (const TMaskImage *image) |
void | SetRightInput (const TInputImage *image) |
void | SetRightMaskInput (const TMaskImage *image) |
Static Public Member Functions | |
static Pointer | New () |
SizeType | m_Radius |
int | m_MinimumHorizontalDisparity |
int | m_MaximumHorizontalDisparity |
int | m_MinimumVerticalDisparity |
int | m_MaximumVerticalDisparity |
bool | m_Minimize |
SizeType | m_ExplorationRadius |
BlockMatchingFunctorType | m_Functor |
int | m_InitHorizontalDisparity |
int | m_InitVerticalDisparity |
unsigned int | m_Step |
IndexType | m_GridIndex |
static RegionType | ConvertFullToSubsampledRegion (RegionType full, unsigned int step, IndexType index) |
static RegionType | ConvertSubsampledToFullRegion (RegionType sub, unsigned int step, IndexType index) |
const TInputImage * | GetLeftInput () const |
const TInputImage * | GetRightInput () const |
const TMaskImage * | GetLeftMaskInput () const |
const TMaskImage * | GetRightMaskInput () const |
const TOutputMetricImage * | GetMetricOutput () const |
TOutputMetricImage * | GetMetricOutput () |
const TOutputDisparityImage * | GetHorizontalDisparityOutput () const |
TOutputDisparityImage * | GetHorizontalDisparityOutput () |
const TOutputDisparityImage * | GetVerticalDisparityOutput () const |
TOutputDisparityImage * | GetVerticalDisparityOutput () |
void | SetRadius (unsigned int radius) |
virtual void | SetRadius (SizeType _arg) |
virtual const SizeType & | GetRadius () const |
virtual void | SetMinimumHorizontalDisparity (int _arg) |
virtual const int & | GetMinimumHorizontalDisparity () const |
virtual void | SetMaximumHorizontalDisparity (int _arg) |
virtual const int & | GetMaximumHorizontalDisparity () const |
virtual void | SetMinimumVerticalDisparity (int _arg) |
virtual const int & | GetMinimumVerticalDisparity () const |
virtual void | SetMaximumVerticalDisparity (int _arg) |
virtual const int & | GetMaximumVerticalDisparity () const |
virtual void | SetMinimize (bool _arg) |
virtual const bool & | GetMinimize () const |
virtual void | MinimizeOn () |
virtual void | MinimizeOff () |
virtual void | SetExplorationRadius (SizeType _arg) |
virtual const SizeType & | GetExplorationRadius () const |
virtual void | SetInitHorizontalDisparity (int _arg) |
virtual const int & | GetInitHorizontalDisparity () const |
virtual void | SetInitVerticalDisparity (int _arg) |
virtual const int & | GetInitVerticalDisparity () const |
BlockMatchingFunctorType & | GetFunctor () |
const BlockMatchingFunctorType & | GetFunctor () const |
void | SetHorizontalDisparityInput (const TOutputDisparityImage *hfield) |
void | SetVerticalDisparityInput (const TOutputDisparityImage *vfield) |
const TOutputDisparityImage * | GetHorizontalDisparityInput () const |
const TOutputDisparityImage * | GetVerticalDisparityInput () const |
virtual void | SetStep (unsigned int _arg) |
virtual unsigned int | GetStep () |
virtual void | SetGridIndex (IndexType _arg) |
virtual const IndexType & | GetGridIndex () const |
PixelWiseBlockMatchingImageFilter () | |
~PixelWiseBlockMatchingImageFilter () override | |
void | GenerateOutputInformation () override |
void | GenerateInputRequestedRegion () override |
void | BeforeThreadedGenerateData () override |
void | ThreadedGenerateData (const RegionType &outputRegionForThread, itk::ThreadIdType threadId) override |
PixelWiseBlockMatchingImageFilter (const Self &)=delete | |
void | operator= (const Self &) |
Perform 2D block matching between two images.
This filter performs pixel-wise 2D block-matching between a pair of image. This is especially useful in the case of stereo pairs in epipolar geometry, where displacements corresponding to differences of elevation occur in the horizontal direction only (in that case, the exploration along the vertical direction can be disabled). Please note that only integer pixel displacement are explored. For finer results, consider up-sampling the input images or use the SubPixelDisparityImageFilter.
The block-matching metric itself is defined by a template functor on neighborhood iterators. A wide range of block-matching criterions can be implemented this way, but the default functor performs a simple SSD (Sum of Square Distances). The radius of the blocks can be set using the SetRadius() method. The filter will try to minimize the metric value by default. Setting the minimize flag to off using the MinimizeOff() method will make the filter try to maximize the metric.
Only a user defined area of disparities between the two images is explored, which can be set by using the SetMinimumHorizontalDisparity() , SetMinimumVerticalDisparity(), SetMaximumHorizontalDisparity() and SetMaximumVerticalDisparity() methods.
This filter has three outputs: the first is the metric image, which contains the metric optimum value corresponding to the estimated displacement. The second and last outputs are the horizontal and vertical disparity maps, which can be retrieved using the GetHorizontalDisparityOutput() and GetVerticalDisparityOutput() methods. They contain the horizontal and vertical local displacement between the two input images (displacement is given in pixels, from left image to right image).
Masks are not mandatory. A mask allows indicating pixels validity in either left or right image. Left and right masks can be used independently. If masks are used, only pixels whose mask values are strictly positive will be considered for disparity matching. The other will exhibit a null metric value and a disparity corresponding to the minimum allowed disparity.
The disparity exploration can also be reduced thanks to initial disparity maps. The user can provide initial disparity estimate (using the same image type and size as the output disparities), or global disparity values. Then an exploration radius indicates the disparity range to be explored around the initial estimate (global minimum and maximum values are still in use).
Definition at line 298 of file otbPixelWiseBlockMatchingImageFilter.h.
typedef TBlockMatchingFunctor otb::PixelWiseBlockMatchingImageFilter< TInputImage, TOutputMetricImage, TOutputDisparityImage, TMaskImage, TBlockMatchingFunctor >::BlockMatchingFunctorType |
Definition at line 318 of file otbPixelWiseBlockMatchingImageFilter.h.
typedef itk::ConstNeighborhoodIterator<TInputImage> otb::PixelWiseBlockMatchingImageFilter< TInputImage, TOutputMetricImage, TOutputDisparityImage, TMaskImage, TBlockMatchingFunctor >::ConstNeighborhoodIteratorType |
Definition at line 330 of file otbPixelWiseBlockMatchingImageFilter.h.
typedef itk::SmartPointer<const Self> otb::PixelWiseBlockMatchingImageFilter< TInputImage, TOutputMetricImage, TOutputDisparityImage, TMaskImage, TBlockMatchingFunctor >::ConstPointer |
Definition at line 305 of file otbPixelWiseBlockMatchingImageFilter.h.
typedef OutputDisparityImageType::PixelType otb::PixelWiseBlockMatchingImageFilter< TInputImage, TOutputMetricImage, TOutputDisparityImage, TMaskImage, TBlockMatchingFunctor >::DisparityPixelType |
Definition at line 328 of file otbPixelWiseBlockMatchingImageFilter.h.
typedef InputImageType::IndexType otb::PixelWiseBlockMatchingImageFilter< TInputImage, TOutputMetricImage, TOutputDisparityImage, TMaskImage, TBlockMatchingFunctor >::IndexType |
Definition at line 321 of file otbPixelWiseBlockMatchingImageFilter.h.
typedef TInputImage otb::PixelWiseBlockMatchingImageFilter< TInputImage, TOutputMetricImage, TOutputDisparityImage, TMaskImage, TBlockMatchingFunctor >::InputImageType |
Useful typedefs
Definition at line 311 of file otbPixelWiseBlockMatchingImageFilter.h.
typedef TMaskImage otb::PixelWiseBlockMatchingImageFilter< TInputImage, TOutputMetricImage, TOutputDisparityImage, TMaskImage, TBlockMatchingFunctor >::InputMaskImageType |
Definition at line 317 of file otbPixelWiseBlockMatchingImageFilter.h.
typedef TOutputMetricImage::ValueType otb::PixelWiseBlockMatchingImageFilter< TInputImage, TOutputMetricImage, TOutputDisparityImage, TMaskImage, TBlockMatchingFunctor >::MetricValueType |
Definition at line 326 of file otbPixelWiseBlockMatchingImageFilter.h.
typedef TOutputDisparityImage otb::PixelWiseBlockMatchingImageFilter< TInputImage, TOutputMetricImage, TOutputDisparityImage, TMaskImage, TBlockMatchingFunctor >::OutputDisparityImageType |
Definition at line 316 of file otbPixelWiseBlockMatchingImageFilter.h.
typedef TOutputMetricImage otb::PixelWiseBlockMatchingImageFilter< TInputImage, TOutputMetricImage, TOutputDisparityImage, TMaskImage, TBlockMatchingFunctor >::OutputMetricImageType |
Definition at line 315 of file otbPixelWiseBlockMatchingImageFilter.h.
typedef itk::SmartPointer<Self> otb::PixelWiseBlockMatchingImageFilter< TInputImage, TOutputMetricImage, TOutputDisparityImage, TMaskImage, TBlockMatchingFunctor >::Pointer |
Definition at line 304 of file otbPixelWiseBlockMatchingImageFilter.h.
typedef InputImageType::PointType otb::PixelWiseBlockMatchingImageFilter< TInputImage, TOutputMetricImage, TOutputDisparityImage, TMaskImage, TBlockMatchingFunctor >::PointType |
Definition at line 324 of file otbPixelWiseBlockMatchingImageFilter.h.
typedef InputImageType::RegionType otb::PixelWiseBlockMatchingImageFilter< TInputImage, TOutputMetricImage, TOutputDisparityImage, TMaskImage, TBlockMatchingFunctor >::RegionType |
Definition at line 322 of file otbPixelWiseBlockMatchingImageFilter.h.
typedef PixelWiseBlockMatchingImageFilter otb::PixelWiseBlockMatchingImageFilter< TInputImage, TOutputMetricImage, TOutputDisparityImage, TMaskImage, TBlockMatchingFunctor >::Self |
Standard class typedef
Definition at line 302 of file otbPixelWiseBlockMatchingImageFilter.h.
typedef InputImageType::SizeType otb::PixelWiseBlockMatchingImageFilter< TInputImage, TOutputMetricImage, TOutputDisparityImage, TMaskImage, TBlockMatchingFunctor >::SizeType |
Definition at line 320 of file otbPixelWiseBlockMatchingImageFilter.h.
typedef InputImageType::SpacingType otb::PixelWiseBlockMatchingImageFilter< TInputImage, TOutputMetricImage, TOutputDisparityImage, TMaskImage, TBlockMatchingFunctor >::SpacingType |
Definition at line 323 of file otbPixelWiseBlockMatchingImageFilter.h.
typedef itk::ImageToImageFilter<TInputImage, TOutputDisparityImage> otb::PixelWiseBlockMatchingImageFilter< TInputImage, TOutputMetricImage, TOutputDisparityImage, TMaskImage, TBlockMatchingFunctor >::Superclass |
Definition at line 303 of file otbPixelWiseBlockMatchingImageFilter.h.
|
protected |
Constructor
Definition at line 32 of file otbPixelWiseBlockMatchingImageFilter.hxx.
|
overrideprotected |
Destructor
Definition at line 74 of file otbPixelWiseBlockMatchingImageFilter.hxx.
|
privatedelete |
The radius of the blocks
|
overrideprotected |
Before threaded generate data
Definition at line 453 of file otbPixelWiseBlockMatchingImageFilter.hxx.
|
static |
Conversion function between full and subsampled grid region
Definition at line 697 of file otbPixelWiseBlockMatchingImageFilter.hxx.
|
static |
Conversion function between subsampled and full grid region
Definition at line 734 of file otbPixelWiseBlockMatchingImageFilter.hxx.
virtual::itk::LightObject::Pointer otb::PixelWiseBlockMatchingImageFilter< TInputImage, TOutputMetricImage, TOutputDisparityImage, TMaskImage, TBlockMatchingFunctor >::CreateAnother | ( | void | ) | const |
|
overrideprotected |
Generate input requested region
Definition at line 307 of file otbPixelWiseBlockMatchingImageFilter.hxx.
|
overrideprotected |
Generate output information
Definition at line 261 of file otbPixelWiseBlockMatchingImageFilter.hxx.
|
virtual |
The radius of the blocks
|
inline |
Get the functor for parameters setting
Definition at line 418 of file otbPixelWiseBlockMatchingImageFilter.h.
|
inline |
Get the functor (const version)
Definition at line 424 of file otbPixelWiseBlockMatchingImageFilter.h.
|
virtual |
The radius of the blocks
const TOutputDisparityImage * otb::PixelWiseBlockMatchingImageFilter< TInputImage, TOutputMetricImage, TOutputDisparityImage, TMaskImage, TBlockMatchingFunctor >::GetHorizontalDisparityInput |
Get the initial disparity fields
Definition at line 240 of file otbPixelWiseBlockMatchingImageFilter.hxx.
TOutputDisparityImage* otb::PixelWiseBlockMatchingImageFilter< TInputImage, TOutputMetricImage, TOutputDisparityImage, TMaskImage, TBlockMatchingFunctor >::GetHorizontalDisparityOutput | ( | ) |
The radius of the blocks
TOutputDisparityImage * otb::PixelWiseBlockMatchingImageFilter< TInputImage, TOutputMetricImage, TOutputDisparityImage, TMaskImage, TBlockMatchingFunctor >::GetHorizontalDisparityOutput |
Get the disparity output
Definition at line 180 of file otbPixelWiseBlockMatchingImageFilter.hxx.
|
virtual |
The radius of the blocks
|
virtual |
The radius of the blocks
const TInputImage * otb::PixelWiseBlockMatchingImageFilter< TInputImage, TOutputMetricImage, TOutputDisparityImage, TMaskImage, TBlockMatchingFunctor >::GetLeftInput |
Get the inputs
Definition at line 113 of file otbPixelWiseBlockMatchingImageFilter.hxx.
const TMaskImage * otb::PixelWiseBlockMatchingImageFilter< TInputImage, TOutputMetricImage, TOutputDisparityImage, TMaskImage, TBlockMatchingFunctor >::GetLeftMaskInput |
The radius of the blocks
Definition at line 135 of file otbPixelWiseBlockMatchingImageFilter.hxx.
|
virtual |
The radius of the blocks
|
virtual |
The radius of the blocks
TOutputMetricImage* otb::PixelWiseBlockMatchingImageFilter< TInputImage, TOutputMetricImage, TOutputDisparityImage, TMaskImage, TBlockMatchingFunctor >::GetMetricOutput | ( | ) |
The radius of the blocks
TOutputMetricImage * otb::PixelWiseBlockMatchingImageFilter< TInputImage, TOutputMetricImage, TOutputDisparityImage, TMaskImage, TBlockMatchingFunctor >::GetMetricOutput |
Get the metric output
Definition at line 157 of file otbPixelWiseBlockMatchingImageFilter.hxx.
|
virtual |
The radius of the blocks
|
virtual |
The radius of the blocks
|
virtual |
The radius of the blocks
|
virtual |
Run-time type information (and related methods).
|
virtual |
The radius of the blocks
const TInputImage * otb::PixelWiseBlockMatchingImageFilter< TInputImage, TOutputMetricImage, TOutputDisparityImage, TMaskImage, TBlockMatchingFunctor >::GetRightInput |
The radius of the blocks
Definition at line 124 of file otbPixelWiseBlockMatchingImageFilter.hxx.
const TMaskImage * otb::PixelWiseBlockMatchingImageFilter< TInputImage, TOutputMetricImage, TOutputDisparityImage, TMaskImage, TBlockMatchingFunctor >::GetRightMaskInput |
The radius of the blocks
Definition at line 146 of file otbPixelWiseBlockMatchingImageFilter.hxx.
|
virtual |
The radius of the blocks
const TOutputDisparityImage * otb::PixelWiseBlockMatchingImageFilter< TInputImage, TOutputMetricImage, TOutputDisparityImage, TMaskImage, TBlockMatchingFunctor >::GetVerticalDisparityInput |
The radius of the blocks
Definition at line 251 of file otbPixelWiseBlockMatchingImageFilter.hxx.
TOutputDisparityImage* otb::PixelWiseBlockMatchingImageFilter< TInputImage, TOutputMetricImage, TOutputDisparityImage, TMaskImage, TBlockMatchingFunctor >::GetVerticalDisparityOutput | ( | ) |
The radius of the blocks
TOutputDisparityImage * otb::PixelWiseBlockMatchingImageFilter< TInputImage, TOutputMetricImage, TOutputDisparityImage, TMaskImage, TBlockMatchingFunctor >::GetVerticalDisparityOutput |
Get the disparity output
Definition at line 202 of file otbPixelWiseBlockMatchingImageFilter.hxx.
|
virtual |
The radius of the blocks
|
virtual |
The radius of the blocks
|
static |
Method for creation through the object factory.
|
private |
The radius of the blocks
|
virtual |
Set/Get the exploration radius in the disparity space
|
virtual |
Set/Get macro for the grid start index
void otb::PixelWiseBlockMatchingImageFilter< TInputImage, TOutputMetricImage, TOutputDisparityImage, TMaskImage, TBlockMatchingFunctor >::SetHorizontalDisparityInput | ( | const TOutputDisparityImage * | hfield | ) |
Set initial horizontal disparity field (optional, override m_InitHorizontalDisparity)
Definition at line 223 of file otbPixelWiseBlockMatchingImageFilter.hxx.
|
virtual |
Set/Get the initial horizontal disparity
|
virtual |
Set/Get the initial vertical disparity
void otb::PixelWiseBlockMatchingImageFilter< TInputImage, TOutputMetricImage, TOutputDisparityImage, TMaskImage, TBlockMatchingFunctor >::SetLeftInput | ( | const TInputImage * | image | ) |
Set left input
Definition at line 80 of file otbPixelWiseBlockMatchingImageFilter.hxx.
void otb::PixelWiseBlockMatchingImageFilter< TInputImage, TOutputMetricImage, TOutputDisparityImage, TMaskImage, TBlockMatchingFunctor >::SetLeftMaskInput | ( | const TMaskImage * | image | ) |
Set mask input (optional)
Definition at line 96 of file otbPixelWiseBlockMatchingImageFilter.hxx.
|
virtual |
|
virtual |
|
virtual |
The radius of the blocks
|
virtual |
|
virtual |
|
virtual |
Set/Get the radius of the area on which metric is evaluated
|
inline |
Set unsigned int radius
Definition at line 368 of file otbPixelWiseBlockMatchingImageFilter.h.
void otb::PixelWiseBlockMatchingImageFilter< TInputImage, TOutputMetricImage, TOutputDisparityImage, TMaskImage, TBlockMatchingFunctor >::SetRightInput | ( | const TInputImage * | image | ) |
Set right input
Definition at line 88 of file otbPixelWiseBlockMatchingImageFilter.hxx.
void otb::PixelWiseBlockMatchingImageFilter< TInputImage, TOutputMetricImage, TOutputDisparityImage, TMaskImage, TBlockMatchingFunctor >::SetRightMaskInput | ( | const TMaskImage * | image | ) |
Set right mask input (optional)
Definition at line 104 of file otbPixelWiseBlockMatchingImageFilter.hxx.
|
virtual |
Set/Get macro for the subsampling step
void otb::PixelWiseBlockMatchingImageFilter< TInputImage, TOutputMetricImage, TOutputDisparityImage, TMaskImage, TBlockMatchingFunctor >::SetVerticalDisparityInput | ( | const TOutputDisparityImage * | vfield | ) |
Set initial vertical disparity field (optional, override m_InitVerticalDisparity)
Definition at line 231 of file otbPixelWiseBlockMatchingImageFilter.hxx.
|
overrideprotected |
Threaded generate data
Definition at line 472 of file otbPixelWiseBlockMatchingImageFilter.hxx.
|
private |
The exploration radius for disparities (used if non null)
Definition at line 498 of file otbPixelWiseBlockMatchingImageFilter.h.
|
private |
Block-matching functor
Definition at line 501 of file otbPixelWiseBlockMatchingImageFilter.h.
|
private |
Starting index for the subsampled grid. The index is measured with respect to the input image grid Each coordinate shall lie in [0, m_Step-1]
Definition at line 517 of file otbPixelWiseBlockMatchingImageFilter.h.
|
private |
Initial horizontal disparity (0 by default, used if an exploration radius is set and if no input horizontal disparity map is given)
Definition at line 505 of file otbPixelWiseBlockMatchingImageFilter.h.
|
private |
Initial vertical disparity (0 by default, used if an exploration radius is set and if no input vertical disparity map is given)
Definition at line 509 of file otbPixelWiseBlockMatchingImageFilter.h.
|
private |
The max disparity to explore
Definition at line 486 of file otbPixelWiseBlockMatchingImageFilter.h.
|
private |
The max disparity to explore
Definition at line 492 of file otbPixelWiseBlockMatchingImageFilter.h.
|
private |
Should we minimize or maximize ?
Definition at line 495 of file otbPixelWiseBlockMatchingImageFilter.h.
|
private |
The min disparity to explore
Definition at line 483 of file otbPixelWiseBlockMatchingImageFilter.h.
|
private |
The min disparity to explore
Definition at line 489 of file otbPixelWiseBlockMatchingImageFilter.h.
|
private |
The radius of the blocks
Definition at line 480 of file otbPixelWiseBlockMatchingImageFilter.h.
|
private |
Computation step : disparities are computed on locations of a subsampled grid
Definition at line 512 of file otbPixelWiseBlockMatchingImageFilter.h.