Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
45169577
Commit
45169577
authored
Apr 01, 2019
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #14207 from alalek:fix_leak_eigenvalue_decomposition
parents
06193f28
1e583942
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
lda.cpp
modules/core/src/lda.cpp
+7
-5
No files found.
modules/core/src/lda.cpp
View file @
45169577
...
...
@@ -903,19 +903,19 @@ public:
// given in src. This function is a port of the EigenvalueSolver in JAMA,
// which has been released to public domain by The MathWorks and the
// National Institute of Standards and Technology (NIST).
EigenvalueDecomposition
(
InputArray
src
,
bool
fallbackSymmetric
=
true
)
:
EigenvalueDecomposition
()
:
n
(
0
),
d
(
NULL
),
e
(
NULL
),
ort
(
NULL
),
V
(
NULL
),
H
(
NULL
)
{
compute
(
src
,
fallbackSymmetric
);
// nothing
}
// This function computes the Eigenvalue Decomposition for a general matrix
// given in src. This function is a port of the EigenvalueSolver in JAMA,
// which has been released to public domain by The MathWorks and the
// National Institute of Standards and Technology (NIST).
void
compute
(
InputArray
src
,
bool
fallbackSymmetric
)
void
compute
(
InputArray
src
,
bool
fallbackSymmetric
=
true
)
{
CV_INSTRUMENT_REGION
();
...
...
@@ -970,7 +970,8 @@ void eigenNonSymmetric(InputArray _src, OutputArray _evals, OutputArray _evects)
else
src64f
=
src
;
EigenvalueDecomposition
eigensystem
(
src64f
,
false
);
EigenvalueDecomposition
eigensystem
;
eigensystem
.
compute
(
src64f
,
false
);
// EigenvalueDecomposition returns transposed and non-sorted eigenvalues
std
::
vector
<
double
>
eigenvalues64f
;
...
...
@@ -1146,7 +1147,8 @@ void LDA::lda(InputArrayOfArrays _src, InputArray _lbls) {
// M = inv(Sw)*Sb
Mat
M
;
gemm
(
Swi
,
Sb
,
1.0
,
Mat
(),
0.0
,
M
);
EigenvalueDecomposition
es
(
M
);
EigenvalueDecomposition
es
;
es
.
compute
(
M
);
_eigenvalues
=
es
.
eigenvalues
();
_eigenvectors
=
es
.
eigenvectors
();
// reshape eigenvalues, so they are stored by column
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment