From fc7cd8f9978813cb9d72c8a93b24d622ca244f61 Mon Sep 17 00:00:00 2001 From: Otmane Lahlou <otmane.lahlou@c-s.fr> Date: Wed, 3 Dec 2008 14:40:10 +0100 Subject: [PATCH] ENH : Stable version of SURF key point detector --- .../FeatureExtraction/otbImageToSURFKeyPointSetFilter.txx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Code/FeatureExtraction/otbImageToSURFKeyPointSetFilter.txx b/Code/FeatureExtraction/otbImageToSURFKeyPointSetFilter.txx index 4d58522d7a..35e761797a 100644 --- a/Code/FeatureExtraction/otbImageToSURFKeyPointSetFilter.txx +++ b/Code/FeatureExtraction/otbImageToSURFKeyPointSetFilter.txx @@ -9,7 +9,7 @@ Version: $Revision$ Copyright (c) Centre National d'Etudes Spatiales. All rights reserved. See OTBCopyright.txt for details. -Copyright (c) CS Systemes d'information. All rights reserved. +Copyright (c) CS systèmes d'information. All rights reserved. See CSCopyright.txt for details. This software is distributed WITHOUT ANY WARRANTY; without even @@ -183,7 +183,7 @@ namespace otb radius.Fill(GetMin((int)(this->GetInput(0)->GetLargestPossibleRegion().GetSize()[0] - keyPoint[0]), (int)(this->GetInput(0)->GetLargestPossibleRegion().GetSize()[1] - keyPoint[1]), - (int)(6*keyPoint[2]) ) ) ; + (int)(6*sigmaDetected) ) ) ; // changer le sigma detected par keypoint[2] @@ -215,6 +215,7 @@ namespace otb this->GetInput(0)->GetLargestPossibleRegion()); itNeighDescriptor.SetLocation(it.GetIndex()); VectorType descriptor; + descriptor.resize(64); //descriptor = ComputeDescriptor(itNeighDescriptor.GetNeighborhood(),keyPoint[3],keyPoint[2]); descriptor = ComputeDescriptor(itNeighDescriptor.GetNeighborhood(),orientationDetected,sigmaDetected); @@ -359,13 +360,14 @@ namespace otb // Haar Wavelets responses accumulated in an histogram with Pi/3 precison if (( col > pas && col < Largeur - pas ) && ( raw > pas && raw < Largeur - pas) ) { + w = vcl_exp(-((col-rayon)*(col-rayon) + (raw-rayon)*(raw-rayon))/(2*2.5*2.5*S*S) ); pt[0] = (neigh[(col+pas) + raw * Largeur] - neigh[(col-pas) + raw *Largeur ]) * w ; pt[1] = (neigh[col + (raw+pas)* Largeur ] - neigh[col + (raw-pas)*Largeur]) * w; if (pt[0] + pt[1] != 0) { - angle = atan( pt[0]/pt[1] )*( Pi/3.1415); + angle = atan( pt[0]/pt[1] )*( Pi/M_PI); if(angle < 0 ) angle += 2*Pi; -- GitLab