diff --git a/Code/BasicFilters/otbMeanShiftSmoothingImageFilter.h b/Code/BasicFilters/otbMeanShiftSmoothingImageFilter.h index 35401cfe1c8830348a044160ce7e962aa88b0167..a333247e5d043fe4505fac9768c90bc3254e3e53 100644 --- a/Code/BasicFilters/otbMeanShiftSmoothingImageFilter.h +++ b/Code/BasicFilters/otbMeanShiftSmoothingImageFilter.h @@ -28,6 +28,9 @@ namespace otb { +namespace Meanshift +{ + template <typename T> inline T simple_pow(T const& v, unsigned int p) { T res = 1; @@ -38,6 +41,7 @@ template <typename T> inline T simple_pow(T const& v, unsigned int p) return res; } + /** \class SpatialRangeJointDomainTransform * * @@ -93,6 +97,7 @@ private: RealType m_RangeBandwidth; }; + class KernelUniform { public: @@ -379,6 +384,8 @@ private: std::vector<int> m_NeighborhoodOffsetVector; }; +} // end namespace Meanshift + /** \class MeanShiftSmoothingImageFilter * * @@ -427,7 +434,7 @@ private: * \ingroup ImageSegmentation * \ingroup ImageEnhancement */ -template <class TInputImage, class TOutputImage, class TKernel = KernelUniform, class TOutputIterationImage = otb::Image<unsigned int, TInputImage::ImageDimension> > +template <class TInputImage, class TOutputImage, class TKernel = Meanshift::KernelUniform, class TOutputIterationImage = otb::Image<unsigned int, TInputImage::ImageDimension> > class ITK_EXPORT MeanShiftSmoothingImageFilter : public itk::ImageToImageFilter<TInputImage, TOutputImage> { @@ -621,7 +628,7 @@ private: of labels */ unsigned int m_ThreadIdNumberOfBits; - typedef BucketImage<RealVectorImageType> BucketImageType; + typedef Meanshift::BucketImage<RealVectorImageType> BucketImageType; BucketImageType m_BucketImage; }; diff --git a/Code/BasicFilters/otbMeanShiftSmoothingImageFilter.txx b/Code/BasicFilters/otbMeanShiftSmoothingImageFilter.txx index 54db76fff952688d7b87b9911392f456e7fdf9b5..5dbbbb48342d0ee2557b20974c6aeb46c12cdd7c 100644 --- a/Code/BasicFilters/otbMeanShiftSmoothingImageFilter.txx +++ b/Code/BasicFilters/otbMeanShiftSmoothingImageFilter.txx @@ -262,7 +262,7 @@ MeanShiftSmoothingImageFilter<TInputImage, TOutputImage, TKernel, TOutputIterati // domain, i.e. spatial coordinates are concatenated to the range values. // Moreover, pixel components in this image are normalized by their respective // (spatial or range) bandwith. - typedef SpatialRangeJointDomainTransform<InputImageType, RealVectorImageType> FunctionType; + typedef Meanshift::SpatialRangeJointDomainTransform<InputImageType, RealVectorImageType> FunctionType; typedef otb::UnaryFunctorWithIndexWithOutputSizeImageFilter<InputImageType, RealVectorImageType, FunctionType> JointImageFunctorType; typename JointImageFunctorType::Pointer jointImageFunctor = JointImageFunctorType::New(); @@ -396,7 +396,7 @@ MeanShiftSmoothingImageFilter<TInputImage, TOutputImage, TKernel, TOutputIterati // An iterator on the neighborhood of the current pixel (in joint // spatial-range domain) - otb::FastImageRegionConstIterator<RealVectorImageType> it(jointImage, neighborhoodRegion); + otb::Meanshift::FastImageRegionConstIterator<RealVectorImageType> it(jointImage, neighborhoodRegion); //itk::ImageRegionConstIterator<RealVectorImageType> it(jointImage, neighborhoodRegion); it.GoToBegin();