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
8217ef04
Commit
8217ef04
authored
14 years ago
by
Emmanuel Christophe
Browse files
Options
Downloads
Patches
Plain Diff
ENH: generalization of the Fine registration with any transform as a first guess
parent
d99be305
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/DisparityMap/otbFineRegistrationImageFilter.h
+13
-6
13 additions, 6 deletions
Code/DisparityMap/otbFineRegistrationImageFilter.h
Code/DisparityMap/otbFineRegistrationImageFilter.txx
+22
-2
22 additions, 2 deletions
Code/DisparityMap/otbFineRegistrationImageFilter.txx
with
35 additions
and
8 deletions
Code/DisparityMap/otbFineRegistrationImageFilter.h
+
13
−
6
View file @
8217ef04
...
...
@@ -91,15 +91,15 @@ public:
typedef
typename
TInputImage
::
SpacingType
SpacingType
;
typedef
typename
TInputImage
::
PointType
PointType
;
typedef
typename
TInputImage
::
OffsetType
OffsetType
;
typedef
typename
itk
::
InterpolateImageFunction
<
TInputImage
,
double
>
InterpolatorType
;
typedef
itk
::
InterpolateImageFunction
<
TInputImage
,
double
>
InterpolatorType
;
typedef
typename
InterpolatorType
::
Pointer
InterpolatorPointerType
;
typedef
typename
itk
::
ContinuousIndex
<
double
,
2
>
ContinuousIndexType
;
typedef
typename
itk
::
ImageToImageMetric
<
TInputImage
,
TInputImage
>
MetricType
;
typedef
itk
::
ContinuousIndex
<
double
,
2
>
ContinuousIndexType
;
typedef
itk
::
ImageToImageMetric
<
TInputImage
,
TInputImage
>
MetricType
;
typedef
typename
MetricType
::
Pointer
MetricPointerType
;
typedef
typename
itk
::
TranslationTransform
<
double
,
2
>
TranslationType
;
typedef
itk
::
TranslationTransform
<
double
,
2
>
TranslationType
;
typedef
typename
TranslationType
::
Pointer
TranslationPointerType
;
typedef
typename
itk
::
Transform
<
double
,
2
,
2
>
TransformType
;
typedef
typename
TransformType
::
Pointer
TransformPointerType
;
/** Set/Get the Metric used to compare images */
itkSetObjectMacro
(
Metric
,
MetricType
);
...
...
@@ -168,6 +168,10 @@ public:
m_GridStep
.
Fill
(
step
);
}
/** Set the transform for the initial offset */
itkSetObjectMacro
(
Transform
,
TransformType
);
itkGetConstObjectMacro
(
Transform
,
TransformType
);
protected
:
/** Constructor */
FineRegistrationImageFilter
();
...
...
@@ -217,6 +221,9 @@ private:
/** Grid step */
OffsetType
m_GridStep
;
/** Transform for initial offset */
TransformPointerType
m_Transform
;
};
}
// end namespace otb
...
...
This diff is collapsed.
Click to expand it.
Code/DisparityMap/otbFineRegistrationImageFilter.txx
+
22
−
2
View file @
8217ef04
...
...
@@ -65,6 +65,8 @@ FineRegistrationImageFilter<TInputImage,T0utputCorrelation,TOutputDeformationFie
// Default offset
m_InitialOffset.Fill(0);
m_Transform = NULL;
}
template <class TInputImage, class T0utputCorrelation, class TOutputDeformationField>
...
...
@@ -327,6 +329,9 @@ FineRegistrationImageFilter<TInputImage,TOutputCorrelation,TOutputDeformationFie
deformationValue[0] = m_InitialOffset[0];
deformationValue[1] = m_InitialOffset[1];
// Local initial offset: enable the possibility of a different initial offset for each pixel
SpacingType localOffset = m_InitialOffset;
// Get fixed image spacing
SpacingType fixedSpacing = fixedPtr->GetSpacing();
...
...
@@ -362,13 +367,28 @@ FineRegistrationImageFilter<TInputImage,TOutputCorrelation,TOutputDeformationFie
m_Metric->SetFixedImageRegion(currentMetricRegion);
m_Metric->Initialize();
// Compute the local offset if required (and the transform was specified)
if (m_Transform.IsNotNull())
{
PointType inputPoint, outputPoint;
for(unsigned int dim = 0; dim < TInputImage::ImageDimension; ++dim)
{
inputPoint[dim] = currentIndex[dim];
}
outputPoint = m_Transform->TransformPoint(inputPoint);
for(unsigned int dim = 0; dim < TInputImage::ImageDimension; ++dim)
{
localOffset[dim] = outputPoint[dim] - inputPoint[dim];//FIXME check the direction
}
}
// Compute the correlation at each location
for(int i = -static_cast<int>(m_SearchRadius[0]); i <= static_cast<int>(m_SearchRadius[0]); ++i)
{
for(int j = -static_cast<int>(m_SearchRadius[1]); j <= static_cast<int>(m_SearchRadius[1]); ++j)
{
params[0] =
m_Initi
alOffset[0] + static_cast<double>(i*fixedSpacing[0]);
params[1] =
m_Initi
alOffset[1] + static_cast<double>(j*fixedSpacing[1]);
params[0] =
loc
alOffset[0] + static_cast<double>(i*fixedSpacing[0]);
params[1] =
loc
alOffset[1] + static_cast<double>(j*fixedSpacing[1]);
try
{
...
...
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