Skip to content
Snippets Groups Projects
Commit e069384c authored by Jonathan Guinet's avatar Jonathan Guinet
Browse files

ENH: masked disparity values are filled with no data value in DisparitiesTranslate filter.

parent e612c19e
Branches
Tags
No related merge requests found
...@@ -63,6 +63,7 @@ public: ...@@ -63,6 +63,7 @@ public:
typedef TMaskImage MaskType; typedef TMaskImage MaskType;
typedef TSensorImage SensorType; typedef TSensorImage SensorType;
typedef typename DispMapType::PixelType PixelType;
typedef typename DispMapType::RegionType RegionType; typedef typename DispMapType::RegionType RegionType;
typedef typename DispMapType::SizeType SizeType; typedef typename DispMapType::SizeType SizeType;
typedef typename DispMapType::IndexType IndexType; typedef typename DispMapType::IndexType IndexType;
...@@ -71,6 +72,10 @@ public: ...@@ -71,6 +72,10 @@ public:
typedef typename GridType::RegionType GridRegionType; typedef typename GridType::RegionType GridRegionType;
/** Set/Get macro for NoDataValue */
itkSetMacro(NoDataValue, PixelType);
itkGetConstReferenceMacro(NoDataValue, PixelType);
/** Set the horizontal disparity map */ /** Set the horizontal disparity map */
void SetHorizontalDisparityMapInput( const TDisparityImage * hmap ); void SetHorizontalDisparityMapInput( const TDisparityImage * hmap );
...@@ -123,6 +128,7 @@ private: ...@@ -123,6 +128,7 @@ private:
DisparityTranslateFilter(const Self&); //purposely not implemented DisparityTranslateFilter(const Self&); //purposely not implemented
void operator=(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented
PixelType m_NoDataValue;
}; };
} // end namespace otb } // end namespace otb
......
...@@ -30,6 +30,7 @@ template <class TDisparityImage, class TGridImage, class TSensorImage, class TMa ...@@ -30,6 +30,7 @@ template <class TDisparityImage, class TGridImage, class TSensorImage, class TMa
DisparityTranslateFilter<TDisparityImage,TGridImage,TSensorImage,TMaskImage> DisparityTranslateFilter<TDisparityImage,TGridImage,TSensorImage,TMaskImage>
::DisparityTranslateFilter() ::DisparityTranslateFilter()
{ {
m_NoDataValue = -32768;
// Set the number of inputs (1 moving image by default -> 3 inputs) // Set the number of inputs (1 moving image by default -> 3 inputs)
this->SetNumberOfInputs(6); this->SetNumberOfInputs(6);
this->SetNumberOfRequiredInputs(1); this->SetNumberOfRequiredInputs(1);
...@@ -452,8 +453,8 @@ DisparityTranslateFilter<TDisparityImage,TGridImage,TSensorImage,TMaskImage> ...@@ -452,8 +453,8 @@ DisparityTranslateFilter<TDisparityImage,TGridImage,TSensorImage,TMaskImage>
} }
else else
{ {
horizIter.Set(0); horizIter.Set(m_NoDataValue);
vertiIter.Set(0); vertiIter.Set(m_NoDataValue);
} }
++horizIter; ++horizIter;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment