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
Julien Cabieces
otb
Commits
3cca9161
Commit
3cca9161
authored
16 years ago
by
Julien Michel
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Added support of zoom in and zoom out interpolator
parent
71d14588
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Code/Visu/otbImageAlternateViewer.h
+2
-14
2 additions, 14 deletions
Code/Visu/otbImageAlternateViewer.h
Code/Visu/otbImageAlternateViewer.txx
+29
-29
29 additions, 29 deletions
Code/Visu/otbImageAlternateViewer.txx
with
31 additions
and
43 deletions
Code/Visu/otbImageAlternateViewer.h
+
2
−
14
View file @
3cca9161
...
...
@@ -23,17 +23,13 @@ PURPOSE. See the above copyright notices for more information.
#include
"otbImageList.h"
#include
"itkInterpolateImageFunction.h"
#include
"itkLinearInterpolateImageFunction.h"
#include
"otbBSplineInterpolateImageFunction.h"
#include
"itkVectorImageToImageAdaptor.h"
#include
"otbVectorImageToImageListFilter.h"
#include
"otbImage.h"
#include
"itkWindowedSincInterpolateImageFunction.h"
#include
"otbWindowedSincInterpolateImageGaussianFunction.h"
#include
"otbWindowedSincInterpolateImageHammingFunction.h"
#include
"itkZeroFluxNeumannBoundaryCondition.h"
#include
<FL/gl.h>
#include
"itkImageRegionSplitter.h"
#include
"otbProlateInterpolateImageFunction.h"
namespace
otb
{
...
...
@@ -78,14 +74,6 @@ class ITK_EXPORT ImageAlternateViewer
typedef
itk
::
InterpolateImageFunction
<
SingleImageType
,
double
>
InterpolatorType
;
typedef
typename
InterpolatorType
::
Pointer
InterpolatorPointerType
;
typedef
itk
::
LinearInterpolateImageFunction
<
SingleImageType
,
double
>
DefaultInterpolatorType
;
typedef
BSplineInterpolateImageFunction
<
SingleImageType
,
double
,
double
>
BSplineInterpolatorType
;
typedef
itk
::
Function
::
HammingWindowFunction
<
4
>
WindowFunctionType
;
typedef
otb
::
Function
::
GaussianWindowFunction
<>
GaussianWindowType
;
typedef
itk
::
ZeroFluxNeumannBoundaryCondition
<
SingleImageType
>
ConditionType
;
typedef
itk
::
WindowedSincInterpolateImageFunction
<
SingleImageType
,
3
,
WindowFunctionType
,
ConditionType
,
double
>
WindowedSincInterpolatorType
;
typedef
WindowedSincInterpolateImageGaussianFunction
<
SingleImageType
,
ConditionType
>
OtbWindowedSincInterpolatorType
;
typedef
ProlateInterpolateImageFunction
<
SingleImageType
,
ConditionType
>
ProlateInterpolatorType
;
typedef
itk
::
ImageRegionSplitter
<
2
>
SplitterType
;
typedef
typename
SplitterType
::
Pointer
SplitterPointerType
;
...
...
This diff is collapsed.
Click to expand it.
Code/Visu/otbImageAlternateViewer.txx
+
29
−
29
View file @
3cca9161
...
...
@@ -51,19 +51,8 @@ namespace otb
m_DecompositionFilter = VectorImageDecompositionFilterType::New();
typename BSplineInterpolatorType::Pointer bsplineInterpolator = BSplineInterpolatorType::New();
bsplineInterpolator->SetSplineOrder(3);
typename ProlateInterpolatorType::Pointer prolateInterpolator = ProlateInterpolatorType::New();
prolateInterpolator->SetRadius(8);
typename OtbWindowedSincInterpolatorType::Pointer otbwinsinc = OtbWindowedSincInterpolatorType::New();
otbwinsinc->SetRadius(8);
typename DefaultInterpolatorType::Pointer defaultInterpolator = DefaultInterpolatorType::New();
// m_ZoomInInterpolator = WindowedSincInterpolatorType::New();
m_ZoomInInterpolator=defaultInterpolator;
// m_ZoomInInterpolator=bsplineInterpolator;
m_ZoomOutInterpolator = defaultInterpolator;
m_SpacingZoomFactor=1;
...
...
@@ -456,10 +445,15 @@ namespace otb
unsigned int numberOfSplits=1;
unsigned int optiCount = 0;
if(m_SpacingZoomFactor>
0
)
InterpolatorPointerType interpolator;
if(m_SpacingZoomFactor>
1
)
{
numberOfSplits=max((static_cast<unsigned int>(m_SpacingZoomFactor))*(static_cast<unsigned int>(m_SpacingZoomFactor)),1U);
interpolator = m_ZoomOutInterpolator;
}
else
{
interpolator = m_ZoomInInterpolator;
}
unsigned int splitterNumberOfSplits = m_Splitter->GetNumberOfSplits(m_BufferedRegion,numberOfSplits);
...
...
@@ -519,8 +513,8 @@ namespace otb
}
else
{
m_ZoomInI
nterpolator->SetInputImage(bandList->GetNthElement(m_RedChannelIndex));
if(
m_ZoomInI
nterpolator->IsInsideBuffer(interpolatedPos))
i
nterpolator->SetInputImage(bandList->GetNthElement(m_RedChannelIndex));
if(
i
nterpolator->IsInsideBuffer(interpolatedPos))
{
interpolatedValue = static_cast<PixelType>(m_ZoomInInterpolator->Evaluate(interpolatedPos));
}
...
...
@@ -534,17 +528,17 @@ namespace otb
m_ZoomInInterpolator->SetInputImage(bandList->GetNthElement(m_GreenChannelIndex));
if( m_ZoomInInterpolator->IsInsideBuffer(interpolatedPos))
{
interpolatedValue = static_cast<PixelType>(
m_ZoomInI
nterpolator->Evaluate(interpolatedPos));
interpolatedValue = static_cast<PixelType>(
i
nterpolator->Evaluate(interpolatedPos));
}
else
{
interpolatedValue = 0;
}
newBuffer[index+1] = Normalize(interpolatedValue,m_GreenChannelIndex);
m_ZoomInI
nterpolator->SetInputImage(bandList->GetNthElement(m_BlueChannelIndex));
if(
m_ZoomInI
nterpolator->IsInsideBuffer(interpolatedPos))
i
nterpolator->SetInputImage(bandList->GetNthElement(m_BlueChannelIndex));
if(
i
nterpolator->IsInsideBuffer(interpolatedPos))
{
interpolatedValue = static_cast<PixelType>(
m_ZoomInI
nterpolator->Evaluate(interpolatedPos));
interpolatedValue = static_cast<PixelType>(
i
nterpolator->Evaluate(interpolatedPos));
}
else
{
...
...
@@ -757,9 +751,15 @@ namespace otb
interpolatedPos.Fill(0);
unsigned int numberOfSplits=1;
if(m_SpacingZoomFactor>0)
InterpolatorPointerType interpolator;
if(m_SpacingZoomFactor>1)
{
numberOfSplits=max((static_cast<unsigned int>(m_SpacingZoomFactor))*(static_cast<unsigned int>(m_SpacingZoomFactor)),1U);
interpolator = m_ZoomOutInterpolator;
}
else
{
interpolator = m_ZoomInInterpolator;
}
unsigned int splitterNumberOfSplits = m_Splitter->GetNumberOfSplits(region,numberOfSplits);
...
...
@@ -826,10 +826,10 @@ namespace otb
for(unsigned int i = 0;i<splitRegion.GetSize()[0];++i)
{
// //std::cout<<interpolatedPos<<std::endl;
m_ZoomInI
nterpolator->SetInputImage(bandList->GetNthElement(m_RedChannelIndex));
if(
m_ZoomInI
nterpolator->IsInsideBuffer(interpolatedPos))
i
nterpolator->SetInputImage(bandList->GetNthElement(m_RedChannelIndex));
if(
i
nterpolator->IsInsideBuffer(interpolatedPos))
{
interpolatedValue = static_cast<PixelType>(
m_ZoomInI
nterpolator->Evaluate(interpolatedPos));
interpolatedValue = static_cast<PixelType>(
i
nterpolator->Evaluate(interpolatedPos));
}
else
{
...
...
@@ -838,20 +838,20 @@ namespace otb
result[index] = Normalize(interpolatedValue,m_RedChannelIndex);
if(rgb)
{
m_ZoomInI
nterpolator->SetInputImage(bandList->GetNthElement(m_GreenChannelIndex));
if(
m_ZoomInI
nterpolator->IsInsideBuffer(interpolatedPos))
i
nterpolator->SetInputImage(bandList->GetNthElement(m_GreenChannelIndex));
if(
i
nterpolator->IsInsideBuffer(interpolatedPos))
{
interpolatedValue = static_cast<PixelType>(
m_ZoomInI
nterpolator->Evaluate(interpolatedPos));
interpolatedValue = static_cast<PixelType>(
i
nterpolator->Evaluate(interpolatedPos));
}
else
{
interpolatedValue = 0;
}
result[index+1] = Normalize(interpolatedValue,m_GreenChannelIndex);
m_ZoomInI
nterpolator->SetInputImage(bandList->GetNthElement(m_BlueChannelIndex));
if(
m_ZoomInI
nterpolator->IsInsideBuffer(interpolatedPos))
i
nterpolator->SetInputImage(bandList->GetNthElement(m_BlueChannelIndex));
if(
i
nterpolator->IsInsideBuffer(interpolatedPos))
{
interpolatedValue = static_cast<PixelType>(
m_ZoomInI
nterpolator->Evaluate(interpolatedPos));
interpolatedValue = static_cast<PixelType>(
i
nterpolator->Evaluate(interpolatedPos));
}
else
{
...
...
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