FACT++
1.0
Main Page
Related Pages
Namespaces
Classes
Files
Examples
float ClusterFinder::FindCluster
(
int32_t
x
,
int32_t
y
)
inline
private
Definition at line
34
of file
FilterLed.cc
.
References
i
.
Referenced by
FilterLed::Execute()
.
35
{
36
// if edge is touched stop finding cluster
37
if
(x<fX0 || x>=
fX1
|| y<fY0 || y>=
fY1
)
38
return
-1;
39
40
if
(
fCount
>
fLimitingSize
)
41
return
-2;
42
43
// get the value
44
float
val =
fImg
[y*
fW
+x];
45
46
// if its empty we have found the border of the cluster
47
if
(val==0)
48
return
0;
49
50
// mark the point as processed
51
fImg
[y*
fW
+x] = 0;
52
53
fSumX
+= x*val;
// sumx
54
fSumY
+= y*val;
// sumy
55
fCount
++;
56
57
float
rc[4];
58
rc[0] =
FindCluster
(x+1, y );
59
rc[1] =
FindCluster
(x, y+1);
60
rc[2] =
FindCluster
(x-1, y );
61
rc[3] =
FindCluster
(x, y-1);
62
63
for
(
int
i
=0;
i
<4;
i
++)
64
{
65
if
(rc[
i
]<0)
// check if edge is touched
66
return
rc[
i
];
67
68
val += rc[
i
];
69
}
70
71
return
val;
72
}
ClusterFinder::FindCluster
float FindCluster(int32_t x, int32_t y)
Definition:
FilterLed.cc:34
ClusterFinder::fSumY
float fSumY
Definition:
FilterLed.cc:32
i
int i
Definition:
db_dim_client.c:21
ClusterFinder::fLimitingSize
uint32_t fLimitingSize
Definition:
FilterLed.cc:28
ClusterFinder::fY1
int32_t fY1
Definition:
FilterLed.cc:26
ClusterFinder::fImg
uint8_t * fImg
Definition:
FilterLed.cc:17
ClusterFinder::fW
uint32_t fW
Definition:
FilterLed.cc:19
ClusterFinder::fX1
int32_t fX1
Definition:
FilterLed.cc:23
ClusterFinder::fSumX
float fSumX
Definition:
FilterLed.cc:31
ClusterFinder::fCount
uint32_t fCount
Definition:
FilterLed.cc:30
Here is the caller graph for this function:
ClusterFinder
Generated on Sun Sep 18 2016 20:50:43 for FACT++ by
1.8.11