Ask Your Question

Revision history [back]

PCA and project Space

good afternoon,

I'm trying to project and space, but I have a mistake and I cann't see the fail.

My sumary code is...

PCA pca(InputData, Mat(), CV_PCA_DATA_AS_ROW, NumComponents); MatPCA= pca.eigenvectors.clone(); for (i=0; i<data.size(); i++)="" {="" pca.project(data[i],="" compressed);="" outputdata.push_back(compressed);="" }="" gemm(data[0],="" matpca,="" 1,="" null,="" 0,="" out,gemm_2_t);="" printf("numero="" %d.="" diff="%g\n"," 0,="" norm(outputdata[0],="" out,="" norm_l2));<="" p="">

The result is different from 0 and I don't understand why

Thanks for your help

click to hide/show revision 2
the "101010" button is nice for formatting code

updated 2013-08-30 16:26:31 -0600

berak gravatar image

PCA and project Space

good afternoon,

I'm trying to project and space, but I have a mistake and I cann't see the fail.

My sumary code is...

PCA pca(InputData, Mat(), CV_PCA_DATA_AS_ROW, NumComponents);
MatPCA= pca.eigenvectors.clone();
for (i=0; i<data.size(); i++)="" {="" pca.project(data[i],="" compressed);="" outputdata.push_back(compressed);="" }="" gemm(data[0],="" matpca,="" 1,="" null,="" 0,="" out,gemm_2_t);="" printf("numero="" %d.="" diff="%g\n"," 0,="" norm(outputdata[0],="" out,="" norm_l2));<="" p="">
i<Data.size(); i++) {
        pca.project(Data[i], compressed);
        OutputData.push_back(compressed);
}
gemm(Data[0], MatPCA, 1, NULL, 0, Out,GEMM_2_T);
printf("Numero %d. diff = %g\n", 0, norm(OutputData[0], Out, NORM_L2));
 

The result is different from 0 and I don't understand why

why

Thanks for your help