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
Main Repositories
otb
Commits
bbc209e2
Commit
bbc209e2
authored
10 years ago
by
Guillaume Pasero
Browse files
Options
Downloads
Patches
Plain Diff
BUG: Mantis-942: pixel convention consistency for OrthoRecitification application
parent
b451247f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Applications/Projections/otbOrthoRectification.cxx
+17
-19
17 additions, 19 deletions
Applications/Projections/otbOrthoRectification.cxx
with
17 additions
and
19 deletions
Applications/Projections/otbOrthoRectification.cxx
+
17
−
19
View file @
bbc209e2
...
...
@@ -265,14 +265,6 @@ private:
genericRSEstimator
->
Compute
();
// Fill the Gui with the computed parameters
if
(
!
HasUserValue
(
"outputs.ulx"
))
{
SetParameterFloat
(
"outputs.ulx"
,
genericRSEstimator
->
GetOutputOrigin
()[
0
]);
}
if
(
!
HasUserValue
(
"outputs.uly"
))
SetParameterFloat
(
"outputs.uly"
,
genericRSEstimator
->
GetOutputOrigin
()[
1
]);
if
(
!
HasUserValue
(
"outputs.sizex"
))
SetParameterInt
(
"outputs.sizex"
,
genericRSEstimator
->
GetOutputSize
()[
0
]);
...
...
@@ -285,6 +277,12 @@ private:
if
(
!
HasUserValue
(
"outputs.spacingy"
))
SetParameterFloat
(
"outputs.spacingy"
,
genericRSEstimator
->
GetOutputSpacing
()[
1
]);
if
(
!
HasUserValue
(
"outputs.ulx"
))
SetParameterFloat
(
"outputs.ulx"
,
genericRSEstimator
->
GetOutputOrigin
()[
0
]
-
0.5
*
genericRSEstimator
->
GetOutputSpacing
()[
0
]);
if
(
!
HasUserValue
(
"outputs.uly"
))
SetParameterFloat
(
"outputs.uly"
,
genericRSEstimator
->
GetOutputOrigin
()[
1
]
-
0.5
*
genericRSEstimator
->
GetOutputSpacing
()[
1
]);
if
(
!
HasUserValue
(
"outputs.lrx"
))
SetParameterFloat
(
"outputs.lrx"
,
GetParameterFloat
(
"outputs.ulx"
)
+
GetParameterFloat
(
"outputs.spacingx"
)
*
static_cast
<
double
>
(
GetParameterInt
(
"outputs.sizex"
)));
...
...
@@ -380,8 +378,8 @@ private:
SetParameterInt
(
"outputs.sizey"
,
genericRSEstimator
->
GetOutputSize
()[
1
]);
// Reset Origin to default
SetParameterFloat
(
"outputs.ulx"
,
genericRSEstimator
->
GetOutputOrigin
()[
0
]);
SetParameterFloat
(
"outputs.uly"
,
genericRSEstimator
->
GetOutputOrigin
()[
1
]);
SetParameterFloat
(
"outputs.ulx"
,
genericRSEstimator
->
GetOutputOrigin
()[
0
]
-
0.5
*
genericRSEstimator
->
GetOutputSpacing
()[
0
]
);
SetParameterFloat
(
"outputs.uly"
,
genericRSEstimator
->
GetOutputOrigin
()[
1
]
-
0.5
*
genericRSEstimator
->
GetOutputSpacing
()[
1
]
);
// Update lower right
SetParameterFloat
(
"outputs.lrx"
,
GetParameterFloat
(
"outputs.ulx"
)
+
GetParameterFloat
(
"outputs.spacingx"
)
*
static_cast
<
double
>
(
GetParameterInt
(
"outputs.sizex"
)));
...
...
@@ -434,8 +432,8 @@ private:
SetParameterFloat
(
"outputs.spacingy"
,
genericRSEstimator
->
GetOutputSpacing
()[
1
]);
// Reset Origin to default
SetParameterFloat
(
"outputs.ulx"
,
genericRSEstimator
->
GetOutputOrigin
()[
0
]);
SetParameterFloat
(
"outputs.uly"
,
genericRSEstimator
->
GetOutputOrigin
()[
1
]);
SetParameterFloat
(
"outputs.ulx"
,
genericRSEstimator
->
GetOutputOrigin
()[
0
]
-
0.5
*
genericRSEstimator
->
GetOutputSpacing
()[
0
]
);
SetParameterFloat
(
"outputs.uly"
,
genericRSEstimator
->
GetOutputOrigin
()[
1
]
-
0.5
*
genericRSEstimator
->
GetOutputSpacing
()[
1
]
);
// Update lower right
SetParameterFloat
(
"outputs.lrx"
,
GetParameterFloat
(
"outputs.ulx"
)
+
GetParameterFloat
(
"outputs.spacingx"
)
*
static_cast
<
double
>
(
GetParameterInt
(
"outputs.sizex"
)));
...
...
@@ -535,8 +533,8 @@ private:
SetParameterInt
(
"outputs.sizey"
,
size
[
1
]);
SetParameterFloat
(
"outputs.spacingx"
,
spacing
[
0
]);
SetParameterFloat
(
"outputs.spacingy"
,
spacing
[
1
]);
SetParameterFloat
(
"outputs.ulx"
,
orig
[
0
]);
SetParameterFloat
(
"outputs.uly"
,
orig
[
1
]);
SetParameterFloat
(
"outputs.ulx"
,
orig
[
0
]
-
0.5
*
spacing
[
0
]
);
SetParameterFloat
(
"outputs.uly"
,
orig
[
1
]
-
0.5
*
spacing
[
1
]
);
// Update lower right
SetParameterFloat
(
"outputs.lrx"
,
GetParameterFloat
(
"outputs.ulx"
)
+
GetParameterFloat
(
"outputs.spacingx"
)
*
static_cast
<
double
>
(
GetParameterInt
(
"outputs.sizex"
)));
SetParameterFloat
(
"outputs.lry"
,
GetParameterFloat
(
"outputs.uly"
)
+
GetParameterFloat
(
"outputs.spacingy"
)
*
static_cast
<
double
>
(
GetParameterInt
(
"outputs.sizey"
)));
...
...
@@ -674,11 +672,11 @@ private:
m_ResampleFilter
->
SetOutputSpacing
(
spacing
);
otbAppLogINFO
(
"Generating output with pixel spacing = "
<<
spacing
);
ResampleFilterType
::
OriginType
ul
;
ul
[
0
]
=
GetParameterFloat
(
"outputs.ulx"
);
ul
[
1
]
=
GetParameterFloat
(
"outputs.uly"
);
m_ResampleFilter
->
SetOutputOrigin
(
ul
);
otbAppLogINFO
(
"Generating output with origin = "
<<
ul
);
ResampleFilterType
::
OriginType
origin
;
origin
[
0
]
=
GetParameterFloat
(
"outputs.ulx"
)
+
0.5
*
GetParameterFloat
(
"outputs.spacingx"
)
;
origin
[
1
]
=
GetParameterFloat
(
"outputs.uly"
)
+
0.5
*
GetParameterFloat
(
"outputs.spacingy"
)
;
m_ResampleFilter
->
SetOutputOrigin
(
origin
);
otbAppLogINFO
(
"Generating output with origin = "
<<
origin
);
// Build the default pixel
FloatVectorImageType
::
PixelType
defaultValue
;
...
...
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