SourceXtractorPlusPlus  0.15
Please provide a description of the project.
MeasurementFramePixelCentroidTask.cpp
Go to the documentation of this file.
1 
17 /*
18  * MeasurementFramePixelCentroidTask.cpp
19  *
20  * Created on: Oct 31, 2016
21  * Author: mschefer
22  */
23 
26 
30 
31 namespace SourceXtractor {
32 
34  auto detection_coordinate_system = source.getProperty<DetectionFrameCoordinates>().getCoordinateSystem();
35  auto measurement_coordinate_system = source.getProperty<MeasurementFrameCoordinates>(m_instance).getCoordinateSystem();
36  auto pixel_centroid = source.getProperty<PixelCentroid>();
37 
38  ImageCoordinate detection_image_coordinate(pixel_centroid.getCentroidX(), pixel_centroid.getCentroidY());
39  auto world_coordinate = detection_coordinate_system->imageToWorld(detection_image_coordinate);
40  auto measurement_image_coordinate = measurement_coordinate_system->worldToImage(world_coordinate);
41 
43  m_instance, measurement_image_coordinate.m_x, measurement_image_coordinate.m_y);
44 }
45 
46 }
47 
virtual void computeProperties(SourceInterface &source) const override
Computes one or more properties for the Source.
The centroid of all the pixels in the source, weighted by their DetectionImage pixel values.
Definition: PixelCentroid.h:37
The SourceInterface is an abstract "source" that has properties attached to it.
void setIndexedProperty(std::size_t index, Args... args)
Convenience template method to call setProperty() with a more user-friendly syntax.
const PropertyType & getProperty(unsigned int index=0) const
Convenience template method to call getProperty() with a more user-friendly syntax.