SourceXtractorPlusPlus  0.11
Please provide a description of the project.
PeakValueTask.h
Go to the documentation of this file.
1 
17 /*
18  * PeakValueTask.h
19  *
20  * Created on: Feb 9, 2017
21  * Author: mschefer
22  */
23 
24 #ifndef _SEIMPLEMENTATION_PLUGIN_PEAKVALUE_PEAKVALUETASK_H_
25 #define _SEIMPLEMENTATION_PLUGIN_PEAKVALUE_PEAKVALUETASK_H_
26 
30 
31 namespace SourceXtractor {
32 
33 class PeakValueTask : public SourceTask {
34 
35 public:
36 
37  virtual ~PeakValueTask() = default;
38 
39  virtual void computeProperties(SourceInterface& source) const override {
40  // FIXME is it correct to use filtered values?
41  const auto& pixel_values = source.getProperty<DetectionFramePixelValues>().getFilteredValues();
42 
45  for (auto value : pixel_values) {
46  peak_value = std::max(peak_value, value);
47  min_value = std::min(min_value, value);
48  }
49 
50  source.setProperty<PeakValue>(min_value, peak_value);
51  }
52 
53 
54 private:
55 
56 };
57 
58 
59 } /* namespace SourceXtractor */
60 
61 
62 #endif /* _SEIMPLEMENTATION_PLUGIN_PEAKVALUE_PEAKVALUETASK_H_ */
A Task that acts on a Source to compute one or more properties.
Definition: SourceTask.h:36
T min(T... args)
virtual void computeProperties(SourceInterface &source) const override
Computes one or more properties for the Source.
Definition: PeakValueTask.h:39
const PropertyType & getProperty(unsigned int index=0) const
Convenience template method to call getProperty() with a more user-friendly syntax.
T max(T... args)
The values of a Source&#39;s pixels in the detection image. They are returned as a vector in the same ord...
The SourceInterface is an abstract "source" that has properties attached to it.
virtual ~PeakValueTask()=default