LineOp.h
1 /*
2 
3 MIT License
4 
5 Copyright (c) 2017 FMI Open Development / Markus Peura, first.last@fmi.fi
6 
7 Permission is hereby granted, free of charge, to any person obtaining a copy
8 of this software and associated documentation files (the "Software"), to deal
9 in the Software without restriction, including without limitation the rights
10 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 copies of the Software, and to permit persons to whom the Software is
12 furnished to do so, subject to the following conditions:
13 
14 The above copyright notice and this permission notice shall be included in all
15 copies or substantial portions of the Software.
16 
17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 SOFTWARE.
24 
25 */
26 /*
27 Part of Rack development has been done in the BALTRAD projects part-financed
28 by the European Union (European Regional Development Fund and European
29 Neighbourhood Partnership Instrument, Baltic Sea Region Programme 2007-2013)
30 */
31 
32 #ifndef EMITTER_OP_H_
33 #define EMITTER_OP_H_
34 
35 
36 //#include "drain/imageops/GammaOp.h"
37 //#include "drain/imageops/HighBoostOp.h"
38 
39 
40 #include <drain/image/ImageFile.h>
41 #include "DetectorOp.h"
42 
43 
44 //using namespace drain::image;
45 
46 using namespace drain::image;
47 
48 namespace rack {
49 
51 // UNDER CONSTRUCTION.
52 // TODO Optional enchancement.
53 class LineOp: public DetectorOp {
54 
55 public:
56 
57  /*
58  *
59  * \param sensitivity - "contrast" between horz and vert medians (0.0...1.0) [0=detection, 1.0=overdetection]
60  * \param enhancement - post-enhancement: median reflMin for directional statistics
61  * \param eHeight - post-enhancement: spread radius for directional statistics
62  *
63  */
64 
72  LineOp(double lengthMin=5, double widthMax=10.0, double reflMin=-10.0, double reflMin2=std::numeric_limits<double>::min(), double reflMin3=std::numeric_limits<double>::min()) : //, double sensitivity=1.0) : //, double enhancement = 0.0) :
73  DetectorOp(__FUNCTION__, "Detects lines caused by electromagnetic interference.", "emitter.line")
74  {
75  REQUIRE_STANDARD_DATA = true;
76  parameters.link("lengthMin", this->lengthMin = lengthMin, "km");
77  parameters.link("widthMax", this->widthMax = widthMax, "deg");
78  parameters.link("reflMin", this->reflMin = reflMin, "dBZ");
79  parameters.link("reflMin2", this->reflMin2 = reflMin2, "dBZ");
80  parameters.link("reflMin3", this->reflMin3 = reflMin3, "dBZ");
81  //parameters.link("sensitivity", this->sensitivity, sensitivity);
82  // parameters.link("enhancement", this->enhancement, enhancement);
83  // parameters.link("eHeight", this->eHeight, eHeight);
84  dataSelector.setQuantities("DBZH"); // ,"DBZV
85  //double d =
86  }
87 
88 
89  double lengthMin;
90  double widthMax;
91  double reflMin;
92  double reflMin2;
93  double reflMin3;
94 
95  double sensitivity;
96  //double enhancement;
97  //float eHeight;
98 
99 
100 protected:
101 
102  virtual
103  //void filterImage(const PolarODIM &odimIn, const Image &src, Image &dst) const;
104  void runDetector(const PlainData<PolarSrc> &src, PlainData<PolarDst> &dst) const;
105 };
106 
107 }
108 
109 #endif /* POLARTOCARTESIANOP_H_ */
110 
111 // Rack
Base class for anomaly detectors.
Definition: DetectorOp.h:49
Quick emitter detection based on subtracting a horizontal segment lengths by inversed vertical segmen...
Definition: LineOp.h:53
LineOp(double lengthMin=5, double widthMax=10.0, double reflMin=-10.0, double reflMin2=std::numeric_limits< double >::min(), double reflMin3=std::numeric_limits< double >::min())
Definition: LineOp.h:72
Essential class for storing radar data.
Definition: Data.h:302
Namespace for images and image processing tools.
Definition: AccumulationArray.cpp:45
Definition: DataSelector.cpp:44