Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
otb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
273
Issues
273
List
Boards
Labels
Service Desk
Milestones
Merge Requests
8
Merge Requests
8
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Main Repositories
otb
Commits
2bcd4bbe
Commit
2bcd4bbe
authored
Jan 08, 2010
by
Manuel Grizonnet
Browse files
Options
Browse Files
Download
Plain Diff
Automated merge with
http://hg.orfeo-toolbox.org/OTB
parents
296da2ae
bb1a31af
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
74 additions
and
10 deletions
+74
-10
Examples/IO/VectorDataIOExample.cxx
Examples/IO/VectorDataIOExample.cxx
+15
-0
Examples/OBIA/CMakeLists.txt
Examples/OBIA/CMakeLists.txt
+15
-0
Examples/OBIA/ShapeAttributeComputation.cxx
Examples/OBIA/ShapeAttributeComputation.cxx
+1
-1
Examples/OBIA/otbOBIAExamplesTests.cxx
Examples/OBIA/otbOBIAExamplesTests.cxx
+5
-0
Examples/OBIA/otbRadiometricAttributesLabelMapFilterExample.cxx
...es/OBIA/otbRadiometricAttributesLabelMapFilterExample.cxx
+36
-7
Testing/Code/Common/otbLabelMapToVectorDataFilter.cxx
Testing/Code/Common/otbLabelMapToVectorDataFilter.cxx
+2
-2
No files found.
Examples/IO/VectorDataIOExample.cxx
View file @
2bcd4bbe
...
...
@@ -31,6 +31,9 @@
// Even though specific reader/writer for Shapefile and the Google KML
// are available in OTB, we designed a generic approach for the IO of
// this kind of data.
// The reader/writer for VectorData in OTB is able to access to a variety of
// vector file formats (all OGR supported formats)
//
// In section \ref{sec:VectorDataProjection}, you will find more information on
// how projections work for the vector data and how you can export
...
...
@@ -260,4 +263,16 @@ int main(int argc, char * argv[])
// Software Guide : EndCodeSnippet
return
EXIT_SUCCESS
;
// Software Guide : BeginLatex
//
// This example can convert an ESRI Shapefile to
// a MapInfo File but you can also access with the same OTB source code
// to a PostgreSQL datasource,using a connection string as :
// PG:"dbname='databasename' host='addr' port='5432' user='x' password='y'"
// Starting with GDAL 1.6.0, the set of tables to be scanned can be overridden
// by specifying tables=[schema.]table[(geom_column_name)].
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
}
Examples/OBIA/CMakeLists.txt
View file @
2bcd4bbe
...
...
@@ -48,6 +48,21 @@ ADD_TEST(trTeOBIAShapeAttributeComputationTest ${EXE_TESTS}
${
INPUTDATA
}
/MSLabeledOutput.tif
${
TEMP
}
/OBIAShapeAttribute.txt
)
ADD_TEST
(
trTeOBIARadiometricAttributesLabelMapFilterTest
${
EXE_TESTS
}
--compare-image
${
TOL
}
${
BASELINE
}
/OBIARadiometricAttributes.tif
${
TEMP
}
/OBIARadiometricAttributes.tif
OBIARadiometricAttributesTest
${
INPUTDATA
}
/qb_RoadExtract2.tif
${
TEMP
}
/OBIARadiometricAttributes.txt
STATS::Ndvi::Mean
0
0.3
16
16
200
1.0
)
#need to add the test of radiometric labelmap filter
...
...
Examples/OBIA/ShapeAttributeComputation.cxx
View file @
2bcd4bbe
...
...
@@ -67,7 +67,7 @@ int main(int argc, char * argv[])
typedef
itk
::
LabelImageToLabelMapFilter
<
ImageType
,
LabelMapType
>
ConverterType
;
ConverterType
::
Pointer
converter
=
ConverterType
::
New
();
converter
->
SetInput
(
reader
->
GetOutput
()
);
// converter->SetForegroundValue( atoi(argv[2]
) );
converter
->
SetBackgroundValue
(
itk
::
NumericTraits
<
LabelType
>::
min
(
)
);
typedef
itk
::
ShapeLabelMapFilter
<
LabelMapType
>
ShapeFilterType
;
ShapeFilterType
::
Pointer
shape
=
ShapeFilterType
::
New
();
...
...
Examples/OBIA/otbOBIAExamplesTests.cxx
View file @
2bcd4bbe
...
...
@@ -27,6 +27,7 @@ void RegisterTests()
{
REGISTER_TEST
(
OBIAImageToLabelToImageTest
);
REGISTER_TEST
(
OBIAShapeAttributeComputationTest
);
REGISTER_TEST
(
OBIARadiometricAttributesTest
);
}
#undef main
...
...
@@ -36,3 +37,7 @@ void RegisterTests()
#undef main
#define main OBIAShapeAttributeComputationTest
#include "ShapeAttributeComputation.cxx"
#undef main
#define main OBIARadiometricAttributesTest
#include "otbRadiometricAttributesLabelMapFilterExample.cxx"
Examples/OBIA/otbRadiometricAttributesLabelMapFilterExample.cxx
View file @
2bcd4bbe
...
...
@@ -23,7 +23,29 @@
// Software Guide : BeginLatex
//
// This example shows the basic approch to perform
// This example shows the basic approch to perform object based analysis on a image.
// The input image is firstly segmented using the \doxygen{otb}{MeanShiftImageFilter}
// Then each segmented region is converted to a Map of labeled objects.
// After the \doxygen{otb}{RadiometricAttributesLabelMapFilter} computes computes
// radiometric attributes for each object.
// Images are supposed to be standard 4-bands image (B,G,R,NIR). The
// index of each channel can be set via the Set***ChannelIndex()
// accessors.
//
// This filter internally applies the
// StatisticsAttributesLabelMapFilter to the following features:
// \begin{itemize}
// \item GEMI
// \item NDVI
// \item IR
// \item IC
// \item IB
// \item NDWI2
// \item Intensity
// \item and original B, G, R and NIR channels
// \end{itemize},
// Here we use the \doxygen{otb}{AttributesMapOpeningLabelMapFilter} to extract vegetated areas.
//
//
// Software Guide : EndLatex
...
...
@@ -87,19 +109,26 @@ int main(int argc, char * argv[])
ReaderType
::
Pointer
reader
=
ReaderType
::
New
();
reader
->
SetFileName
(
reffname
);
//std::cout << reffname << std::endl;
//reader->Update();
//std::cout << reffname << std::endl;
VectorReaderType
::
Pointer
vreader
=
VectorReaderType
::
New
();
vreader
->
SetFileName
(
reffname
);
//Segment the ref image using Mean Shift
// Software Guide : BeginCodeSnippet
typedef
otb
::
MeanShiftImageFilter
<
ImageType
,
ImageType
,
LabeledImageType
>
FilterType
;
FilterType
::
Pointer
filter
=
FilterType
::
New
();
filter
->
SetSpatialRadius
(
spatialRadius
);
filter
->
SetRangeRadius
(
rangeRadius
);
filter
->
SetMinimumRegionSize
(
minRegionSize
);
filter
->
SetScale
(
scale
);
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
//
// The \doxygen{otb}{MeanShiftImageFilter} type is instantiated using the images
// types.
//
// Software Guide : EndLatex
filter
->
SetInput
(
reader
->
GetOutput
());
LabelMapFilterType
::
Pointer
labelMapFilter
=
LabelMapFilterType
::
New
();
...
...
@@ -118,9 +147,9 @@ int main(int argc, char * argv[])
RadiometricLabelMapFilterType
::
Pointer
radiometricLabelMapFilter
=
RadiometricLabelMapFilterType
::
New
();
radiometricLabelMapFilter
->
SetInput1
(
statisticsLabelMapFilter
->
GetOutput
());
radiometricLabelMapFilter
->
SetInput2
(
vreader
->
GetOutput
());
//radiometricLabelMapFilter->SetReducedAttributeSet(false);
radiometricLabelMapFilter
->
SetRedChannelIndex
(
1
);
radiometricLabelMapFilter
->
SetNIRChannelIndex
(
2
);
radiometricLabelMapFilter
->
SetRedChannelIndex
(
2
);
radiometricLabelMapFilter
->
SetNIRChannelIndex
(
3
);
radiometricLabelMapFilter
->
Update
();
OpeningLabelMapFilterType
::
Pointer
opening
=
OpeningLabelMapFilterType
::
New
();
...
...
Testing/Code/Common/otbLabelMapToVectorDataFilter.cxx
View file @
2bcd4bbe
...
...
@@ -20,11 +20,11 @@
#include "otbVectorDataFileWriter.h"
#include "otbVectorData.h"
#include "otbVectorDataProjectionFilter.h"
//#include "otbVectorDataExtractROI.h"
#include <fstream>
#include <iostream>
//#include "itkRGBAPixel.h"
#include "otbImage.h"
#include "otbLabelMapToVectorDataFilter.h"
#include "otbAttributesMapLabelObject.h"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment