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

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

Definition at line 389 of file Color64.h.

References NormalizeVector().

Referenced by ExtractCorrelogramTextureMoment().

00390     {
00391         const float fW2 = (float)sqrt(2.0);
00392         for (int y = 1; y < nHeight - 1; y ++)
00393         {
00394             float* pfCurr = pfImage + y * nWidth;
00395             float* pfPrev = pfCurr - nWidth;
00396             float* pfNext = pfCurr + nWidth;
00397 
00398             for (int x = 1; x < nWidth - 1; x ++)
00399             {
00400                 float af[8];
00401 
00402                 af[0] = pfPrev[x - 1] + pfPrev[x] + pfPrev[x + 1]
00403                         + pfCurr[x - 1] + pfCurr[x + 1]
00404                         + pfNext[x - 1] + pfNext[x] + pfNext[x + 1];
00405 
00406                 af[1] = - pfPrev[x - 1] + pfPrev[x] - pfPrev[x + 1]
00407                         + pfCurr[x - 1] + pfCurr[x + 1]
00408                         - pfNext[x - 1] + pfNext[x] - pfNext[x + 1];
00409 
00410                 af[2] = - pfPrev[x - 1] + pfPrev[x + 1] - pfNext[x - 1] + pfNext[x + 1]
00411                         + fW2 * (- pfCurr[x - 1] + pfCurr[x + 1]);
00412 
00413                 af[3] = - pfPrev[x - 1] - pfPrev[x + 1] + pfNext[x - 1] + pfNext[x + 1]
00414                         + fW2 * (- pfPrev[x] + pfNext[x]);
00415 
00416                 af[4] = fW2 * (- pfPrev[x] + pfCurr[x - 1] + pfCurr[x + 1] - pfNext[x]);
00417 
00418                 af[5] = fW2 * (pfPrev[x - 1] - pfPrev[x + 1] - pfNext[x - 1] + pfNext[x + 1]);
00419 
00420                 af[6] = pfPrev[x - 1] - pfPrev[x + 1] + pfNext[x - 1] - pfNext[x + 1]
00421                         + fW2 * (- pfCurr[x - 1] + pfCurr[x + 1]);
00422 
00423                 af[7] = - pfPrev[x - 1] - pfPrev[x + 1] + pfNext[x - 1] + pfNext[x + 1]
00424                         + fW2 * (pfPrev[x] - pfNext[x]);
00425 
00426                 /*float fValueNorm = af[0];
00427                 if (fValueNorm < 1e-4f)
00428                 {
00429                     fValueNorm = 1e-4f;
00430                 }
00431                 fValueNorm = 1.0f / fValueNorm;
00432                 */
00433                 for (int i = 1; i < 8; i ++)
00434                 {
00435                     //af[i] *= fValueNorm;
00436                     pfFeature[i - 1] += fabs(af[i]);
00437                     pfFeature[i + 6] += af[i] * af[i];
00438                 }
00439             }
00440         }
00441 
00442         float fSizeNorm = 1.0f / ((nWidth - 2) * (nHeight - 2));
00443         for (int i = 0; i < 7; i ++)
00444         {
00445             pfFeature[i] *= fSizeNorm;
00446             pfFeature[i + 7] = (float)sqrt(fabs(pfFeature[i + 7] * fSizeNorm - pfFeature[i] * pfFeature[i]));
00447         }
00448         NormalizeVector(pfFeature, 14);
00449     }

Here is the call graph for this function:


Generated on Fri Mar 19 11:08:45 2010 for ImpalaSrc by  doxygen 1.5.1