[742] | 1 | #ifndef OBJECT_GROWER_H |
---|
| 2 | #define OBJECT_GROWER_H |
---|
| 3 | |
---|
| 4 | #include <iostream> |
---|
| 5 | #include <duchamp/duchamp.hh> |
---|
| 6 | #include <Detection/detection.hh> |
---|
| 7 | #include <Cubes/cubes.hh> |
---|
| 8 | #include <duchamp/Utils/Statistics.hh> |
---|
| 9 | |
---|
| 10 | namespace duchamp { |
---|
| 11 | |
---|
[759] | 12 | /// @brief Flags defining the state of each pixel |
---|
[742] | 13 | enum STATE {AVAILABLE, DETECTED, BLANK, MW}; |
---|
| 14 | |
---|
[759] | 15 | /// @brief A class to manage the growing of objects to a secondary |
---|
| 16 | /// threshold |
---|
| 17 | /// @details This class provides a mechanism for handling the |
---|
| 18 | /// growing of objects. By keeping track of the state of each pixel, |
---|
| 19 | /// through an array of flags indicating whether a pixel is |
---|
| 20 | /// available or in an object, it is able to efficiently grow the |
---|
| 21 | /// objects from pixels on the edge, rather than spending time |
---|
| 22 | /// examining pixels that are completely surrounded by other object |
---|
| 23 | /// pixels. |
---|
[742] | 24 | class ObjectGrower |
---|
| 25 | { |
---|
| 26 | public: |
---|
[759] | 27 | /// @brief Default constructor |
---|
[742] | 28 | ObjectGrower(); |
---|
[759] | 29 | /// @brief Destrctor |
---|
[742] | 30 | virtual ~ObjectGrower(){}; |
---|
[759] | 31 | /// @brief Copy constructor |
---|
[742] | 32 | ObjectGrower(ObjectGrower &o); |
---|
[759] | 33 | /// @brief Copy operator |
---|
[742] | 34 | ObjectGrower& operator=(const ObjectGrower &o); |
---|
| 35 | |
---|
[759] | 36 | /// @brief Set up the class with parameters & pointers from the cube |
---|
[742] | 37 | void define(Cube *theCube); |
---|
[759] | 38 | /// @brief Grow an object |
---|
[742] | 39 | void grow(Detection *theObject); |
---|
| 40 | |
---|
| 41 | protected: |
---|
[759] | 42 | std::vector<STATE> itsFlagArray; ///< The array of pixel flags |
---|
| 43 | std::vector<long> itsArrayDim; ///< The dimensions of the array |
---|
| 44 | Statistics::StatsContainer<float> itsGrowthStats; ///< The statistics used to determine membership of an object |
---|
| 45 | int itsSpatialThresh; ///< The spatial threshold for merging |
---|
| 46 | int itsVelocityThresh; ///< The spectral threshold for merging |
---|
| 47 | float* itsFluxArray; ///< The location of the pixel values |
---|
[742] | 48 | }; |
---|
| 49 | |
---|
| 50 | } |
---|
| 51 | |
---|
| 52 | |
---|
| 53 | #endif |
---|