21 #ifndef otbSubPixelDisparityImageFilter_h
22 #define otbSubPixelDisparityImageFilter_h
26 #include "itkTranslationTransform.h"
27 #include "itkResampleImageFilter.h"
65 template <
class TInputImage,
class TOutputMetricImage,
class TDisparityImage = TOutputMetricImage,
class TMaskImage = otb::Image<
unsigned char>,
66 class TBlockMatchingFunctor = Functor::SSDBlockMatching<TInputImage, TOutputMetricImage>>
72 typedef itk::ImageToImageFilter<TInputImage, TDisparityImage>
Superclass;
89 typedef typename InputImageType::SizeType
SizeType;
90 typedef typename InputImageType::IndexType
IndexType;
93 typedef typename InputImageType::PointType
PointType;
106 itkStaticConstMacro(PARABOLIC,
int, 0);
107 itkStaticConstMacro(TRIANGULAR,
int, 1);
108 itkStaticConstMacro(DICHOTOMY,
int, 2);
111 void SetLeftInput(
const TInputImage* image);
114 void SetRightInput(
const TInputImage* image);
117 void SetHorizontalDisparityInput(
const TDisparityImage* hfield);
120 void SetVerticalDisparityInput(
const TDisparityImage* vfield);
123 void SetMetricInput(
const TOutputMetricImage* image);
126 const TDisparityImage* GetHorizontalDisparityInput()
const;
127 const TDisparityImage* GetVerticalDisparityInput()
const;
131 void SetLeftMaskInput(
const TMaskImage* image);
134 void SetRightMaskInput(
const TMaskImage* image);
137 const TInputImage* GetLeftInput()
const;
138 const TInputImage* GetRightInput()
const;
139 const TMaskImage* GetLeftMaskInput()
const;
140 const TMaskImage* GetRightMaskInput()
const;
144 const TOutputMetricImage* GetMetricOutput()
const;
145 TOutputMetricImage* GetMetricOutput();
149 const TDisparityImage* GetHorizontalDisparityOutput()
const;
150 TDisparityImage* GetHorizontalDisparityOutput();
154 const TDisparityImage* GetVerticalDisparityOutput()
const;
155 TDisparityImage* GetVerticalDisparityOutput();
161 m_Radius.Fill(radius);
165 itkSetMacro(Radius, SizeType);
166 itkGetConstReferenceMacro(Radius, SizeType);
170 itkSetMacro(MinimumHorizontalDisparity,
int);
171 itkGetConstReferenceMacro(MinimumHorizontalDisparity,
int);
175 itkSetMacro(MaximumHorizontalDisparity,
int);
176 itkGetConstReferenceMacro(MaximumHorizontalDisparity,
int);
180 itkSetMacro(MinimumVerticalDisparity,
int);
181 itkGetConstReferenceMacro(MinimumVerticalDisparity,
int);
185 itkSetMacro(MaximumVerticalDisparity,
int);
186 itkGetConstReferenceMacro(MaximumVerticalDisparity,
int);
189 itkSetMacro(Minimize,
bool);
190 itkGetConstReferenceMacro(Minimize,
bool);
191 itkBooleanMacro(Minimize);
206 itkSetMacro(RefineMethod,
int);
207 itkGetMacro(RefineMethod,
int);
210 void SetInputsFromBlockMatchingFilter(
const BlockMatchingFilterType* filter);
224 void VerifyInputInformation()
override;
227 void GenerateOutputInformation()
override;
230 void GenerateInputRequestedRegion()
override;
233 void BeforeThreadedGenerateData()
override;
236 void ThreadedGenerateData(
const RegionType& outputRegionForThread, itk::ThreadIdType threadId)
override;
239 void AfterThreadedGenerateData()
override;
243 void operator=(
const Self&) =
delete;
246 void ParabolicRefinement(
const RegionType& outputRegionForThread, itk::ThreadIdType threadId);
249 void TriangularRefinement(
const RegionType& outputRegionForThread, itk::ThreadIdType threadId);
252 void DichotomyRefinement(
const RegionType& outputRegionForThread, itk::ThreadIdType threadId);
289 #ifndef OTB_MANUAL_INSTANTIATION