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
0bd287a8
Commit
0bd287a8
authored
May 31, 2012
by
Philipp Wagner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed reconstruction, so that the mean is correctly added to the reconstructed image.
parent
2ee917c6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
9 deletions
+4
-9
lda.cpp
modules/contrib/src/lda.cpp
+4
-9
No files found.
modules/contrib/src/lda.cpp
View file @
0bd287a8
...
...
@@ -185,21 +185,16 @@ Mat subspaceReconstruct(InputArray _W, InputArray _mean, InputArray _src)
Mat
W
=
_W
.
getMat
();
Mat
mean
=
_mean
.
getMat
();
Mat
src
=
_src
.
getMat
();
// get number of samples
and dimension
// get number of samples
int
n
=
src
.
rows
;
int
d
=
src
.
cols
;
// initalize temporary matrices
Mat
X
,
Y
;
// copy data & make sure we are using the correct type
src
.
convertTo
(
Y
,
W
.
type
());
// calculate the reconstruction
gemm
(
Y
,
W
,
1.0
,
((
size_t
)
d
==
mean
.
total
())
?
repeat
(
mean
.
reshape
(
1
,
1
),
n
,
1
)
:
Mat
(),
((
size_t
)
d
==
mean
.
total
())
?
1.0
:
0.0
,
X
,
GEMM_2_T
);
gemm
(
Y
,
W
,
1.0
,
Mat
(),
0.0
,
X
,
GEMM_2_T
);
if
(
mean
.
total
()
==
(
size_t
)
X
.
cols
)
add
(
X
,
repeat
(
mean
.
reshape
(
1
,
1
),
n
,
1
),
X
);
return
X
;
}
...
...
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