Skip to content
Snippets Groups Projects
Commit d59fc5b3 authored by Guillaume Borrut's avatar Guillaume Borrut
Browse files

MRG

parents ea571ca3 7089f544
Branches
Tags
No related merge requests found
......@@ -60,8 +60,8 @@ ADD_DEFINITIONS(
#-----------------------------------------------------------------------------
# OTB version number. An even minor number corresponds to releases.
SET(OTB_VERSION_MAJOR "2")
SET(OTB_VERSION_MINOR "9")
SET(OTB_VERSION_MAJOR "3")
SET(OTB_VERSION_MINOR "0")
SET(OTB_VERSION_PATCH "0")
......
......@@ -249,7 +249,6 @@ LineSegmentDetector<TInputImage, TPrecision>
/** Compute the rectangle*/
CoordinateHistogramIteratorType ItRegion = m_RegionList.begin();
DirectionVectorIteratorType ItDir = m_DirectionVector.begin();
std::cout << " NB DE REGIONS : "<< m_RegionList.size()<< std::endl;
while(ItRegion != m_RegionList.end() && ItDir !=m_DirectionVector.end() )
{
......
......@@ -123,11 +123,11 @@ protected:
/**
* Distance between segments computation
*/
virtual float ComputeDistanceBetweenSegments(LineType * lineDst , LineType * lineSrc);
virtual double ComputeDistanceBetweenSegments(LineType * lineDst , LineType * lineSrc);
/**
* Angle computation
*/
virtual float ComputeAngleFormedBySegments(LineType * lineDst , LineType * lineSrc);
virtual double ComputeAngleFormedBySegments(LineType * lineDst , LineType * lineSrc);
/**
* When we find a right angle, one compute the coordinate of the segments intersection
*/
......@@ -137,6 +137,12 @@ protected:
*/
virtual void AddRightAngleToPointSet(PointType rAngle , LineType * LineDst , LineType* LineCur );
/**
* Compute the orienation of a segment
*/
virtual double ComputeOrientation(LineType* line);
private:
......
......@@ -37,9 +37,8 @@ LineSpatialObjectListToRightAnglePointSetFilter<TImage,TLinesList ,TPointSet>
this->SetNumberOfRequiredInputs(2);
this->SetNumberOfRequiredOutputs(1);
m_ThresholdDistance = 5.;
m_ThresholdDistance = 20.;
m_ThresholdAngle = M_PI/36.; //36 cause we want 5 degrees threshold
}
/**
......@@ -100,31 +99,31 @@ LineSpatialObjectListToRightAnglePointSetFilter<TImage,TLinesList ,TPointSet>
while(itLinesListCur != itLinesListCurEnd )
{
/** Check If segments are already computed */
if( segmentsUsedMatrix[counterTest][counterCur]== 0 && segmentsUsedMatrix[counterCur][counterTest] == 0 )
{
if( segmentsUsedMatrix[counterTest][counterCur]== 0 && segmentsUsedMatrix[counterCur][counterTest] == 0 )
{
/** Set the segments to USED (== 1)*/
segmentsUsedMatrix[counterTest][counterCur] = 1;
segmentsUsedMatrix[counterCur][counterTest] = 1;
/** Compute the distance from CurLine to DstLine*/
float SegmentDist = this->ComputeDistanceBetweenSegments(*itLinesListTest , *itLinesListCur);
/** Check if the distance separating the segments is under the threshold*/
if(SegmentDist < m_ThresholdDistance /* Threshold : 5 Pixels*/)
{
/** Compute the angle formed by the two segments */
float Angle = this->ComputeAngleFormedBySegments(*itLinesListTest, *itLinesListCur);
/** Check if the angle is a right one */
if(vcl_abs(Angle - M_PI/2.) <= m_ThresholdAngle )
/** Compute the angle formed by the two segments */
double Angle = this->ComputeAngleFormedBySegments(*itLinesListTest, *itLinesListCur);
/** Check if the angle is a right one */
if(vcl_abs(Angle - M_PI/2.) < m_ThresholdAngle )
{
/** Compute the distance from CurLine to DstLine*/
double SegmentDist = this->ComputeDistanceBetweenSegments(*itLinesListTest , *itLinesListCur);
/** Check if the distance separating the segments is under the threshold*/
if(SegmentDist < m_ThresholdDistance )
{
/** Right angle coordinate*/
/** Right angle coordinate*/
PointType RightAngleCoordinate;
RightAngleCoordinate = this->ComputeAngleRightCoordinate(*itLinesListTest, *itLinesListCur);
/** If Right Angle: Add it to the pointSet*/
this->AddRightAngleToPointSet(RightAngleCoordinate , *itLinesListTest , *itLinesListCur );
}
}
}
......@@ -140,7 +139,7 @@ LineSpatialObjectListToRightAnglePointSetFilter<TImage,TLinesList ,TPointSet>
* Method : ComputeDistanceBetweenSegments
*/
template <class TImage, class TLinesList , class TPointSet>
float
double
LineSpatialObjectListToRightAnglePointSetFilter<TImage,TLinesList ,TPointSet>
::ComputeDistanceBetweenSegments(LineType * lineDst , LineType * lineSrc)
{
......@@ -159,21 +158,6 @@ LineSpatialObjectListToRightAnglePointSetFilter<TImage,TLinesList ,TPointSet>
/** Verify if the indexes of the line are inside the region*/
typename InputImageType::SizeType size = this->GetInputImage()->GetRequestedRegion().GetSize();
//unsigned int width = size[0];
//unsigned int length = size[1];
// if(IndexBeginSrc[0] > width) IndexBeginSrc[0] = width-1;
// if(IndexBeginSrc[1] > length) IndexBeginSrc[1] = length-1;
// if(IndexEndSrc[0] > width) IndexEndSrc[0] = width-1;
// if(IndexEndSrc[1] > length) IndexEndSrc[1] = length-1;
// if(IndexBeginSrc[0] <0) IndexBeginSrc[0] = 0;
// if(IndexBeginSrc[1] <0) IndexBeginSrc[1] = 0;
// if(IndexEndSrc[0]<0) IndexEndSrc[0] = 0;
// if(IndexEndSrc[1]<0) IndexEndSrc[1] = 0;
/** Extract Indexes from the Dst line to instantiate the line iterator*/
typename LineType::PointListType &pointsListDst = lineDst->GetPoints();
......@@ -196,7 +180,7 @@ LineSpatialObjectListToRightAnglePointSetFilter<TImage,TLinesList ,TPointSet>
itk::LineIterator<InputImageType> itLine(this->GetInputImage() , IndexBeginSrc , IndexEndSrc);
itLine.GoToBegin();
float MinDistance = 10000.;
double MinDistance = 10000.;
while(!itLine.IsAtEnd())
{
......@@ -204,12 +188,12 @@ LineSpatialObjectListToRightAnglePointSetFilter<TImage,TLinesList ,TPointSet>
if(this->GetInputImage()->GetRequestedRegion().IsInside(IndexCur) )
{
float xp = static_cast<float>(itLine.GetIndex()[0]);
float yp = static_cast<float>(itLine.GetIndex()[1]);
float Num = vcl_abs(xp*(Yq1-Yq2) + yp*(Xq2-Xq1) + CrossProduct);
double xp = static_cast<float>(itLine.GetIndex()[0]);
double yp = static_cast<float>(itLine.GetIndex()[1]);
double Num = vcl_abs(xp*(Yq1-Yq2) + yp*(Xq2-Xq1) + CrossProduct);
/** distance from Point P to Segment Q1Q2*/
float CurDistance = Num/SegmentLength;
double CurDistance = Num/SegmentLength;
if(CurDistance < MinDistance )
MinDistance = CurDistance;
......@@ -228,42 +212,43 @@ LineSpatialObjectListToRightAnglePointSetFilter<TImage,TLinesList ,TPointSet>
*
*/
template <class TImage, class TLinesList , class TPointSet>
float
double
LineSpatialObjectListToRightAnglePointSetFilter<TImage,TLinesList ,TPointSet>
::ComputeAngleFormedBySegments(LineType * lineDst , LineType * lineSrc)
{
/** ----- */
typename LineType::PointListType & pointsList = lineSrc->GetPoints();
typename LineType::PointListType::const_iterator itPoints = pointsList.begin();
double oriDst = this->ComputeOrientation(lineDst);
double oriSrc = this->ComputeOrientation(lineSrc);
return vcl_abs(oriDst - oriSrc);
}
/**
* Method : ComputeDistanceBetweenSegments
*/
template <class TImage, class TLinesList , class TPointSet>
double
LineSpatialObjectListToRightAnglePointSetFilter<TImage,TLinesList ,TPointSet>
::ComputeOrientation(LineType * line)
{
typename LineType::PointListType & pointsList = line->GetPoints();
typename LineType::PointListType::const_iterator itPoints = pointsList.begin();
float Xp1 = (*itPoints).GetPosition()[0];
float Yp1 = (*itPoints).GetPosition()[1];
++itPoints;
float Xp2 = (*itPoints).GetPosition()[0];
float Yp2 = (*itPoints).GetPosition()[1];
/** Extract Indexes from the Dst line to instantiate the line iterator*/
typename LineType::PointListType &pointsListDst = lineDst->GetPoints();
typename LineType::PointListType::const_iterator itPointsDst = pointsListDst.begin();
float Yp2 = (*itPoints).GetPosition()[1];
float Xq1 = (*itPointsDst).GetPosition()[0]; //xq1
float Yq1 = (*itPointsDst).GetPosition()[1]; //yq1
++itPointsDst;
float Xq2 = (*itPointsDst).GetPosition()[0]; //xq2
float Yq2 = (*itPointsDst).GetPosition()[1]; //yq2
/** Vectors support computation */
float SegmentLengthP = vcl_sqrt( (Xp1-Xp2)* (Xp1-Xp2) + (Yp1-Yp2) *(Yp1-Yp2) );
float SegmentLengthQ = vcl_sqrt( (Xq1-Xq2)* (Xq1-Xq2) + (Yq1-Yq2) *(Yq1-Yq2) );
float X = vcl_abs((Xp1 - Xp2)*(Xq1-Xq2));
float Y = vcl_abs((Yp1 - Yp2)*(Yq1-Yq2));
//Compute the orientation
double dx = Xp1 - Xp2;
double dy = Yp1 - Yp2 ;
double orientation = vcl_atan2(dy,dx);
if(orientation < 0)
orientation += M_PI;
float angle = vcl_acos( ( X + Y )/( SegmentLengthP * SegmentLengthQ )); //Scalar Product
return angle;
return orientation ;
}
/**
* Method : ComputeDistanceBetweenSegments
*/
......@@ -295,7 +280,6 @@ LineSpatialObjectListToRightAnglePointSetFilter<TImage,TLinesList ,TPointSet>
float Xq2 = (*itPointsDst).GetPosition()[0]; //xq2
float Yq2 = (*itPointsDst).GetPosition()[1]; //yq2
//std::cout << "Xp1 " <<Xp1 <<" Yp1 " << Yp1 << " Xp2 " << Xp2 << " Yp2 "<<Yp2 << " Xq1 " <<Xq1 << " Yq1 "<< Yq1 << " Xq2 " << Xq2<< " Yq2 " << Yq2 << std::endl;
/** Compute the equation of the lines A and B which are support of the segments Src & Dst*/
// - Line 1 : slope and origin
......@@ -353,7 +337,7 @@ LineSpatialObjectListToRightAnglePointSetFilter<TImage,TLinesList ,TPointSet>
{
unsigned int CurrentPos = m_OutputPointSet->GetNumberOfPoints();
m_OutputPointSet->SetPoint(CurrentPos ,rAngle );
m_OutputPointSet->SetPoint(CurrentPos ,rAngle);
VectorLineType vectorLine;
vectorLine.push_back(LineDst);
vectorLine.push_back(LineCur);
......@@ -370,6 +354,7 @@ LineSpatialObjectListToRightAnglePointSetFilter<TImage,TLinesList ,TPointSet>
::PrintSelf(std::ostream& os, itk::Indent indent) const
{
Superclass::PrintSelf( os, indent );
}
......
......@@ -37,7 +37,10 @@ GlWidget
}
GlWidget::~GlWidget()
{}
{
// Clear registered controller
m_Controller = NULL;
}
void GlWidget::PrintSelf(std::ostream& os, itk::Indent indent) const
{
......@@ -123,15 +126,17 @@ void GlWidget::resize(int x, int y, int w, int h)
int GlWidget::handle(int event)
{
// If there is a controller
if(m_Controller.IsNotNull())
{
return m_Controller->HandleWidgetEvent(m_Identifier,event);
}
else
// Call superclass implementation
int resp = Fl_Widget::handle(event);
// Check if there is a controller
// Avoid processing hide events, since it causes segfault (the
// destructor of the Fl class generates hide events).
if(m_Controller.IsNotNull() && event != FL_HIDE)
{
return 0;
resp = m_Controller->HandleWidgetEvent(m_Identifier,event);
}
return resp;
}
GlWidget::PointType GlWidget::GetMousePosition()
......
......@@ -131,7 +131,7 @@ public:
}
oss<<", v= "<<static_cast<typename itk::NumericTraits<ScalarPixelType>::PrintType>(vpixel[channel])<<std::endl;
}
else if(channel == m_BlueChannelIndex)
else if(channel == m_GreenChannelIndex)
{
oss<<"c= "<<channel<<", G= "<<(int)output[1];
if(output[1]<100)
......@@ -144,7 +144,7 @@ public:
}
oss<<", v= "<<static_cast<typename itk::NumericTraits<ScalarPixelType>::PrintType>(vpixel[channel])<<std::endl;
}
else if(channel == m_GreenChannelIndex)
else if(channel == m_BlueChannelIndex)
{
oss<<"c= "<<channel<<", B= "<<(int)output[2];
if(output[2]<100)
......
......@@ -337,6 +337,21 @@ ADD_TEST(CloudDetectionExampleTest ${EXE_TESTS2}
553 467 734 581 0.4 0.6 1.0
)
# ------- Right Angle Detection test----------
ADD_TEST(RightAngleDetectionExample ${EXE_TESTS2}
--compare-image ${TOL}
${BASELINE}/RightAngleOutput.png
${TEMP}/PrettyRightAngleOutput.png
RightAngleDetectionExample
${INPUTDATA}/qb_RoadExtract2.tif
${TEMP}/RighAngleOutput.tif
${TEMP}/PrettyRightAngleInput.png
${TEMP}/PrettyRightAngleOutput.png
0.09
20.
)
ADD_EXECUTABLE(otbFeatureExtractionExamplesTests1 otbFeatureExtractionExamplesTests1.cxx)
TARGET_LINK_LIBRARIES(otbFeatureExtractionExamplesTests1 ITKAlgorithms ITKStatistics OTBBasicFilters OTBCommon OTBDisparityMap OTBIO OTBSpatialReasoning OTBChangeDetection OTBFeatureExtraction OTBLearning OTBMultiScale)
......
/*=========================================================================
Program: ORFEO Toolbox
Language: C++
Date: $Date$
Version: $Revision$
Program: ORFEO Toolbox
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details.
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
......@@ -28,10 +28,12 @@
#include "otbLineSpatialObjectList.h"
#include "otbDrawLineSpatialObjectListFilter.h"
#include "otbLineSegmentDetector.h"
#include "itkMinimumMaximumImageCalculator.h"
// Software Guide : BeginCommandLineArgs
// INPUTS: {qb_RoadExtract2.tif}
// OUTPUTS: {RighAngleOutput.tif}, {PrettyRighAngleInput.png}, {PrettyRighAngleOutput.png}
// OUTPUTS: {RighAngleOutput.tif}, {PrettyRighAngleInput.png}, {PrettyRighAngleOutput.png}
// 0.09 20
// Software Guide : EndCommandLineArgs
// Software Guide : BeginLatex
......@@ -58,6 +60,9 @@ int main( int argc, char * argv[] )
const char * outfname = argv[2];
const char * inprettyfname = argv[3];
const char * outprettyfname = argv[4];
double angleThreshold = atof(argv[5]);
double distanceThreshold = atof(argv[6]);
const unsigned int Dimension = 2;
typedef float PixelType;
......@@ -70,115 +75,131 @@ int main( int argc, char * argv[] )
reader->SetFileName(infname);
WriterType::Pointer writer = WriterType::New();
// Software Guide : BeginLatex
//
// After defining, as usual, the types for the input image and the
// image reader, we define the specific types needed for this
// example. First of all, we will use a list of line spatial objects
// to store the detected lines which will be provided by the line
// segment detector.
//
// Software Guide : EndLatex
// Software Guide : BeginLatex
//
// After defining, as usual, the types for the input image and the
// image reader, we define the specific types needed for this
// example. First of all, we will use a list of line spatial objects
// to store the detected lines which will be provided by the line
// segment detector.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
// Software Guide : BeginCodeSnippet
typedef otb::LineSpatialObjectList LinesListType;
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// The right angle detector's output is a pointset where each point
// gives the coordinate of the detected angle. In the data field of
// the pointset, the 2 lines which define the right angle are stored
// in a vector. Therefore we define the 2 following types.
//
// Software Guide : EndLatex
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// The right angle detector's output is a pointset where each point
// gives the coordinate of the detected angle. In the data field of
// the pointset, the 2 lines which define the right angle are stored
// in a vector. Therefore we define the 2 following types.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
// Software Guide : BeginCodeSnippet
typedef LinesListType::LineType LineType;
typedef std::vector<LineType*> LineVectorType;
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// And we can now define the pointset type for storing all the
// information related to the detected right angles.
//
// Software Guide : EndLatex
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// And we can now define the pointset type for storing all the
// information related to the detected right angles.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
// Software Guide : BeginCodeSnippet
typedef itk::PointSet<LineVectorType, Dimension> PointSetType;
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// We define the type for the line segment detector. A detailed
// example for this detector can be found in section \ref{sec:LSD}.
//
// Software Guide : EndLatex
// Software Guide : BeginLatex
//
// We define the type for the line segment detector. A detailed
// example for this detector can be found in section \ref{sec:LSD}.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
// Software Guide : BeginCodeSnippet
typedef otb::LineSegmentDetector<ImageType , PixelType> LsdFilterType;
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// We can finally define the type for the right angle detection
// filter. This filter is templated over the input image type, the
// type of the lines provided by the line segment detector, and the
// output pointset type containing the detected right angles.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
// Software Guide : BeginLatex
//
// We can finally define the type for the right angle detection
// filter. This filter is templated over the input image type, the
// type of the lines provided by the line segment detector, and the
// output pointset type containing the detected right angles.
//
// Software Guide : EndLatex
typedef itk::MinimumMaximumImageCalculator<ImageType> MinMaxFilterType;
// Software Guide : BeginCodeSnippet
typedef otb::LineSpatialObjectListToRightAnglePointSetFilter<ImageType,
LinesListType, PointSetType>
RightAngleFilterType;
LinesListType, PointSetType>
RightAngleFilterType;
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// We instantiate the line segment detector and the right angle detector.
//
// Software Guide : EndLatex
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// We instantiate the line segment detector and the right angle detector.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
// Software Guide : BeginCodeSnippet
LsdFilterType::Pointer lsdFilter = LsdFilterType::New();
RightAngleFilterType::Pointer rightAngleFilter =
RightAngleFilterType::New();
RightAngleFilterType::Pointer rightAngleFilter = RightAngleFilterType::New();
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// We plug the pipeline. The right angle detector has 2 inputs: the
// image to be processed and the previously detected lines.
//
// Software Guide : EndLatex
// Software Guide : EndCodeSnippet
MinMaxFilterType::Pointer minmaxCalculator = MinMaxFilterType::New();
// Software Guide : BeginLatex
//
// We plug the pipeline. The right angle detector has 2 inputs: the
// image to be processed and the previously detected lines.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
// Software Guide : BeginCodeSnippet
lsdFilter->SetInput(reader->GetOutput());
rightAngleFilter->SetInputImage(reader->GetOutput());
rightAngleFilter->SetInput(lsdFilter->GetOutput());
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// You can qualify how far the right angle must the segments be, and the tolerance
// to consider an angle between two segments as an right one.
//
rightAngleFilter->SetThresholdAngle(angleThreshold);
rightAngleFilter->SetThresholdDistance(distanceThreshold);
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
rightAngleFilter->Update();
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// We will now draw the right angles on top of the inout image. For
// this, we get the output of the right angle detector.
//
// Software Guide : EndLatex
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// We will now draw the right angles on top of the inout image. For
// this, we get the output of the right angle detector.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
// Software Guide : BeginCodeSnippet
PointSetType::Pointer segmentOrtho = PointSetType::New();
segmentOrtho = rightAngleFilter->GetOutput();
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// We will iterate through the pointset and get the lines which define
// each right angle stored inside each point of the pointset. The
// lines will be stored into a line list.
//
// Software Guide : EndLatex
// Software Guide : BeginLatex
//
// We will iterate through the pointset and get the lines which define
// each right angle stored inside each point of the pointset. The
// lines will be stored into a line list.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
// Software Guide : BeginCodeSnippet
PointSetType::PointType pRight;
LineVectorType outputVectorLines;
LinesListType::Pointer outputLinesList = LinesListType::New();
......@@ -186,54 +207,57 @@ int main( int argc, char * argv[] )
for (unsigned int i = 0; i<segmentOrtho->GetNumberOfPoints(); i++)
{
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// Even if we do not use it in this example, we show here how to get
// the coordinates of the right angle.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
// Software Guide : BeginLatex
//
// Even if we do not use it in this example, we show here how to get
// the coordinates of the right angle.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
segmentOrtho->GetPoint(i, &pRight);
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// The lines associated to a given angle are obtained using the
// \code{GetPointData} method of the pointset. Then they are stored
// into the list of lines.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
// Software Guide : BeginLatex
//
// The lines associated to a given angle are obtained using the
// \code{GetPointData} method of the pointset. Then they are stored
// into the list of lines.
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
segmentOrtho->GetPointData(i, &outputVectorLines);
outputLinesList->push_back(outputVectorLines[0]);
outputLinesList->push_back(outputVectorLines[1]);
}
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// We will use the \doxygen{otb}{DrawLineSpatialObjectListFilter} to
// draw the list of lines on top of the input image.
//
// Software Guide : EndLatex
// Software Guide : EndCodeSnippet
minmaxCalculator->SetImage(reader->GetOutput());
minmaxCalculator->ComputeMaximum();
// Software Guide : BeginLatex
//
// We will use the \doxygen{otb}{DrawLineSpatialObjectListFilter} to
// draw the list of lines on top of the input image.
// The value assigned to the line is the maximum of the input image.
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
// Software Guide : BeginCodeSnippet
typedef otb::DrawLineSpatialObjectListFilter< ImageType,
ImageType > DrawLineListType;
ImageType > DrawLineListType;
DrawLineListType::Pointer drawLineFilter = DrawLineListType::New();
drawLineFilter->SetInput(reader->GetOutput());
drawLineFilter->SetInputLineSpatialObjectList(outputLinesList);
drawLineFilter->SetValue(minmaxCalculator->GetMaximum());
writer->SetInput(drawLineFilter->GetOutput());
writer->SetFileName(outfname);
reader->GenerateOutputInformation();
writer->Update();
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
// Software Guide : BeginLatex
// Figure~\ref{fig:RIGHTANGLE_FILTER} shows the result of applying
// the right angle detection filter to an image.
// \begin{figure}
......
......@@ -29,9 +29,10 @@ void RegisterTests()
REGISTER_TEST(ExtractRoadExampleTest);
REGISTER_TEST(SeamCarvingExampleTest);
REGISTER_TEST(SeamCarvingOtherExampleTest);
//REGISTER_TEST(ImageToSIFTKeyPointSetFilterTest);
//REGISTER_TEST(ImageToSIFTKeyPointSetFilterTest);
REGISTER_TEST(ScaleInvariantFeatureImageFilterTest);
REGISTER_TEST(CloudDetectionExampleTest);
REGISTER_TEST( RightAngleDetectionExample);
}
#undef main
......@@ -62,3 +63,6 @@ void RegisterTests()
#define main CloudDetectionExampleTest
#include "CloudDetectionExample.cxx"
#undef main
#define main RightAngleDetectionExample
#include "RightAngleDetectionExample.cxx"
......@@ -27,18 +27,18 @@ NB: On some linux plateforms, you may (and should) use the official distribution
1. Install GDAL (or use your distribution package):
cd INSTALL_DIR
gunzip gdal.1.5.2.tar.gz
tar xvf gdal.1.5.2.tar
cd gdal.1.5.2
gunzip gdal.1.6.0.tar.gz
tar xvf gdal.1.6.0.tar
cd gdal.1.6.0
./configure --prefix=INSTALL_DIR
make
make install
2. Install CMake (or use your distribution package):
cd INSTALL_DIR
gunzip cmake-2.6.0.tar.gz
tar xvf cmake-2.6.0.tar
cd cmake-2.6.0
gunzip cmake-3.0.0.tar.gz
tar xvf cmake-3.0.0.tar
cd cmake-3.0.0
./configure --prefix=INSTALL_DIR
make
make install
......@@ -67,18 +67,18 @@ NB: On some linux plateforms, you may (and should) use the official distribution
4. Install OTB
cd INSTALL_DIR
gunzip OrfeoToolbox-2.6.0.tgz
tar xvf OrfeoToolbox-2.6.0.tar
gunzip OrfeoToolbox-3.0.0.tgz
tar xvf OrfeoToolbox-3.0.0.tar
mkdir OTB-Binary
cd OTB-Binary
ccmake ../OrfeoToolbox-2.6.0
ccmake ../OrfeoToolbox-3.0.0
--> follow the CMake instructions, in particular:
--> set BUILD_EXAMPLES to ON within CMake
--> set BUILD_SHARED_LIBS to OFF within CMake
--> set BUILD_TESTING to OFF within CMake
--> set CMAKE_INSTALL_PREFIX to INSTALL_DIR within CMake
--> set GDAL_INCLUDE_DIRS to INSTALL_DIR/include within CMake
--> set GDAL_LIBRARY_DIRS to INSTALL_DIR/lib within CMake
--> set GDAL_LIBRARY to INSTALL_DIR/lib/ gdal library within CMake
--> set OTB_USE_EXTERNAL_ITK to OFF within CMake
--> set FLTK_DIR to INSTALL_DIR/Fltk-Binary within CMake
--> generate the configuration with 'g'
......@@ -97,6 +97,9 @@ Installation on Microsoft Visual Studio .NET 2003 (7.1)
Load the solution (.sln file) and build the gdal project.
More details can be found at http://vterrain.org/Distrib/gdal.html.
Moreover, ORFEO Toolbox projet provided for you binaries windows distribution of gdal1.6.0 library. These files can
be downloaded at http://www.orfeo-toolbox.org/packages
2. Install Fltk
Use CMake on Windows to generate MSVC++ 7.1 project files from fltk sources.
......@@ -218,5 +221,5 @@ Some bugs can appear while compiling GDAL with JPEG2000 files : disable this for
Execution errors can appear on some platforms, using GDAL compiled with MSVC++ 8.0.
This problem can be resolved by downloading GDAL binaries for Windows
at http://vterrain.org/Distrib/gdal.html.
at http://vterrain.org/Distrib/gdal.html or at http://www.orfeo-toolbox.org/packages.
OTB-v.3.0.0 - Changes since version 2.8.0 (2009/05/11)
-----------------------------------------
* Applications
- Urban area extraction (Pléaides, QB, Ikonos, SPOT5). For more details, see the README file
- Image to Data Base registration (Pléiades, QB). For more details, see the README file
- Feature Extraction: add new textures, new radiometric indexes and add MeanShift capabilities
* Library
The library includes these additions
- Cloud detection for QB/Pléiades images
- Alignment and right angle detection (Burns, Grompone)
- Radiometric indices (vegetation, water, soil)
- Optimized texture computations including Haralick, SFS, Pantex, Edge density
- SIFT density image function and filter
- Object-based segmentation and filtering
- LSD line segment detector and right angle detector
- PCA computation
- Automated loading of radiometric correction parameters (SPOT, Ikonos)
- Attribute support for shapefile (reading only)
- Optimization of vector data
- Visualisation refactoring: for more details, see http://wiki.orfeo-toolbox.org/index.php/Visualisation_Refactoring
* System
- Updated OSSIM library
- Updated ITK library (3.12.0)
- Miscellaneous bug fixes (support for gdal 1.6)
- Fixed some problems under Visual and Cygwin platforms.
* Distribution
- Distribution of Windows binaries packages installation for OTB-Application (OTB-Applications-3.0.0-win32.exe)
- Distribution of Windows binaries packages for GDAL library 1.6.0 for MSVC V71 and MSVC V80 compiler
(http://www.orfeo-toolbox.org/packages)
OTB-v.2.8.0 - Changes since version 2.6.0 (2009/01/15)
-----------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment