1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#if !defined(__FV_BLOB_INCLUDED__)
#define __FV_BLOB_INCLUDED__
 
#include <map>
#include <list>
#include <vector>
 
 
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<CEdgeBlobData*>                    ListEdgeBlobData;
typedef std::list<CEdgeBlobData*>::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