FACT++  1.0
MCaos.h
Go to the documentation of this file.
1 #ifndef CAOS_MCaos
2 #define CAOS_MCaos
3 
4 #ifndef CAOS_Ring
5 #include "Ring.h"
6 #endif
7 
8 class MCaos
9 {
10 private:
11  std::vector<Led> fPositions;
12  std::vector<Led> fLeds;
13 
14  int16_t fMinNumberLeds; // minimum number of detected leds required
15  double fMinRadius; // minimum radius for cut in ring radius
16  double fMaxRadius; // maximum radius for cut in ring radius
17  uint16_t fSizeBox; // Size of the search box (side length in units of pixels)
18  double fCut; // Cleaning level (sigma above noise)
19 
21 
23  std::vector<Ring> fRings;
24 
25  void CalcCenters(const std::vector<Led> &leds, float min, float max);
26  int32_t CalcRings(std::vector<Led> &leds, float min=-1, float max=-1);
27  const Ring &GetCenter() const { return fCenter; }
28 
29 public:
30  MCaos() : fMinRadius(236.7), fMaxRadius(238.6), fSizeBox(19), fCut(3.5)
31  {
32  }
33 
35  {
36  }
37 
38  void AddPosition(float x, float y, float phi)
39  {
40  fPositions.push_back(Led(x, y, phi));
41  }
42 
43  void ReadResources(const char *name="leds.txt");
44 
45  void SetMinNumberLeds(int16_t n)
46  {
47  fMinNumberLeds = n;
48  }
49 
50  void SetMinRadius(double min) { fMinRadius=min; }
51  void SetMaxRadius(double max) { fMaxRadius=max; }
52 
53  int32_t GetNumDetectedLEDs() const { return fLeds.size(); }
54  int32_t GetNumDetectedRings() const { return fNumDetectedRings; }
55 
56  Ring Run(uint8_t *img);
57 };
58 
59 #endif
Ring Run(uint8_t *img)
Definition: MCaos.cc:86
int32_t CalcRings(std::vector< Led > &leds, float min=-1, float max=-1)
Definition: MCaos.cc:74
MCaos()
Definition: MCaos.h:30
void SetMaxRadius(double max)
Definition: MCaos.h:51
double fCut
Definition: MCaos.h:18
std::vector< Led > fLeds
Definition: MCaos.h:12
Ring fCenter
Definition: MCaos.h:22
int32_t fNumDetectedRings
Definition: MCaos.h:20
Definition: Led.h:8
~MCaos()
Definition: MCaos.h:34
Definition: Ring.h:10
void AddPosition(float x, float y, float phi)
Definition: MCaos.h:38
double fMaxRadius
Definition: MCaos.h:16
void CalcCenters(const std::vector< Led > &leds, float min, float max)
Definition: MCaos.cc:42
const Ring & GetCenter() const
Definition: MCaos.h:27
std::vector< Ring > fRings
Definition: MCaos.h:23
std::vector< Led > fPositions
Definition: MCaos.h:11
uint16_t fSizeBox
Definition: MCaos.h:17
Definition: MCaos.h:8
int32_t GetNumDetectedRings() const
Definition: MCaos.h:54
void SetMinNumberLeds(int16_t n)
Definition: MCaos.h:45
int32_t GetNumDetectedLEDs() const
Definition: MCaos.h:53
double fMinRadius
Definition: MCaos.h:15
void SetMinRadius(double min)
Definition: MCaos.h:50
int16_t fMinNumberLeds
Definition: MCaos.h:14
void ReadResources(const char *name="leds.txt")
Definition: MCaos.cc:13