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
c1f39e25
Commit
c1f39e25
authored
13 years ago
by
Julien Michel
Browse files
Options
Downloads
Patches
Plain Diff
ENH: vnl_generalized_eigensystem already returns unit variance v1. Adding computation of rho
parent
1bdf66f2
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Code/ChangeDetection/otbMultivariateAlterationDetectorImageFilter.txx
+10
-16
10 additions, 16 deletions
...etection/otbMultivariateAlterationDetectorImageFilter.txx
with
10 additions
and
16 deletions
Code/ChangeDetection/otbMultivariateAlterationDetectorImageFilter.txx
+
10
−
16
View file @
c1f39e25
...
...
@@ -153,19 +153,11 @@ MultivariateAlterationDetectorImageFilter<TInputImage,TOutputImage>
m_V1 = ges.V;
// Compute cannonical correlation matrix
VnlMatrixType rho = ges.D
;
r
ho =
r
ho.apply(&vcl_sqrt);
m_Rho = ges.D.get_diagonal()
;
m_R
ho =
m_R
ho.apply(&vcl_sqrt);
//Scale v1 to get a unit variance
VnlMatrixType aux1 = m_V1.transpose() * (s11 * m_V1);
VnlVectorType aux2 = aux1.get_diagonal();
aux2 = aux2.apply(&vcl_sqrt);
aux2 = aux2.apply(&InverseValue);
VnlMatrixType aux3 = VnlMatrixType(aux2.size(),aux2.size(),0);
aux3.set_diagonal(aux2);
m_V1 = aux3 * m_V1;
// We do not need to scale v1 since the
// vnl_generalized_eigensystem already gives unit variance
VnlMatrixType invstderr1 = s11.apply(&vcl_sqrt);
invstderr1 = invstderr1.apply(&InverseValue);
...
...
@@ -192,11 +184,11 @@ MultivariateAlterationDetectorImageFilter<TInputImage,TOutputImage>
m_V2 = invs22*s21*m_V1;
// Scale v2 for unit variance
aux1 = m_V2.transpose() * (s22 * m_V2);
aux2 = aux1.get_diagonal();
VnlMatrixType
aux1 = m_V2.transpose() * (s22 * m_V2);
VnlVectorType
aux2 = aux1.get_diagonal();
aux2 = aux2.apply(&vcl_sqrt);
aux2 = aux2.apply(&InverseValue);
aux3 = VnlMatrixType(aux2.size(),aux2.size(),0);
VnlMatrixType
aux3 = VnlMatrixType(aux2.size(),aux2.size(),0);
aux3.fill(0);
aux3.set_diagonal(aux2);
m_V2 = m_V2 * aux3;
...
...
@@ -220,7 +212,9 @@ MultivariateAlterationDetectorImageFilter<TInputImage,TOutputImage>
m_V1 = V.extract(nbComp1,nbComp1);
m_V2 = V.extract(nbComp2,nbComp2,nbComp1,0);
//Scale v1 to get a unit variance
m_Rho = ges.D.get_diagonal().flip().extract(std::max(nbComp1,nbComp2),0);
//Scale v1 to get a unit variance
VnlMatrixType aux1 = m_V1.transpose() * (s11 * m_V1);
VnlVectorType aux2 = aux1.get_diagonal();
...
...
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