Time Consuming by cvEigenDecomposite

asked 2016-01-11 00:50:36 -0600

DaliaSH gravatar image

updated 2016-01-11 06:35:26 -0600

berak gravatar image

Dears ,
I am trying to implement face recognition using pca ,
when I user the function "cvEigenDecomposite" to project test img in face space , I measured the time consuming by this function in different situations


When Training = 800 img  &  # eigen values = 799   ---------> time = 181 sec  
When Training = 1000 img  &  # eigen values = 999   ---------> time =  72  sec    !!!!!!!!!!!!!

is this logic ???????????
why 1000 takes smaller time ??????????

for (i = 0; i < iTestFaces; i++){ 
    subFuncTime_Decomposite = GetTickCount(); 
    cvEigenDecomposite(pFaceImageArr[i], iEigens, pEigenVectArr, 0, 0, pAvgTrainImg, pProjectedTestFace); 
    subFuncTime_Decomposite = GetTickCount() - subFuncTime_Decomposite; 

    subFuncTime_iNearestPerson = GetTickCount(); 
    iNearestPerson = FindNearestNeighbor(pProjectedTestFace, iNearestDistance,MyID ,ResultFileObj, ResultExcelObj); 
    subFuncTime_iNearestPerson = GetTickCount() - subFuncTime_iNearestPerson;
}
edit retag flag offensive close merge delete

Comments

2

sidenote: please use the c++ PCA class , not the outdated c-api functions

berak gravatar imageberak ( 2016-01-11 00:57:04 -0600 )edit

I need to have a control in each step in PCA

DaliaSH gravatar imageDaliaSH ( 2016-01-11 01:04:07 -0600 )edit
2

maybe you can show a bit more code, so folks can try to reproduce your problem ?

berak gravatar imageberak ( 2016-01-11 01:07:36 -0600 )edit

for (i = 0; i < iTestFaces; i++){
subFuncTime_Decomposite = GetTickCount();
cvEigenDecomposite(pFaceImageArr[i], iEigens, pEigenVectArr, 0, 0, pAvgTrainImg, pProjectedTestFace);
subFuncTime_Decomposite = GetTickCount() - subFuncTime_Decomposite;

subFuncTime_iNearestPerson = GetTickCount();
iNearestPerson = FindNearestNeighbor(pProjectedTestFace, iNearestDistance,MyID ,ResultFileObj, ResultExcelObj);
subFuncTime_iNearestPerson = GetTickCount() - subFuncTime_iNearestPerson;
}

DaliaSH gravatar imageDaliaSH ( 2016-01-11 05:06:28 -0600 )edit