| Last change
 on this file since 19267 was             18622, checked in by tbretz, 9 years ago | 
        
          | Removed references to root and obsolete code | 
        
          | File size:
            1.4 KB | 
      
      
| Line |  | 
|---|
| 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 |  | 
|---|
| 20 | int32_t fNumDetectedRings; | 
|---|
| 21 |  | 
|---|
| 22 | Ring fCenter; | 
|---|
| 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 |  | 
|---|
| 34 | ~MCaos() | 
|---|
| 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 | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.