SourceXtractorPlusPlus 0.21
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
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
31
32namespace SourceXtractor {
33
34class PeakValueTask : public SourceTask {
35
36public:
37
38 virtual ~PeakValueTask() = default;
39
41 // FIXME is it correct to use filtered values?
42 const auto& pixel_values = source.getProperty<DetectionFramePixelValues>().getFilteredValues();
43
44 auto& coordinates = source.getProperty<PixelCoordinateList>().getCoordinateList();
45
48
49 unsigned int index=0;
50 int peak_value_x=-1;
51 int peak_value_y=-1;
52 for (auto value = pixel_values.begin(); value!=pixel_values.end(); ++value){
53 //for(unsigned i : indices(pixel_values)) {
54 if (*value>peak_value){
55 peak_value = *value;
56 peak_value_x = coordinates[index].m_x;
57 peak_value_y = coordinates[index].m_y;
58 }
59 if (*value<min_value)
60 min_value=*value;
61 index++;
62 }
63 //std::cout << "Value: " << peak_value << "x/y: " << peak_value_x << " " << peak_value_y<< std::endl;
65 }
66
67
68private:
69
70};
71
72
73} /* namespace SourceXtractor */
74
75
76#endif /* _SEIMPLEMENTATION_PLUGIN_PEAKVALUE_PEAKVALUETASK_H_ */
The values of a Source's pixels in the detection image. They are returned as a vector in the same ord...
void computeProperties(SourceInterface &source) const override
Computes one or more properties for the Source.
virtual ~PeakValueTask()=default
The SourceInterface is an abstract "source" that has properties attached to it.
A Task that acts on a Source to compute one or more properties.
Definition SourceTask.h:36
T max(T... args)
T min(T... args)