static CvStatus CV_STDCALL icvCalcEigenObjects_8u32fR( int nObjects, void* input, int objStep,
void* output, int eigStep, CvSize size,
int ioFlags, int ioBufSize, void* userData,
CvTermCriteria* calcLimit, float* avg,
int avgStep, float *eigVals )
此函数来自Eigenobjects.cpp
for( i = 0; i < m1; i++ ) /* e.o. annulation */
{
float *be = ((float **) output)[i];
for( p = 0; p < eigSize.height; p++, be += eigStep )
for( l = 0; l < eigSize.width; l++ )
be[l] = 0.0f;
}
for( k = 0; k < nObjects; k++ )
{
uchar *bv = (ioFlags & CV_EIGOBJ_INPUT_CALLBACK) ? buf : ((uchar **) input)[k];
if( ioFlags & CV_EIGOBJ_INPUT_CALLBACK )
{
CvCallback read_callback = ((CvInput *) & input)->callback;
r = (CvStatus)read_callback( k, (void *) buf, userData );
if( r )
{
cvFree( &ev );
if( iev )
cvFree( &eigVals );
if( buffer )
cvFree( &buffer );
if( buf )
cvFree( &buf );
return r;
}
}
for( i = 0; i < m1; i++ )
{
float v = eigVals[i] * ev[i * nObjects + k];
float *be = ((float **) output)[i];
uchar *bu = bv;
bf = avg;
for( p = 0; p < size.height; p++, bu += objStep1,
bf += avgStep, be += eigStep1 )
{
for( l = 0; l < size.width - 3; l += 4 )
{
float f = bf[l];
uchar u = bu[l];
be[l] += v * (u - f);
f = bf[l + 1];
u = bu[l + 1];
be[l + 1] += v * (u - f);
f = bf[l + 2];
u = bu[l + 2];
be[l + 2] += v * (u - f);
f = bf[l + 3];
u = bu[l + 3];
be[l + 3] += v * (u - f);
}
for( ; l < size.width; l++ )
be[l] += v * (bu[l] - bf[l]);
}
} /* i */
} /* k */
我知道PCA是通过计算协方差矩阵及其特征值和特征向量,但当函数的一部分调用内部函数icvCalcCovarMatrixEx_8u32fR()来计算特征值和特征向量,然后“是什么目的[else part]中的上述代码“?我猜[else part]是计算特征向量,但函数icvCalcCovarMatrixEx_8u32fR()已经完成了, 那么,有没有人可以帮我回答这段代码的目的是什么?感谢!!!