Loading...
Searching...
No Matches
FuzzyDetectorOp.h
1/*
2
3MIT License
4
5Copyright (c) 2017 FMI Open Development / Markus Peura, first.last@fmi.fi
6
7Permission is hereby granted, free of charge, to any person obtaining a copy
8of this software and associated documentation files (the "Software"), to deal
9in the Software without restriction, including without limitation the rights
10to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11copies of the Software, and to permit persons to whom the Software is
12furnished to do so, subject to the following conditions:
13
14The above copyright notice and this permission notice shall be included in all
15copies or substantial portions of the Software.
16
17THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23SOFTWARE.
24
25*/
26/*
27Part of Rack development has been done in the BALTRAD projects part-financed
28by the European Union (European Regional Development Fund and European
29Neighbourhood Partnership Instrument, Baltic Sea Region Programme 2007-2013)
30*/
31#ifndef RACK_FUZZY_DUALPOL_OP
32#define RACK_FUZZY_DUALPOL_OP
33
34#include <string>
35
36#include <drain/image/Image.h>
37#include <drain/image/Window.h>
38#include <drain/imageops/ImageOp.h>
39
40
41#include "andre/DetectorOp.h"
42
43namespace rack {
44
45
47
51
52protected:
53
54 inline
55 FuzzyDetectorOp(const std::string & name, const std::string & description, const std::string & classCode, bool vrad_flip) :
56 DetectorOp(name, description, classCode) {
57 dataSelector.setQuantities("DBZ:VRAD:RHOHV:ZDR");
58 };
59
60
61 inline
63 this->parameters.copyStruct(op.getParameters(), op, *this);
64 };
65
66 virtual inline
68
69
70 double dbzParam = 0.0; // Peak or threshold location (hence "param").
71 double vradDevThreshold = 2.0;
72 double rhoHVthreshold = 0.95;
73 double zdrAbsThreshold = 2.0;
75 // RadarWindowConfig windowConf;
76 double gammaAdjustment = 2.0; // neutral value, post-processing
77
78
79 virtual
80 void runDetection(const DataSet<PolarSrc> & src, PlainData<PolarDst> & dstProb, DataSet<PolarDst> & dstAux) const;
81
82
83protected:
84
85 // void init(double dbzPeak, double vradDevMax, double rhoHVmax, double zdrDevMin, double windowWidth, double windowHeight);
86 //void init(double dbzPeak, double vradDevMax, double rhoHVmax, double zdrDevMin, double windowWidth, double windowHeight);
87
88
89 virtual
90 void computeFuzzyDBZ(const PlainData<PolarSrc> & src, PlainData<PolarDst> & dstData, DataSet<PolarDst> & dstProduct) const = 0;
91
92 virtual
93 void computeFuzzyVRAD(const PlainData<PolarSrc> & src, PlainData<PolarDst> & dstData, DataSet<PolarDst> & dstProduct) const = 0;
94
95 virtual
96 void computeFuzzyZDR(const PlainData<PolarSrc> & src, PlainData<PolarDst> & dstData, DataSet<PolarDst> & dstProduct) const = 0;
97
98 virtual
99 void computeFuzzyRHOHV(const PlainData<PolarSrc> & src, PlainData<PolarDst> & dstData, DataSet<PolarDst> & dstProduct) const = 0;
100
102
109 void applyOperator(const ImageOp & op, const PlainData<PolarSrc> & src, PlainData<PolarDst> & dstData, DataSet<PolarDst> & dstProductAux) const;
110
112 static
113 void getGammaLookUpTable(double p, std::vector<unsigned char> & lookUpTable);
114
115};
116
117
118}
119
120#endif
121
122// Rack
void copyStruct(const ReferenceMap &m, const T &src, T &dst, extLinkPolicy policy=RESERVE)
Experimental. Copies references and values of a structure to another.
Definition ReferenceMap.h:399
Base class for image processing functions.
Definition ImageOp.h:49
Base class for configurations applied in image processing windows, e.g. for operators of type WindowO...
Definition Window.h:56
void setQuantities(const std::string &s)
Sets basic quantities and quality quantities. These sets are separated by '/'.
Definition DataSelector.cpp:282
A map of radar data, indexed by quantity code (DBZH, VRAD, etc).
Definition Data.h:1215
Base class for anomaly detectors.
Definition DetectorOp.h:49
Base class for BirdOp and InsectOp.
Definition FuzzyDetectorOp.h:50
void applyOperator(const ImageOp &op, const PlainData< PolarSrc > &src, PlainData< PolarDst > &dstData, DataSet< PolarDst > &dstProductAux) const
Convenience function for "accumulating" detection results.
Definition FuzzyDetectorOp.cpp:69
virtual void runDetection(const DataSet< PolarSrc > &src, PlainData< PolarDst > &dstProb, DataSet< PolarDst > &dstAux) const
Process as sweep (data in one elevation angle)
Definition FuzzyDetectorOp.cpp:135
static void getGammaLookUpTable(double p, std::vector< unsigned char > &lookUpTable)
Returns a 256-element map of Gamma corrected values, scaled by 256.
Definition FuzzyDetectorOp.cpp:51
Essential class for storing radar data.
Definition Data.h:300
Definition DataSelector.cpp:44