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
Container Registry
Model registry
Operate
Environments
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
Antoine Belvire
otb
Commits
b667fee8
Commit
b667fee8
authored
19 years ago
by
Caroline Ruffel
Browse files
Options
Downloads
Patches
Plain Diff
nomsg
parent
903d3079
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Testing/Code/FeatureExtraction/otbLineRatioDetector.cxx
+3
-6
3 additions, 6 deletions
Testing/Code/FeatureExtraction/otbLineRatioDetector.cxx
Testing/Code/FeatureExtraction/otbLineRatioDetectorLinear.cxx
+89
-0
89 additions, 0 deletions
...ing/Code/FeatureExtraction/otbLineRatioDetectorLinear.cxx
with
92 additions
and
6 deletions
Testing/Code/FeatureExtraction/otbLineRatioDetector.cxx
+
3
−
6
View file @
b667fee8
...
...
@@ -25,8 +25,6 @@
#include
"otbImageFileWriter.h"
#include
"otbLineRatioDetector.h"
#include
"itkLinearInterpolateImageFunction.h"
int
otbLineRatioDetector
(
int
argc
,
char
*
argv
[]
)
{
try
...
...
@@ -34,9 +32,9 @@ int otbLineRatioDetector( int argc, char* argv[] )
const
char
*
inputFilename
=
argv
[
1
];
const
char
*
outputFilename
=
argv
[
2
];
//
Width of the linear feature
= 2*WidthLine+1
//
Largeur de la ligne detecter
= 2*WidthLine+1
unsigned
int
WidthLine
((
unsigned
int
)
::
atoi
(
argv
[
3
]));
// L
e
ng
th of the linear feature
= 2*LengthLine+1
// L
o
ng
ueur de la ligne detecter
= 2*LengthLine+1
unsigned
int
LengthLine
((
unsigned
int
)
::
atoi
(
argv
[
4
]));
typedef
unsigned
char
InputPixelType
;
...
...
@@ -49,8 +47,7 @@ int otbLineRatioDetector( int argc, char* argv[] )
typedef
otb
::
ImageFileReader
<
InputImageType
>
ReaderType
;
typedef
otb
::
ImageFileWriter
<
OutputImageType
>
WriterType
;
typedef
itk
::
LinearInterpolateImageFunction
<
InputImageType
,
double
>
InterpolatorType
;
typedef
otb
::
LineRatioDetector
<
InputImageType
,
OutputImageType
,
InterpolatorType
>
FilterType
;
typedef
otb
::
LineRatioDetector
<
InputImageType
,
OutputImageType
>
FilterType
;
FilterType
::
Pointer
FilterLineRatio
=
FilterType
::
New
();
...
...
This diff is collapsed.
Click to expand it.
Testing/Code/FeatureExtraction/otbLineRatioDetectorLinear.cxx
0 → 100755
+
89
−
0
View file @
b667fee8
/*=========================================================================
Programme : OTB (ORFEO ToolBox)
Auteurs : CS - C.Ruffel
Language : C++
Date : 14 mars 2006
Version :
Role : Test du filtre de detection de lignes
$Id$
=========================================================================*/
#if defined(_MSC_VER)
#pragma warning ( disable : 4786 )
#endif
#define MAIN
#include
"itkExceptionObject.h"
#include
"itkImage.h"
#include
"itkImageFileWriter.h"
#include
<iostream>
#include
"otbImageFileReader.h"
#include
"otbImageFileWriter.h"
#include
"otbLineRatioDetector.h"
#include
"itkLinearInterpolateImageFunction.h"
int
otbLineRatioDetectorLinear
(
int
argc
,
char
*
argv
[]
)
{
try
{
const
char
*
inputFilename
=
argv
[
1
];
const
char
*
outputFilename
=
argv
[
2
];
// Width of the linear feature = 2*WidthLine+1
unsigned
int
WidthLine
((
unsigned
int
)
::
atoi
(
argv
[
3
]));
// Length of the linear feature = 2*LengthLine+1
unsigned
int
LengthLine
((
unsigned
int
)
::
atoi
(
argv
[
4
]));
typedef
unsigned
char
InputPixelType
;
typedef
double
OutputPixelType
;
const
unsigned
int
Dimension
=
2
;
typedef
itk
::
Image
<
InputPixelType
,
Dimension
>
InputImageType
;
typedef
itk
::
Image
<
OutputPixelType
,
Dimension
>
OutputImageType
;
typedef
otb
::
ImageFileReader
<
InputImageType
>
ReaderType
;
typedef
otb
::
ImageFileWriter
<
OutputImageType
>
WriterType
;
typedef
itk
::
LinearInterpolateImageFunction
<
InputImageType
,
double
>
InterpolatorType
;
typedef
otb
::
LineRatioDetector
<
InputImageType
,
OutputImageType
,
InterpolatorType
>
FilterType
;
FilterType
::
Pointer
FilterLineRatio
=
FilterType
::
New
();
FilterLineRatio
->
SetWidthLine
(
WidthLine
);
FilterLineRatio
->
SetLengthLine
(
LengthLine
);
ReaderType
::
Pointer
reader
=
ReaderType
::
New
();
WriterType
::
Pointer
writer
=
WriterType
::
New
();
reader
->
SetFileName
(
inputFilename
);
writer
->
SetFileName
(
outputFilename
);
FilterLineRatio
->
SetInput
(
reader
->
GetOutput
()
);
writer
->
SetInput
(
FilterLineRatio
->
GetOutput
()
);
writer
->
Update
();
}
catch
(
itk
::
ExceptionObject
&
err
)
{
std
::
cout
<<
"Exception itk::ExceptionObject levee !"
<<
std
::
endl
;
std
::
cout
<<
err
<<
std
::
endl
;
return
EXIT_FAILURE
;
}
catch
(
...
)
{
std
::
cout
<<
"Exception levee inconnue !"
<<
std
::
endl
;
return
EXIT_FAILURE
;
}
// Software Guide : EndCodeSnippet
//#endif
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