Skip to content

FIX PCA transformation matrix computation

Cédric Traizet requested to merge fix_pca into develop


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 be D^-1/2 * E^T
  • If whitening is off will be E^T (instead of D * E^T)

A test is added for PCAImageFilter with whitening set to false (this is currently not tested)

see bug report : #1998 (closed)


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 | -p1 -i on latest changes and commit
Edited by Cédric Traizet

Merge request reports