# Revision history [back]

### PCA in thousands of dimensions

I have vectors in 4096 VLAD codes, each one of them representing an image.

I have to run PCA on them without reducing their dimension on learning datasets with less than 4096 images (e.g., the Holiday dataset with <2k images.) and obtaining the rotation matrix A.

In this paper (which explain also why I need to run this PCA without dimensionality reduction) they solved the problem with this approach:

For efficient computation of A, we compute at most the first 1,024 eigenvectors by eigendecomposition of the covariance matrix, and the remaining orthogonal complements up to D-dimensional are filled using Gram-Schmidt orthogonalization.

Now, how do I implement this using C++ libraries? I'm using OpenCV, but cv::PCA seems not to offer such a strategy. Is there any way to do this?

### PCA in thousands of dimensions

I have vectors in 4096 VLAD codes, each one of them representing an image.

I have to run PCA on them without reducing their dimension on learning datasets with less than 4096 images (e.g., the Holiday dataset with <2k images.) and obtaining the rotation matrix A.

In this this paper (which explain also explains why I need to run this PCA without dimensionality reduction) they solved the problem with this approach:

For efficient computation of A, we compute at most the first 1,024 eigenvectors by eigendecomposition of the covariance matrix, and the remaining orthogonal complements up to D-dimensional are filled using Gram-Schmidt orthogonalization.

Now, how do I implement this using C++ libraries? I'm using OpenCV, but cv::PCA seems not to offer such a strategy. Is there any way to do this?