Home || Visual Search || Applications || Architecture || Important Messages || OGL || Src

void Impala::Core::Feature::Color64::ExtractTextureMoment ( float *  pfImage,
int  nWidth,
int  nHeight,
float *  pfFeature 
) [inline]

Definition at line 419 of file Color64.h.

References NormalizeVector().

Referenced by ExtractCorrelogramTextureMoment().

00420     {
00421         const float fW2 = (float)sqrt(2.0);
00422         for (int y = 1; y < nHeight - 1; y ++)
00423         {
00424             float* pfCurr = pfImage + y * nWidth;
00425             float* pfPrev = pfCurr - nWidth;
00426             float* pfNext = pfCurr + nWidth;
00427 
00428             for (int x = 1; x < nWidth - 1; x ++)
00429             {
00430                 float af[8];
00431 
00432                 af[0] = pfPrev[x - 1] + pfPrev[x] + pfPrev[x + 1]
00433                         + pfCurr[x - 1] + pfCurr[x + 1]
00434                         + pfNext[x - 1] + pfNext[x] + pfNext[x + 1];
00435 
00436                 af[1] = - pfPrev[x - 1] + pfPrev[x] - pfPrev[x + 1]
00437                         + pfCurr[x - 1] + pfCurr[x + 1]
00438                         - pfNext[x - 1] + pfNext[x] - pfNext[x + 1];
00439 
00440                 af[2] = - pfPrev[x - 1] + pfPrev[x + 1] - pfNext[x - 1] + pfNext[x + 1]
00441                         + fW2 * (- pfCurr[x - 1] + pfCurr[x + 1]);
00442 
00443                 af[3] = - pfPrev[x - 1] - pfPrev[x + 1] + pfNext[x - 1] + pfNext[x + 1]
00444                         + fW2 * (- pfPrev[x] + pfNext[x]);
00445 
00446                 af[4] = fW2 * (- pfPrev[x] + pfCurr[x - 1] + pfCurr[x + 1] - pfNext[x]);
00447 
00448                 af[5] = fW2 * (pfPrev[x - 1] - pfPrev[x + 1] - pfNext[x - 1] + pfNext[x + 1]);
00449 
00450                 af[6] = pfPrev[x - 1] - pfPrev[x + 1] + pfNext[x - 1] - pfNext[x + 1]
00451                         + fW2 * (- pfCurr[x - 1] + pfCurr[x + 1]);
00452 
00453                 af[7] = - pfPrev[x - 1] - pfPrev[x + 1] + pfNext[x - 1] + pfNext[x + 1]
00454                         + fW2 * (pfPrev[x] - pfNext[x]);
00455 
00456                 /*float fValueNorm = af[0];
00457                 if (fValueNorm < 1e-4f)
00458                 {
00459                     fValueNorm = 1e-4f;
00460                 }
00461                 fValueNorm = 1.0f / fValueNorm;
00462                 */
00463                 for (int i = 1; i < 8; i ++)
00464                 {
00465                     //af[i] *= fValueNorm;
00466                     pfFeature[i - 1] += fabs(af[i]);
00467                     pfFeature[i + 6] += af[i] * af[i];
00468                 }
00469             }
00470         }
00471 
00472         float fSizeNorm = 1.0f / ((nWidth - 2) * (nHeight - 2));
00473         for (int i = 0; i < 7; i ++)
00474         {
00475             pfFeature[i] *= fSizeNorm;
00476             pfFeature[i + 7] = (float)sqrt(fabs(pfFeature[i + 7] * fSizeNorm - pfFeature[i] * pfFeature[i]));
00477         }
00478         NormalizeVector(pfFeature, 14);
00479     }

Here is the call graph for this function:


Generated on Thu Jan 13 09:19:07 2011 for ImpalaSrc by  doxygen 1.5.1