Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Youssefi
otb
Commits
dbd4a67b
Commit
dbd4a67b
authored
16 years ago
by
Emmanuel Christophe
Browse files
Options
Downloads
Patches
Plain Diff
TEST: add non regression test for ImageFittingPolygon
parent
561d0f4b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Testing/Code/FeatureExtraction/CMakeLists.txt
+1
-1
1 addition, 1 deletion
Testing/Code/FeatureExtraction/CMakeLists.txt
Testing/Code/FeatureExtraction/otbImageFittingPolygonListFilter.cxx
+7
-6
7 additions, 6 deletions
...de/FeatureExtraction/otbImageFittingPolygonListFilter.cxx
with
8 additions
and
7 deletions
Testing/Code/FeatureExtraction/CMakeLists.txt
+
1
−
1
View file @
dbd4a67b
...
@@ -848,7 +848,7 @@ ADD_TEST(feTvImageFittingPolygonListFilter ${FEATUREEXTRACTION_TESTS9}
...
@@ -848,7 +848,7 @@ ADD_TEST(feTvImageFittingPolygonListFilter ${FEATUREEXTRACTION_TESTS9}
--compare-ascii
${
EPS
}
--compare-ascii
${
EPS
}
${
BASELINE_FILES
}
/feTvImageFittingPolygonListFilter_Output.kml
${
BASELINE_FILES
}
/feTvImageFittingPolygonListFilter_Output.kml
${
TEMP
}
/feTvImageFittingPolygonListFilter_Output.kml
${
TEMP
}
/feTvImageFittingPolygonListFilter_Output.kml
otbImage
ToSIFTKeyPointSetFilterOutputAscii
otbImage
FittingPolygonListFilter
${
INPUTDATA
}
/polygon.png
${
INPUTDATA
}
/polygon.png
${
INPUTDATA
}
/polygon-start.kml
${
INPUTDATA
}
/polygon-start.kml
${
TEMP
}
/feTvImageFittingPolygonListFilter_Output.kml
${
TEMP
}
/feTvImageFittingPolygonListFilter_Output.kml
...
...
This diff is collapsed.
Click to expand it.
Testing/Code/FeatureExtraction/otbImageFittingPolygonListFilter.cxx
+
7
−
6
View file @
dbd4a67b
...
@@ -50,7 +50,6 @@ int otbImageFittingPolygonListFilter(int argc, char * argv[])
...
@@ -50,7 +50,6 @@ int otbImageFittingPolygonListFilter(int argc, char * argv[])
CannyFilterType
::
Pointer
canny
=
CannyFilterType
::
New
();
CannyFilterType
::
Pointer
canny
=
CannyFilterType
::
New
();
canny
->
SetInput
(
reader
->
GetOutput
());
canny
->
SetInput
(
reader
->
GetOutput
());
//Read the original polygon list (kml file)
//Read the original polygon list (kml file)
typedef
otb
::
VectorData
<>
VectorDataType
;
typedef
otb
::
VectorData
<>
VectorDataType
;
typedef
VectorDataType
::
DataTreeType
DataTreeType
;
typedef
VectorDataType
::
DataTreeType
DataTreeType
;
...
@@ -63,6 +62,7 @@ int otbImageFittingPolygonListFilter(int argc, char * argv[])
...
@@ -63,6 +62,7 @@ int otbImageFittingPolygonListFilter(int argc, char * argv[])
readerVector
->
SetFileName
(
polyFileName
);
readerVector
->
SetFileName
(
polyFileName
);
readerVector
->
Update
();
readerVector
->
Update
();
//Copy the polygons of the data tree in a polygon list
typedef
otb
::
ObjectList
<
PolygonType
>
PolygonListType
;
typedef
otb
::
ObjectList
<
PolygonType
>
PolygonListType
;
PolygonListType
::
Pointer
polygonList
=
PolygonListType
::
New
();
PolygonListType
::
Pointer
polygonList
=
PolygonListType
::
New
();
...
@@ -76,6 +76,7 @@ int otbImageFittingPolygonListFilter(int argc, char * argv[])
...
@@ -76,6 +76,7 @@ int otbImageFittingPolygonListFilter(int argc, char * argv[])
{
{
polygonList
->
PushBack
(
dataNode
->
GetPolygonExteriorRing
());
polygonList
->
PushBack
(
dataNode
->
GetPolygonExteriorRing
());
}
}
++
it
;
}
}
//Fit the polygons on the image
//Fit the polygons on the image
...
@@ -89,21 +90,17 @@ int otbImageFittingPolygonListFilter(int argc, char * argv[])
...
@@ -89,21 +90,17 @@ int otbImageFittingPolygonListFilter(int argc, char * argv[])
fittingPolygon
->
Update
();
fittingPolygon
->
Update
();
//
Read
the improved polygon list (kml file)
//
Write
the improved polygon list (kml file)
VectorDataType
::
Pointer
data
=
VectorDataType
::
New
();
VectorDataType
::
Pointer
data
=
VectorDataType
::
New
();
DataNodeType
::
Pointer
document
=
DataNodeType
::
New
();
DataNodeType
::
Pointer
document
=
DataNodeType
::
New
();
DataNodeType
::
Pointer
folder
=
DataNodeType
::
New
();
DataNodeType
::
Pointer
folder
=
DataNodeType
::
New
();
DataNodeType
::
Pointer
polygon
=
DataNodeType
::
New
();
document
->
SetNodeType
(
otb
::
DOCUMENT
);
document
->
SetNodeType
(
otb
::
DOCUMENT
);
folder
->
SetNodeType
(
otb
::
FOLDER
);
folder
->
SetNodeType
(
otb
::
FOLDER
);
polygon
->
SetNodeType
(
otb
::
FEATURE_POLYGON
);
document
->
SetNodeId
(
"DOCUMENT"
);
document
->
SetNodeId
(
"DOCUMENT"
);
folder
->
SetNodeId
(
"FOLDER"
);
folder
->
SetNodeId
(
"FOLDER"
);
polygon
->
SetNodeId
(
"FEATURE_POLYGON"
);
DataNodeType
::
Pointer
root
=
data
->
GetDataTree
()
->
GetRoot
()
->
Get
();
DataNodeType
::
Pointer
root
=
data
->
GetDataTree
()
->
GetRoot
()
->
Get
();
...
@@ -114,8 +111,12 @@ int otbImageFittingPolygonListFilter(int argc, char * argv[])
...
@@ -114,8 +111,12 @@ int otbImageFittingPolygonListFilter(int argc, char * argv[])
ListIteratorType
listIt
=
fittingPolygon
->
GetOutput
()
->
Begin
();
ListIteratorType
listIt
=
fittingPolygon
->
GetOutput
()
->
Begin
();
while
(
listIt
!=
fittingPolygon
->
GetOutput
()
->
End
())
while
(
listIt
!=
fittingPolygon
->
GetOutput
()
->
End
())
{
{
DataNodeType
::
Pointer
polygon
=
DataNodeType
::
New
();
polygon
->
SetNodeType
(
otb
::
FEATURE_POLYGON
);
polygon
->
SetNodeId
(
"FEATURE_POLYGON"
);
polygon
->
SetPolygonExteriorRing
(
listIt
.
Get
());
polygon
->
SetPolygonExteriorRing
(
listIt
.
Get
());
data
->
GetDataTree
()
->
Add
(
polygon
,
folder
);
data
->
GetDataTree
()
->
Add
(
polygon
,
folder
);
++
listIt
;
}
}
typedef
otb
::
VectorDataFileWriter
<
VectorDataType
>
WriterType
;
typedef
otb
::
VectorDataFileWriter
<
VectorDataType
>
WriterType
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment