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
ff880d45
Commit
ff880d45
authored
16 years ago
by
Grégoire Mercier
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Wavelet Packet
parent
05835001
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
Code/MultiScale/otbWaveletPacketForwardTransform.h
+123
-0
123 additions, 0 deletions
Code/MultiScale/otbWaveletPacketForwardTransform.h
Code/MultiScale/otbWaveletPacketForwardTransform.txx
+95
-0
95 additions, 0 deletions
Code/MultiScale/otbWaveletPacketForwardTransform.txx
with
218 additions
and
0 deletions
Code/MultiScale/otbWaveletPacketForwardTransform.h
0 → 100644
+
123
−
0
View file @
ff880d45
/*=========================================================================
Program: ORFEO Toolbox
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details.
Copyright (c) Institut Telecom / Telecom Bretagne. All rights reserved.
See ITCopyright.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.
=========================================================================*/
#ifndef __otbWaveletPacketForwardTransform__h
#define __otbWaveletPacketForwardTransform__h
#include
"otbImageToImageListFilter.h"
namespace
otb
{
/** \class WaveletPacketForwardTransform
* \brief Wavelet packet transformation framework
*
* This class defines the Wavelet Packet transformation of an image
* by using a (templated) elementary wavelet transform and (templated)
* cost criteria to stop the decomposition.
*
* It yields a list of images...
*
* TODO: this class implements the decomposition only. But there is no storage
* of the way of decomposition. It should be added before implementing backward
* transformation.
*
* the user is supposed to initialize Cost properly (through GetCost() macro)
* depending on its type before calling an Update(). The Cost class has to contain
* a New() and Evaluate() function.
*
* \sa FullyDecomposedWaveletPacketCost
* \sa StationaryFilterBank
* \sa WaveletForwardTransform
*
*/
template
<
class
TInputImage
,
class
TOutputImage
,
class
TFilter
,
class
TCost
>
class
ITK_EXPORT
WaveletPacketForwardTransform
:
public
ImageToImageListFilter
<
TInputImage
,
TOutputImage
>
{
public:
/** Standard typedefs */
typedef
WaveletPacketForwardTransform
Self
;
typedef
ImageToImageListFilter
<
TInputImage
,
TOutputImage
>
Superclass
;
typedef
itk
::
SmartPointer
<
Self
>
Pointer
;
typedef
itk
::
SmartPointer
<
const
Self
>
ConstPointer
;
/** Type macro */
itkNewMacro
(
Self
);
/** Creation through object factory macro */
itkTypeMacro
(
WaveletPacketForwardTransform
,
ImageToImageListFilter
);
typedef
TInputImage
InputImageType
;
typedef
typename
InputImageType
::
Pointer
InputImagePointerType
;
typedef
typename
InputImageType
::
ConstPointer
InputImageConstPointerType
;
typedef
typename
InputImageType
::
RegionType
InputImageRegionType
;
typedef
typename
InputImageType
::
PixelType
InputImagePixelType
;
typedef
typename
InputImageType
::
SizeType
SizeType
;
typedef
typename
InputImageType
::
ValueType
ValueType
;
typedef
typename
Superclass
::
OutputImageType
OutputImageType
;
typedef
typename
Superclass
::
OutputImagePointerType
OutputImagePointerType
;
typedef
typename
Superclass
::
OutputImageListType
OutputImageListType
;
typedef
typename
OutputImageListType
::
Pointer
OutputImageListPointerType
;
typedef
typename
OutputImageListType
::
Iterator
OutputImageIterator
;
typedef
TFilter
FilterType
;
typedef
typename
FilterType
::
Pointer
FilterPointerType
;
typedef
ObjectList
<
FilterType
>
FilterListType
;
typedef
typename
FilterListType
::
Pointer
FilterListPointerType
;
typedef
typename
FilterListType
::
Iterator
FilterListIterator
;
itkGetObjectMacro
(
FilterList
,
FilterListType
);
typedef
TCost
CostType
;
typedef
typename
CostType
::
Pointer
CostPointerType
;
itkGetObjectMacro
(
Cost
,
CostType
);
itkStaticConstMacro
(
InputImageDimension
,
unsigned
int
,
TInputImage
::
ImageDimension
);
protected:
WaveletPacketForwardTransform
();
virtual
~
WaveletPacketForwardTransform
()
{}
/** Generate data redefinition */
virtual
void
GenerateData
();
/** Performs (if any) the local decomposition (called recursively) */
virtual
void
PerformDecomposition
(
unsigned
int
depth
,
OutputImageIterator
&
outputIt
);
private
:
WaveletPacketForwardTransform
(
const
Self
&
);
void
operator
=
(
const
Self
&
);
FilterListPointerType
m_FilterList
;
CostPointerType
m_Cost
;
};
// end of class
}
// end of namespace
#ifndef OTB_MANUAL_INSTANTIATION
#include
"otbWaveletPacketForwardTransform.txx"
#endif
#endif
This diff is collapsed.
Click to expand it.
Code/MultiScale/otbWaveletPacketForwardTransform.txx
0 → 100644
+
95
−
0
View file @
ff880d45
/*=========================================================================
Program: ORFEO Toolbox
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details.
Copyright (c) Institut Telecom / Telecom Bretagne. All rights reserved.
See ITCopyright.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.
=========================================================================*/
#ifndef __otbWaveletPacketForwardTransform__txx
#define __otbWaveletPacketForwardTransform__txx
#include "otbWaveletPacketForwardTransform.h"
namespace otb {
template < class TInputImage, class TOutputImage, class TFilter, class TCost >
WaveletPacketForwardTransform< TInputImage, TOutputImage, TFilter, TCost >
::WaveletPacketForwardTransform ()
{
this->SetNumberOfRequiredInputs(1);
this->SetNumberOfOutputs(1);
m_FilterList = FilterListType::New();
m_Cost = CostType::New();
}
template < class TInputImage, class TOutputImage, class TFilter, class TCost >
void
WaveletPacketForwardTransform< TInputImage, TOutputImage, TFilter, TCost >
::GenerateData ()
{
//this->AllocateOutputs();
/*
* Start with a decomposition
*/
this->GetFilterList()->PushBack( FilterType::New() );
FilterType * filter = this->GetFilterList()->GetNthElement( 0 );
filter->SetInput( this->GetInput() );
filter->Update();
for ( unsigned int idx = 0; idx < filter->GetNumberOfOutputs(); idx++ )
this->GetOutput()->PushBack( filter->GetOutput( idx ) );
/**
* Loop decompositions
*/
for ( OutputImageIterator outputIt = this->GetOutput()->Begin();
outputIt != this->GetOutput()->End();
++outputIt )
{
PerformDecomposition( 1, outputIt );
}
}
template < class TInputImage, class TOutputImage, class TFilter, class TCost >
void
WaveletPacketForwardTransform< TInputImage, TOutputImage, TFilter, TCost >
::PerformDecomposition ( unsigned int depth, OutputImageIterator & outputIt )
{
if ( this->GetCost()->Evaluate( depth, outputIt.Get() ) )
{
this->GetFilterList()->PushBack( FilterType::New() );
FilterType * filter = this->GetFilterList()->GetNthElement( this->GetFilterList()->Size()-1 );
filter->SetInput( outputIt.Get() );
filter->Update();
depth++;
outputIt.Set( filter->GetOutput(0) );
PerformDecomposition( depth, outputIt );
for ( unsigned int idx = 1; idx < filter->GetNumberOfOutputs(); idx++ )
{
++outputIt;
outputIt = this->GetOutput()->Insert( outputIt, filter->GetOutput( idx ) );
PerformDecomposition( depth, outputIt );
}
}
}
} // end of namespace otb
#endif
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