From f7cec7d05d9db8d1b2e04b817e930582c26f1c6b Mon Sep 17 00:00:00 2001
From: Julien Michel <julien.michel@orfeo-toolbox.org>
Date: Tue, 6 Mar 2012 14:18:22 +0100
Subject: [PATCH] MRG

---
 .../otbPixelWiseBlockMatchingImageFilter.h        | 15 +++++++++++++++
 .../otbPixelWiseBlockMatchingImageFilter.txx      |  3 +--
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/Code/DisparityMap/otbPixelWiseBlockMatchingImageFilter.h b/Code/DisparityMap/otbPixelWiseBlockMatchingImageFilter.h
index 4fc9c9d115..52daf0b5e0 100644
--- a/Code/DisparityMap/otbPixelWiseBlockMatchingImageFilter.h
+++ b/Code/DisparityMap/otbPixelWiseBlockMatchingImageFilter.h
@@ -275,6 +275,18 @@ public:
     return m_Functor;
   }
 
+  /** Get the functor for parameters setting */
+  BlockMatchingFunctorType &  GetFunctor()
+  {
+    return m_Functor;
+  }
+
+  /** Get the functor (const version) */
+  const BlockMatchingFunctorType &  GetFunctor() const
+  {
+    return m_Functor;
+  }
+
   /** Set initial horizontal disparity field (optional, override m_InitHorizontalDisparity) */
   void SetHorizontalDisparityInput( const TOutputDisparityImage * hfield);
 
@@ -326,6 +338,9 @@ private:
   /** The exploration radius for disparities (used if non null) */
   SizeType                      m_ExplorationRadius;
 
+  /** Block-matching functor */
+  BlockMatchingFunctorType      m_Functor;  
+
   /** Block-matching functor */
   BlockMatchingFunctorType      m_Functor;  
   
diff --git a/Code/DisparityMap/otbPixelWiseBlockMatchingImageFilter.txx b/Code/DisparityMap/otbPixelWiseBlockMatchingImageFilter.txx
index 2a496139fe..8742137440 100644
--- a/Code/DisparityMap/otbPixelWiseBlockMatchingImageFilter.txx
+++ b/Code/DisparityMap/otbPixelWiseBlockMatchingImageFilter.txx
@@ -483,7 +483,6 @@ TOutputDisparityImage,TMaskImage,TBlockMatchingFunctor>
       useInitDispMaps = true;
       }
     }
-
   // We loop on disparities
   for(int vdisparity = m_MinimumVerticalDisparity; vdisparity <= m_MaximumVerticalDisparity; ++vdisparity)
     {
@@ -599,7 +598,7 @@ TOutputDisparityImage,TMaskImage,TBlockMatchingFunctor>
             hdisparity >= estimatedMinHDisp && hdisparity <= estimatedMaxHDisp)
           {
           // Compute the block matching value
-          double metric = bmFunctor(leftIt,rightIt);
+        double metric = m_Functor(leftIt,rightIt);
   
           // If we are at first loop, fill both outputs
           if(vdisparity == estimatedMinVDisp && hdisparity == estimatedMinHDisp)
-- 
GitLab