FACT++  1.0
void ClusterFinder::FindCluster ( vector< Led > &  leds,
int32_t  x0 = 0,
int32_t  y0 = 0,
int32_t  x1 = 0,
int32_t  y1 = 0 
)
inline

Definition at line 118 of file FilterLed.cc.

References mag.

119  {
120  fX0 = x0;
121  fY0 = y0;
122  fX1 = x1==0?fW:x1;
123  fY1 = y1==0?fH:y1;
124 
125  for (int32_t x=fX0; x<fX1; x++)
126  for (int32_t y=fY0; y<fY1; y++)
127  {
128  const uint8_t &b = fImg[y*fW+x];
129  if (b==0)
130  continue;
131 
132  const float mag = FindClusterAt(x, y);
133  if (fCount>999)
134  {
135  cout << "ERROR - Spot with Size>999 detected..." << endl;
136  return;
137  }
138 
139  if (mag>0 && fCount>4)
140  leds.push_back(Led(fSumX/mag, fSumY/mag, 0, mag));
141  }
142  //leds.Compress();
143  }
int32_t fY0
Definition: FilterLed.cc:25
float mag
Definition: HeadersSQM.h:89
Definition: Led.h:8
uint32_t fH
Definition: FilterLed.cc:20
float FindClusterAt(int32_t x, int32_t y)
Definition: FilterLed.cc:101
int32_t fY1
Definition: FilterLed.cc:26
uint8_t * fImg
Definition: FilterLed.cc:17
uint32_t fW
Definition: FilterLed.cc:19
int32_t fX0
Definition: FilterLed.cc:22
int32_t fX1
Definition: FilterLed.cc:23
uint32_t fCount
Definition: FilterLed.cc:30