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
418fa69b
Commit
418fa69b
authored
12 years ago
by
Manuel Grizonnet
Browse files
Options
Downloads
Patches
Plain Diff
ENH: add Pansharpening application (just simple rcs for now)
parent
40a76925
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
Applications/CMakeLists.txt
+1
-0
1 addition, 0 deletions
Applications/CMakeLists.txt
Applications/Fusion/CMakeLists.txt
+4
-0
4 additions, 0 deletions
Applications/Fusion/CMakeLists.txt
Applications/Fusion/otbPansharpening.cxx
+132
-0
132 additions, 0 deletions
Applications/Fusion/otbPansharpening.cxx
with
137 additions
and
0 deletions
Applications/CMakeLists.txt
+
1
−
0
View file @
418fa69b
...
...
@@ -11,6 +11,7 @@ add_subdirectory(Classification)
add_subdirectory
(
DimensionalityReduction
)
add_subdirectory
(
DisparityMap
)
add_subdirectory
(
FeatureExtraction
)
add_subdirectory
(
Fusion
)
add_subdirectory
(
Hyperspectral
)
add_subdirectory
(
Projections
)
add_subdirectory
(
Radiometry
)
...
...
This diff is collapsed.
Click to expand it.
Applications/Fusion/CMakeLists.txt
0 → 100644
+
4
−
0
View file @
418fa69b
OTB_CREATE_APPLICATION
(
NAME Pansharpening
SOURCES otbPansharpening.cxx
LINK_LIBRARIES OTBFusion
)
This diff is collapsed.
Click to expand it.
Applications/Fusion/otbPansharpening.cxx
0 → 100644
+
132
−
0
View file @
418fa69b
/*=========================================================================
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
"otbWrapperApplication.h"
#include
"otbWrapperApplicationFactory.h"
#include
"itkVectorIndexSelectionCastImageFilter.h"
#include
"otbGenericRSResampleImageFilter.h"
#include
"otbBCOInterpolateImageFunction.h"
#include
"otbSimpleRcsPanSharpeningFusionImageFilter.h"
#include
"itkPixelBuilder.h"
#include
"itkFixedArray.h"
// Elevation handler
#include
"otbWrapperElevationParametersHandler.h"
namespace
otb
{
namespace
Wrapper
{
class
Pansharpening
:
public
Application
{
public:
/** Standard class typedefs. */
typedef
Pansharpening
Self
;
typedef
Application
Superclass
;
typedef
itk
::
SmartPointer
<
Self
>
Pointer
;
typedef
itk
::
SmartPointer
<
const
Self
>
ConstPointer
;
/** Standard macro */
itkNewMacro
(
Self
);
itkTypeMacro
(
Pansharpening
,
otb
::
Application
);
private:
void
DoInit
()
{
SetName
(
"Pansharpening"
);
SetDescription
(
"Perform P+XS pansharpening"
);
// Documentation
SetDocName
(
"Pansharpening"
);
SetDocLongDescription
(
"This application performs P+XS pansharpening."
);
SetDocLimitations
(
"None"
);
SetDocAuthors
(
"OTB-Team"
);
SetDocSeeAlso
(
" "
);
AddDocTag
(
Tags
::
Geometry
);
AddDocTag
(
Tags
::
Pansharpening
);
AddParameter
(
ParameterType_InputImage
,
"inp"
,
"Input PAN Image"
);
SetParameterDescription
(
"inp"
,
" Input panchromatic image."
);
AddParameter
(
ParameterType_InputImage
,
"inxs"
,
"Input XS Image"
);
SetParameterDescription
(
"inxs"
,
" Input XS image."
);
AddParameter
(
ParameterType_OutputImage
,
"out"
,
"Output image"
);
SetParameterDescription
(
"out"
,
" Output image."
);
AddRAMParameter
();
// Doc example parameter settings
SetDocExampleParameterValue
(
"inp"
,
"QB_Toulouse_Ortho_PAN.tif"
);
SetDocExampleParameterValue
(
"inxs"
,
"QB_Toulouse_Ortho_XS.tif"
);
SetDocExampleParameterValue
(
"out"
,
"Pansharpening.png uchar"
);
}
void
DoUpdateParameters
()
{
// Nothing to do here : all parameters are independent
}
void
DoExecute
()
{
FloatVectorImageType
*
panchroV
=
GetParameterImage
(
"inp"
);
if
(
panchroV
->
GetNumberOfComponentsPerPixel
()
!=
1
)
{
itkExceptionMacro
(
<<
"The panchromatic image must be a single channel image"
)
}
// Transform the PAN image to otb::Image
typedef
otb
::
Image
<
FloatVectorImageType
::
InternalPixelType
>
FloatImageType
;
typedef
itk
::
VectorIndexSelectionCastImageFilter
<
FloatVectorImageType
,
FloatImageType
>
VectorIndexSelectionCastImageFilterType
;
VectorIndexSelectionCastImageFilterType
::
Pointer
channelSelect
=
VectorIndexSelectionCastImageFilterType
::
New
();
m_Ref
.
push_back
(
channelSelect
.
GetPointer
());
channelSelect
->
SetIndex
(
0
);
channelSelect
->
SetInput
(
panchroV
);
channelSelect
->
UpdateOutputInformation
();
FloatImageType
::
Pointer
panchro
=
channelSelect
->
GetOutput
();
FloatVectorImageType
*
xs
=
GetParameterImage
(
"inxs"
);
typedef
otb
::
SimpleRcsPanSharpeningFusionImageFilter
<
FloatImageType
,
FloatVectorImageType
,
FloatVectorImageType
>
FusionFilterType
;
FusionFilterType
::
Pointer
fusionFilter
=
FusionFilterType
::
New
();
m_Ref
.
push_back
(
fusionFilter
.
GetPointer
());
fusionFilter
->
SetPanInput
(
panchro
);
fusionFilter
->
SetXsInput
(
xs
);
fusionFilter
->
UpdateOutputInformation
();
SetParameterOutputImage
(
"out"
,
fusionFilter
->
GetOutput
());
}
std
::
vector
<
itk
::
ProcessObject
::
Pointer
>
m_Ref
;
};
}
}
OTB_APPLICATION_EXPORT
(
otb
::
Wrapper
::
Pansharpening
)
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