#if !defined(__FV_BLOB_INCLUDED__) #define __FV_BLOB_INCLUDED__ #include #include #include class CEdgeBlobData { public: CEdgeBlobData() { Reset(); } CEdgeBlobData(int x, int y) { Reset(); fCenterX = (float)x; fCenterY = (float)y; } CEdgeBlobData(int left, int top, int right, int bottom) { Reset(); nLeft = left; nTop = top; nRight = right; nBottom = bottom; fCenterX = float(left) + float(right-left) / 2.f; fCenterY = float(top) + float(bottom-top) / 2.f; } void Reset() { fCenterX = 0; fCenterY = 0; nLeft = 0; nTop = 0; nRight = 0; nBottom = 0; fMassCenterX = 0; fMassCenterY = 0; nPixelCount = 0; fMatchScore = 0; bFiltering = FALSE; } int Width() { return nRight - nLeft + 1; } int Height() { return nBottom - nTop + 1; } float fCenterX; float fCenterY; int nLeft; int nTop; int nRight; int nBottom; int nPixelCount; float fMassCenterX; float fMassCenterY; float fMatchScore; BOOL bFiltering; }; typedef std::list ListEdgeBlobData; typedef std::list::iterator ListEdgeBlobDataIt; class AFX_EXT_CLASS CBlobTool { // Construction public: CBlobTool(); ~CBlobTool(); public: bool BlobAnalysis(BYTE *pImageData, int nWidth, int nHeight, int nStep, ListEdgeBlobData &blobList, int nMergeRange); }; #endif