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
7e4981b3
Commit
7e4981b3
authored
16 years ago
by
Jordi Inglada
Browse files
Options
Downloads
Plain Diff
Added example for NCCRegistrationFilter
parents
fb7240d4
e0b7511f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CTestConfig.cmake
+12
-0
12 additions, 0 deletions
CTestConfig.cmake
Examples/DisparityMap/CMakeLists.txt
+5
-0
5 additions, 0 deletions
Examples/DisparityMap/CMakeLists.txt
Examples/DisparityMap/NCCRegistrationFilterExample.cxx
+131
-0
131 additions, 0 deletions
Examples/DisparityMap/NCCRegistrationFilterExample.cxx
with
148 additions
and
0 deletions
CTestConfig.cmake
0 → 100644
+
12
−
0
View file @
7e4981b3
SET
(
CTEST_PROJECT_NAME
"OTB"
)
SET
(
CTEST_NIGHTLY_START_TIME
"00:00:00 EST"
)
IF
(
NOT DEFINED CTEST_DROP_METHOD
)
SET
(
CTEST_DROP_METHOD
"http"
)
ENDIF
(
NOT DEFINED CTEST_DROP_METHOD
)
IF
(
CTEST_DROP_METHOD STREQUAL
"http"
)
SET
(
CTEST_DROP_SITE
"www.orfeo-toolbox.org"
)
SET
(
CTEST_DROP_LOCATION
"/Dashboard/submit.php?project=OTB"
)
SET
(
CTEST_TRIGGER_SITE
""
)
ENDIF
(
CTEST_DROP_METHOD STREQUAL
"http"
)
This diff is collapsed.
Click to expand it.
Examples/DisparityMap/CMakeLists.txt
+
5
−
0
View file @
7e4981b3
...
...
@@ -5,6 +5,11 @@ ADD_EXECUTABLE(SimpleDisparityMapEstimationExample SimpleDisparityMapEstimationE
TARGET_LINK_LIBRARIES
(
SimpleDisparityMapEstimationExample OTBFeatureExtraction OTBCommon OTBIO ITKCommon
ITKIO
)
ADD_EXECUTABLE
(
NCCRegistrationFilterExample NCCRegistrationFilterExample.cxx
)
TARGET_LINK_LIBRARIES
(
NCCRegistrationFilterExample OTBFeatureExtraction OTBCommon OTBIO ITKCommon
ITKIO
)
IF
(
NOT OTB_DISABLE_CXX_TESTING AND BUILD_TESTING
)
SET
(
BASELINE
${
OTB_DATA_ROOT
}
/Baseline/Examples/DisparityMap
)
...
...
This diff is collapsed.
Click to expand it.
Examples/DisparityMap/NCCRegistrationFilterExample.cxx
0 → 100644
+
131
−
0
View file @
7e4981b3
/*=========================================================================
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.
=========================================================================*/
#if defined(_MSC_VER)
#pragma warning ( disable : 4786 )
#endif
#ifdef __BORLANDC__
#define ITK_LEAN_AND_MEAN
#endif
// Software Guide : BeginCommandLineArgs
// INPUTS: {fixed.tif}, {moving.tif}
// OUTPUTS: {deformationFieldOutput2.png}
// 5 1.0 2
// Software Guide : EndCommandLineArgs
#include
"otbImage.h"
#include
"otbImageFileWriter.h"
#include
"otbImageFileReader.h"
#include
"otbNCCRegistrationFilter.h"
#include
"otbCommandLineArgumentParser.h"
#include
"itkRecursiveGaussianImageFilter.h"
#include
<iostream>
int
main
(
int
argc
,
char
**
argv
)
{
const
unsigned
int
ImageDimension
=
2
;
typedef
double
PixelType
;
typedef
itk
::
Vector
<
double
,
ImageDimension
>
DeformationPixelType
;
typedef
double
CoordinateRepresentationType
;
//Allocate Images
typedef
otb
::
Image
<
PixelType
,
ImageDimension
>
MovingImageType
;
typedef
otb
::
Image
<
PixelType
,
ImageDimension
>
FixedImageType
;
typedef
otb
::
Image
<
DeformationPixelType
,
ImageDimension
>
DeformationFieldType
;
typedef
otb
::
ImageFileReader
<
FixedImageType
>
FixedReaderType
;
FixedReaderType
::
Pointer
fReader
=
FixedReaderType
::
New
();
fReader
->
SetFileName
(
argv
[
1
]);
typedef
otb
::
ImageFileReader
<
MovingImageType
>
MovingReaderType
;
MovingReaderType
::
Pointer
mReader
=
MovingReaderType
::
New
();
mReader
->
SetFileName
(
argv
[
2
]);
//Blur input images
typedef
itk
::
RecursiveGaussianImageFilter
<
FixedImageType
,
FixedImageType
>
FixedBlurType
;
FixedBlurType
::
Pointer
fBlur
=
FixedBlurType
::
New
();
fBlur
->
SetInput
(
fReader
->
GetOutput
()
);
fBlur
->
SetSigma
(
atof
(
argv
[
5
])
);
typedef
itk
::
RecursiveGaussianImageFilter
<
MovingImageType
,
MovingImageType
>
MovingBlurType
;
MovingBlurType
::
Pointer
mBlur
=
MovingBlurType
::
New
();
mBlur
->
SetInput
(
mReader
->
GetOutput
()
);
mBlur
->
SetSigma
(
1.0
);
//Create the filter
typedef
otb
::
NCCRegistrationFilter
<
FixedImageType
,
MovingImageType
,
DeformationFieldType
>
RegistrationFilterType
;
RegistrationFilterType
::
Pointer
registrator
=
RegistrationFilterType
::
New
();
registrator
->
SetMovingImage
(
mBlur
->
GetOutput
()
);
registrator
->
SetFixedImage
(
fBlur
->
GetOutput
()
);
typedef
RegistrationFilterType
::
RadiusType
RadiusType
;
RadiusType
radius
;
radius
[
0
]
=
atoi
(
argv
[
4
]);
radius
[
1
]
=
atoi
(
argv
[
4
]);
registrator
->
SetNCCRadius
(
radius
);
std
::
cout
<<
"NCC radius "
<<
registrator
->
GetNCCRadius
()
<<
std
::
endl
;
registrator
->
SetNumberOfIterations
(
argv
[
6
]
);
registrator
->
GetDeformationField
();
registrator
->
Update
();
typedef
otb
::
ImageFileWriter
<
DeformationFieldType
>
DFWriterType
;
DFWriterType
::
Pointer
dfWriter
=
DFWriterType
::
New
();
dfWriter
->
SetFileName
(
argv
[
3
]);
dfWriter
->
SetInput
(
registrator
->
GetOutput
()
);
dfWriter
->
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