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
d8842f76
Commit
d8842f76
authored
13 years ago
by
Julien Malik
Browse files
Options
Downloads
Patches
Plain Diff
ENH: new appli wrapping the LineSegmentDetector
parents
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
FeatureExtraction/otbLineSegmentDetection.cxx
+76
-0
76 additions, 0 deletions
FeatureExtraction/otbLineSegmentDetection.cxx
with
76 additions
and
0 deletions
FeatureExtraction/otbLineSegmentDetection.cxx
0 → 100644
+
76
−
0
View file @
d8842f76
/*=========================================================================
Program: ORFEO Toolbox
Language: C++
Date: $Date$
Version: $Revision$
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.
=========================================================================*/
#include
"otbLineSegmentDetection.h"
#include
"otbStreamingLineSegmentDetector.h"
#include
"otbImage.h"
#include
"otbVectorData.h"
#include
"otbImageFileReader.h"
#include
"otbVectorDataFileWriter.h"
#include
"otbStandardFilterWatcher.h"
namespace
otb
{
int
LineSegmentDetection
::
Describe
(
ApplicationDescriptor
*
descriptor
)
{
descriptor
->
SetName
(
"Line Segment Detection"
);
descriptor
->
SetDescription
(
"Detects line segment in an image"
);
descriptor
->
AddInputImage
();
descriptor
->
AddOption
(
"OutputVectorData"
,
"Output Shape file name"
,
"outshape"
,
1
,
true
,
ApplicationDescriptor
::
FileName
);
return
EXIT_SUCCESS
;
}
int
LineSegmentDetection
::
Execute
(
otb
::
ApplicationOptionsResult
*
parseResult
)
{
typedef
float
InputPixelType
;
const
unsigned
int
Dimension
=
2
;
typedef
otb
::
Image
<
InputPixelType
,
Dimension
>
ImageType
;
typedef
otb
::
ImageFileReader
<
ImageType
>
ReaderType
;
typedef
otb
::
VectorData
<
double
,
Dimension
>
VectorDataType
;
typedef
VectorDataType
::
Pointer
VectorDataPointerType
;
typedef
otb
::
VectorDataFileWriter
<
VectorDataType
>
VectorDataFileWriterType
;
typedef
VectorDataFileWriterType
::
Pointer
VectorDataFileWriterPointerType
;
typedef
otb
::
StreamingLineSegmentDetector
<
ImageType
>::
FilterType
LSDFilterType
;
ReaderType
::
Pointer
reader
=
ReaderType
::
New
();
reader
->
SetFileName
(
parseResult
->
GetInputImage
());
reader
->
UpdateOutputInformation
();
LSDFilterType
::
Pointer
connected
=
LSDFilterType
::
New
();
connected
->
GetFilter
()
->
SetInput
(
reader
->
GetOutput
());
otb
::
StandardFilterWatcher
watcher
(
connected
->
GetStreamer
(),
"Segmentation"
);
connected
->
Update
();
VectorDataFileWriterPointerType
vdwriter
=
VectorDataFileWriterType
::
New
();
vdwriter
->
SetInput
(
connected
->
GetFilter
()
->
GetOutputVectorData
());
vdwriter
->
SetFileName
(
parseResult
->
GetParameterString
(
"OutputVectorData"
));
vdwriter
->
Update
();
return
EXIT_SUCCESS
;
}
}
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