FIX PCA transformation matrix computation
Summary
In PCAImageFilter
(and therefore the DimensionalityReduction
application), if whitening is not requested, each eigenvector is multiplied by the corresponding eigenvalue. This doesn't really makes sense and will often result in output images with very high variance for no reason. The whitening mode remains unchanged.
To summarize, if E
is the matrix of eigenvectors and D
the diagonal matrix of eigenvalues of the input data correlation matrix:
- If whitening is
on
the transformation will beD^-1/2 * E^T
- If whitening is
off
will beE^T
(instead ofD * E^T
)
A test is added for PCAImageFilter
with whitening set to false (this is currently not tested)
see bug report : #1998 (closed)
Copyright
The copyright owner is CNES and has signed the ORFEO ToolBox Contributor License Agreement.
Check before merging:
- All discussions are resolved
- At least 2
👍 votes from core developers, no👎 vote. - The feature branch is (reasonably) up-to-date with the base branch
- Dashboard is green
- Copyright owner has signed the ORFEO ToolBox Contributor License Agreement
- Optionally, run
git diff develop... -U0 --no-color | clang-format-diff.py -p1 -i
on latest changes and commit
Edited by Cédric Traizet