[2613] | 1 | // |
---|
| 2 | // C++ Interface: GenericEdgeDetector |
---|
| 3 | // |
---|
| 4 | // Description: |
---|
| 5 | // |
---|
| 6 | // |
---|
| 7 | // Author: Takeshi Nakazato <takeshi.nakazato@nao.ac.jp>, (C) 2012 |
---|
| 8 | // |
---|
| 9 | // Copyright: See COPYING file that comes with this distribution |
---|
| 10 | // |
---|
| 11 | // |
---|
| 12 | #ifndef _GENERIC_EDGE_DETECTOR_H_ |
---|
| 13 | #define _GENERIC_EDGE_DETECTOR_H_ |
---|
| 14 | |
---|
| 15 | #include <casa/Arrays/Vector.h> |
---|
| 16 | #include <casa/Containers/Record.h> |
---|
| 17 | |
---|
| 18 | #include "EdgeDetector.h" |
---|
| 19 | |
---|
| 20 | namespace asap { |
---|
| 21 | |
---|
| 22 | class GenericEdgeDetector : public EdgeDetector |
---|
| 23 | { |
---|
| 24 | public: |
---|
| 25 | GenericEdgeDetector() ; |
---|
| 26 | virtual ~GenericEdgeDetector() ; |
---|
| 27 | |
---|
[3106] | 28 | casacore::Vector<casacore::uInt> detect() ; |
---|
[2613] | 29 | |
---|
| 30 | private: |
---|
| 31 | // parse options |
---|
[3106] | 32 | void parseOption( const casacore::Record &option ) ; |
---|
[2613] | 33 | |
---|
| 34 | // steps for edge detection algorithm |
---|
| 35 | void topixel() ; |
---|
| 36 | void countup() ; |
---|
| 37 | void thresholding() ; |
---|
| 38 | void labeling() ; |
---|
| 39 | void trimming() ; |
---|
| 40 | void selection() ; |
---|
| 41 | void tuning() ; |
---|
| 42 | |
---|
| 43 | // internal methods |
---|
| 44 | void setup() ; |
---|
[3106] | 45 | casacore::uInt _labeling() ; |
---|
| 46 | casacore::uInt __labeling( casacore::Vector<casacore::uInt> &a ) ; |
---|
| 47 | casacore::uInt _trimming() ; |
---|
| 48 | casacore::uInt _trimming1DX() ; |
---|
| 49 | casacore::uInt _trimming1DY() ; |
---|
| 50 | casacore::uInt _trimming1D( casacore::Vector<casacore::uInt> &a ) ; |
---|
| 51 | void _search( casacore::uInt &start, |
---|
| 52 | casacore::uInt &end, |
---|
| 53 | const casacore::Vector<casacore::uInt> &a ) ; |
---|
[2613] | 54 | |
---|
| 55 | // pixel info |
---|
[3106] | 56 | casacore::Double cenx_ ; |
---|
| 57 | casacore::Double ceny_ ; |
---|
| 58 | casacore::Double pcenx_ ; |
---|
| 59 | casacore::Double pceny_ ; |
---|
| 60 | casacore::uInt nx_ ; |
---|
| 61 | casacore::uInt ny_ ; |
---|
| 62 | casacore::Double dx_ ; |
---|
| 63 | casacore::Double dy_ ; |
---|
[2613] | 64 | |
---|
| 65 | // storage for detection |
---|
[3106] | 66 | casacore::Matrix<casacore::Double> pdir_ ; |
---|
| 67 | casacore::Matrix<casacore::uInt> apix_ ; |
---|
[2613] | 68 | |
---|
| 69 | // options |
---|
[3106] | 70 | casacore::Float width_ ; |
---|
| 71 | casacore::Float fraction_ ; |
---|
| 72 | casacore::Bool elongated_ ; |
---|
[2613] | 73 | } ; |
---|
| 74 | |
---|
| 75 | } |
---|
| 76 | #endif /* _GENERIC_EDGE_DETECTOR_H_ */ |
---|