Skip to content
Snippets Groups Projects
Commit fc7cd8f9 authored by Otmane Lahlou's avatar Otmane Lahlou
Browse files

ENH : Stable version of SURF key point detector

parent 925bb3ec
No related branches found
No related tags found
No related merge requests found
...@@ -9,7 +9,7 @@ Version: $Revision$ ...@@ -9,7 +9,7 @@ Version: $Revision$
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved. Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details. 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. See CSCopyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even This software is distributed WITHOUT ANY WARRANTY; without even
...@@ -183,7 +183,7 @@ namespace otb ...@@ -183,7 +183,7 @@ namespace otb
radius.Fill(GetMin((int)(this->GetInput(0)->GetLargestPossibleRegion().GetSize()[0] - keyPoint[0]), radius.Fill(GetMin((int)(this->GetInput(0)->GetLargestPossibleRegion().GetSize()[0] - keyPoint[0]),
(int)(this->GetInput(0)->GetLargestPossibleRegion().GetSize()[1] - keyPoint[1]), (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 ...@@ -215,6 +215,7 @@ namespace otb
this->GetInput(0)->GetLargestPossibleRegion()); this->GetInput(0)->GetLargestPossibleRegion());
itNeighDescriptor.SetLocation(it.GetIndex()); itNeighDescriptor.SetLocation(it.GetIndex());
VectorType descriptor; VectorType descriptor;
descriptor.resize(64);
//descriptor = ComputeDescriptor(itNeighDescriptor.GetNeighborhood(),keyPoint[3],keyPoint[2]); //descriptor = ComputeDescriptor(itNeighDescriptor.GetNeighborhood(),keyPoint[3],keyPoint[2]);
descriptor = ComputeDescriptor(itNeighDescriptor.GetNeighborhood(),orientationDetected,sigmaDetected); descriptor = ComputeDescriptor(itNeighDescriptor.GetNeighborhood(),orientationDetected,sigmaDetected);
...@@ -359,13 +360,14 @@ namespace otb ...@@ -359,13 +360,14 @@ namespace otb
// Haar Wavelets responses accumulated in an histogram with Pi/3 precison // Haar Wavelets responses accumulated in an histogram with Pi/3 precison
if (( col > pas && col < Largeur - pas ) && ( raw > pas && raw < Largeur - pas) ) 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) ); 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[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; pt[1] = (neigh[col + (raw+pas)* Largeur ] - neigh[col + (raw-pas)*Largeur]) * w;
if (pt[0] + pt[1] != 0) 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 ) if(angle < 0 )
angle += 2*Pi; angle += 2*Pi;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment