Definition at line 385 of file Color64.h. References BYTE, and NormalizeVector(). Referenced by ExtractCorrelogramTextureMoment(). 00386 { 00387 float afHistogram[50], afCorrelogram[50]; 00388 memset(afHistogram, 0, sizeof(afHistogram)); 00389 memset(afCorrelogram, 0, sizeof(afCorrelogram)); 00390 00391 for (int y = 1; y < nHeight - 1; y ++) 00392 { 00393 BYTE* pbCurr = pbImage + y * nWidth; 00394 BYTE* pbPrev = pbCurr - nWidth; 00395 BYTE* pbNext = pbCurr + nWidth; 00396 00397 for (int x = 1; x < nWidth - 1; x ++) 00398 { 00399 // Note: nIndex = [0,43] 00400 int nIndex = pbCurr[x]; 00401 int nCount = (pbPrev[x - 1] == nIndex) + (pbPrev[x] == nIndex) + (pbPrev[x + 1] == nIndex) 00402 + (pbCurr[x - 1] == nIndex) + (pbCurr[x + 1] == nIndex) 00403 + (pbNext[x - 1] == nIndex) + (pbNext[x] == nIndex) + (pbNext[x + 1] == nIndex); 00404 afHistogram[nIndex] ++; 00405 afCorrelogram[nIndex] += nCount; 00406 } 00407 } 00408 00409 for (int i = 0; i < 50; i ++) 00410 { 00411 if (afHistogram[i] > 0) 00412 { 00413 pfFeature[i] = afCorrelogram[i] / afHistogram[i]; 00414 } 00415 } 00416 NormalizeVector(pfFeature, 50); 00417 }
Here is the call graph for this function:
|