SourceXtractorPlusPlus 0.21
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
JacobianTask.cpp
Go to the documentation of this file.
1
17/*
18 * JacobianTask.cpp
19 *
20 * Created on: Oct 08, 2018
21 * Author: Alejandro Alvarez Ayllon
22 */
23
24#include <iostream>
25
29
31
34
35namespace SourceXtractor {
36
38 auto measurement_frame_coordinates = group.begin()->getProperty<MeasurementFrameCoordinates>(m_instance).getCoordinateSystem();
39 auto reference_coordinates = group.begin()->getProperty<ReferenceCoordinates>().getCoordinateSystem();
41
42 double x = detection_group_stamp.getTopLeft().m_x + detection_group_stamp.getStamp().getWidth() / 2.0;
43 double y = detection_group_stamp.getTopLeft().m_y + detection_group_stamp.getStamp().getHeight() / 2.0;
44
46 auto frame_dx = measurement_frame_coordinates->worldToImage(
47 reference_coordinates->imageToWorld(ImageCoordinate(x + 1.0, y)));
48 auto frame_dy = measurement_frame_coordinates->worldToImage(
49 reference_coordinates->imageToWorld(ImageCoordinate(x, y + 1.0)));
50
51 group.setIndexedProperty<JacobianGroup>(m_instance,
52 frame_dx.m_x - frame_origin.m_x, frame_dx.m_y - frame_origin.m_y,
53 frame_dy.m_x - frame_origin.m_x, frame_dy.m_y - frame_origin.m_y);
54}
55
57 auto measurement_frame_coordinates = source.getProperty<MeasurementFrameCoordinates>(m_instance).getCoordinateSystem();
58 auto reference_coordinates = source.getProperty<ReferenceCoordinates>().getCoordinateSystem();
59 auto world_centroid = source.getProperty<WorldCentroid>().getCentroid();
60
62 double x = reference_centroid.m_x;
63 double y = reference_centroid.m_y;
64
66 auto frame_dx = measurement_frame_coordinates->worldToImage(
67 reference_coordinates->imageToWorld(ImageCoordinate(x + 1.0, y)));
68 auto frame_dy = measurement_frame_coordinates->worldToImage(
69 reference_coordinates->imageToWorld(ImageCoordinate(x, y + 1.0)));
70
71 source.setIndexedProperty<JacobianSource>(m_instance,
72 frame_dx.m_x - frame_origin.m_x, frame_dx.m_y - frame_origin.m_y,
73 frame_dy.m_x - frame_origin.m_x, frame_dy.m_y - frame_origin.m_y);
74}
75
76} // end SourceXtractor
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > x
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > y
void computeProperties(SourceGroupInterface &source) const override
Computes one or more properties for the SourceGroup and/or the Sources it contains.
void computeProperties(SourceInterface &source) const override
Computes one or more properties for the Source.
Defines the interface used to group sources.
The SourceInterface is an abstract "source" that has properties attached to it.