SourceXtractorPlusPlus  0.16
Please provide a description of the project.
DetectionFramePixelValuesTask.cpp
Go to the documentation of this file.
1 
22 #include <memory>
23 
26 
29 
30 namespace SourceXtractor {
31 
33  const auto& stamp = source.getProperty<DetectionFrameSourceStamp>();
34 
35  auto& detection_image = stamp.getStamp();
36  auto& filtered_image = stamp.getFilteredStamp();
37  auto& variance_map = stamp.getVarianceStamp();
38 
39  auto offset = stamp.getTopLeft();
40 
41  std::vector<DetectionImage::PixelType> values, filtered_values;
43  for (auto pixel_coord : source.getProperty<PixelCoordinateList>().getCoordinateList()) {
44  auto offset_coord = pixel_coord - offset;
45  values.push_back(detection_image.getValue(offset_coord.m_x, offset_coord.m_y));
46  filtered_values.push_back(filtered_image.getValue(offset_coord.m_x, offset_coord.m_y));
47  variances.push_back(variance_map.getValue(offset_coord.m_x, offset_coord.m_y));
48  }
49 
50  source.setProperty<DetectionFramePixelValues>(std::move(values), std::move(filtered_values), std::move(variances));
51 }
52 
53 } // SEImplementation namespace
54 
virtual void computeProperties(SourceInterface &source) const override
Computes one or more properties for the Source.
The values of a Source's pixels in the detection image. They are returned as a vector in the same ord...
A copy of the rectangular region of the detection image just large enough to include the whole Source...
const DetectionVectorImage & getStamp() const
const std::vector< PixelCoordinate > & getCoordinateList() const
The SourceInterface is an abstract "source" that has properties attached to it.
const PropertyType & getProperty(unsigned int index=0) const
Convenience template method to call getProperty() with a more user-friendly syntax.
T move(T... args)
T push_back(T... args)