Skip to content
Snippets Groups Projects
Commit e3528bd2 authored by Thomas Feuvrier's avatar Thomas Feuvrier
Browse files

Correction des fichiers sur le filtre FillGaps : remplacement du fichier txx par un cxx.

parent 8845e116
No related branches found
No related tags found
No related merge requests found
......@@ -15,8 +15,6 @@
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef __otbFillGapsFilter_txx
#define __otbFillGapsFilter_txx
#include "otbFillGapsFilter.h"
......@@ -27,7 +25,6 @@ namespace otb
* Constructor
*/
#if 0
FillGapsFilter::FillGapsFilter()
{
this->itk::ProcessObject::SetNumberOfRequiredInputs(1);
......@@ -48,7 +45,6 @@ FillGapsFilter
{
this->itk::ProcessObject::SetNthInput(0,
const_cast< LineSpatialObjectListType * >( input ) );
}
......@@ -60,6 +56,7 @@ FillGapsFilter
(this->itk::ProcessObject::GetInput(0) );
}
FillGapsFilter::LineSpatialObjectListType *
FillGapsFilter
::GetOutput(void)
......@@ -159,7 +156,8 @@ FillGapsFilter
if(R14 < Rmin) Rmin = R14;
if(R23 < Rmin) Rmin = R23;
if(R24 < Rmin) Rmin = R24;
if(Rmin < m_Radius)
{
// Sort Points such as the radius of P2 and P3 is the smallest one.
......@@ -175,7 +173,7 @@ FillGapsFilter
x1 = x2 ; y1 = y2;
x2 = xTemp; y2 = yTemp;
}
if(Rmin == R13 )
if(Rmin == R14 )
{
xTemp = x3 ; yTemp = y3 ;
x3 = x4 ; y3 = y4;
......@@ -186,21 +184,28 @@ FillGapsFilter
}
//Estimate the norm each line
double Norm12,Norm23,Norm34;
/* double Norm12,Norm23,Norm34;
Norm12 = sqrt( (x1-x2)*(x1-x2) + (y1-y2)*(y1-y2) );
Norm23 = sqrt( (x2-x3)*(x2-x3) + (y2-y3)*(y2-y3) );
Norm34 = sqrt( (x3-x4)*(x3-x4) + (y3-y4)*(y3-y4) );
double Angle12_23,Angle12_34;
*/
double Angle12_23,Angle12_34,Angle23_34;
//Estimate the angle between lines 12-23 and lines 12-34
Angle12_23 = (x2-x1)*(x3-x2) + (y2-y1)*(y3-y2);
/*Angle12_23 = (x2-x1)*(x3-x2) + (y2-y1)*(y3-y2);
Angle12_23 = Angle12_23 / Norm12 / Norm23;
Angle12_34 = (x2-x1)*(x4-x3) + (y2-y1)*(y4-y3);
Angle12_34 = Angle12_34 / Norm12 / Norm34;
Angle12_34 = Angle12_34 / Norm12 / Norm34;*/
Angle12_23 = cos(atan2((y2-y1), (x2-x1))-atan2((y3-y2), (x3-x2)));
Angle12_34 = cos(atan2((y2-y1), (x2-x1))-atan2((y4-y3), (x4-x3)));
Angle23_34 = cos(atan2((y3-y2), (x3-x2))-atan2((y4-y3), (x4-x3)));
if( (Angle12_23 > CosTheta) && (Angle12_34 > CosTheta) )
if( (Angle12_23 > CosTheta) && (Angle12_34 > CosTheta) && (Angle23_34 > CosTheta) )
{
// Store 23-segment
PointType point;
PointListType pointList;
......@@ -244,8 +249,6 @@ FillGapsFilter
pointList.clear();
}
......@@ -257,11 +260,9 @@ void
FillGapsFilter
::PrintSelf(std::ostream& os, itk::Indent indent) const
{
Superclass::PrintSelf(os,indent);
Superclass::PrintSelf(os,indent);
}
#endif
} // end namespace otb
......
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