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

ENH : last update for the segment between segment computation

parent 4981b224
No related branches found
No related tags found
No related merge requests found
......@@ -38,7 +38,7 @@ LineSpatialObjectListToRightAnglePointSetFilter<TImage,TLinesList ,TPointSet>
this->SetNumberOfRequiredOutputs(1);
m_ThresholdDistance = 20.;
m_ThresholdAngle = M_PI/36.; //36 cause we want 5 degrees threshold
m_ThresholdAngle = M_PI/30.; //36 cause we want 6 degrees threshold
}
/**
......@@ -116,8 +116,15 @@ LineSpatialObjectListToRightAnglePointSetFilter<TImage,TLinesList ,TPointSet>
RightAngleCoordinate = this->ComputeAngleRightCoordinate(*itLinesListTest, *itLinesListCur);
/** Compute the distance between the two segments and the right angle formed by this segments*/
if(this->ComputeDistanceFromPointToSegment(RightAngleCoordinate,*itLinesListTest) <m_ThresholdDistance &&
this->ComputeDistanceFromPointToSegment(RightAngleCoordinate,*itLinesListCur) <m_ThresholdDistance)
double dist1 = this->ComputeDistanceFromPointToSegment(RightAngleCoordinate,*itLinesListTest);
double dist2 = this->ComputeDistanceFromPointToSegment(RightAngleCoordinate,*itLinesListCur) ;
/** Use Pythagore to compute the distance between the two segments*/
double SegmentDistance = vcl_sqrt(dist1*dist1 + dist2*dist2);
// if(this->ComputeDistanceFromPointToSegment(RightAngleCoordinate,*itLinesListTest) <m_ThresholdDistance &&
// this->ComputeDistanceFromPointToSegment(RightAngleCoordinate,*itLinesListCur) <m_ThresholdDistance)
if(SegmentDistance < m_ThresholdDistance)
{
/** If Right Angle & not so far from segments: Add it to the pointSet*/
this->AddRightAngleToPointSet(RightAngleCoordinate , *itLinesListTest , *itLinesListCur );
......
......@@ -348,8 +348,8 @@ ADD_TEST(RightAngleDetectionExample ${EXE_TESTS2}
${TEMP}/RighAngleOutput.tif
${TEMP}/PrettyRightAngleInput.png
${TEMP}/PrettyRightAngleOutput.png
0.09
20.
0.1
35.
)
ADD_EXECUTABLE(otbFeatureExtractionExamplesTests1 otbFeatureExtractionExamplesTests1.cxx)
......
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