SourceXtractorPlusPlus
0.21
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
SEImplementation
src
lib
Plugin
Jacobian
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
26
#include "
SEImplementation/Plugin/DetectionFrameGroupStamp/DetectionFrameGroupStamp.h
"
27
#include "
SEImplementation/Plugin/ReferenceCoordinates/ReferenceCoordinates.h
"
28
#include "
SEImplementation/Plugin/WorldCentroid/WorldCentroid.h
"
29
30
#include "
SEImplementation/Plugin/MeasurementFrameCoordinates/MeasurementFrameCoordinates.h
"
31
32
#include "
SEImplementation/Plugin/Jacobian/Jacobian.h
"
33
#include "
SEImplementation/Plugin/Jacobian/JacobianTask.h
"
34
35
namespace
SourceXtractor
{
36
37
void
JacobianGroupTask::computeProperties
(
SourceGroupInterface
&
group
)
const
{
38
auto
measurement_frame_coordinates
=
group
.begin()->getProperty<
MeasurementFrameCoordinates
>(
m_instance
).getCoordinateSystem();
39
auto
reference_coordinates
=
group
.begin()->getProperty<
ReferenceCoordinates
>().getCoordinateSystem();
40
auto
&
detection_group_stamp
=
group
.getProperty<
DetectionFrameGroupStamp
>();
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
45
auto
frame_origin
=
measurement_frame_coordinates
->worldToImage(
reference_coordinates
->imageToWorld(
ImageCoordinate
(
x
,
y
)));
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
56
void
JacobianSourceTask::computeProperties
(
SourceInterface
&
source
)
const
{
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
61
auto
reference_centroid
=
reference_coordinates
->worldToImage(
world_centroid
);
62
double
x
=
reference_centroid
.m_x;
63
double
y
=
reference_centroid
.m_y;
64
65
auto
frame_origin
=
measurement_frame_coordinates
->worldToImage(
reference_coordinates
->imageToWorld(
ImageCoordinate
(
x
,
y
)));
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
DetectionFrameGroupStamp.h
JacobianTask.h
Jacobian.h
MeasurementFrameCoordinates.h
x
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > x
Definition
MoffatModelFittingTask.cpp:94
y
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > y
Definition
MoffatModelFittingTask.cpp:94
ReferenceCoordinates.h
WorldCentroid.h
SourceXtractor::DetectionFrameGroupStamp
Definition
DetectionFrameGroupStamp.h:33
SourceXtractor::JacobianGroupTask::m_instance
unsigned m_instance
Definition
JacobianTask.h:42
SourceXtractor::JacobianGroupTask::computeProperties
void computeProperties(SourceGroupInterface &source) const override
Computes one or more properties for the SourceGroup and/or the Sources it contains.
Definition
JacobianTask.cpp:37
SourceXtractor::JacobianGroup
Definition
Jacobian.h:56
SourceXtractor::JacobianSourceTask::m_instance
unsigned m_instance
Definition
JacobianTask.h:54
SourceXtractor::JacobianSourceTask::computeProperties
void computeProperties(SourceInterface &source) const override
Computes one or more properties for the Source.
Definition
JacobianTask.cpp:56
SourceXtractor::JacobianSource
Definition
Jacobian.h:51
SourceXtractor::MeasurementFrameCoordinates
Definition
MeasurementFrameCoordinates.h:26
SourceXtractor::ReferenceCoordinates
Definition
ReferenceCoordinates.h:26
SourceXtractor::SourceGroupInterface
Defines the interface used to group sources.
Definition
SourceGroupInterface.h:38
SourceXtractor::SourceInterface
The SourceInterface is an abstract "source" that has properties attached to it.
Definition
SourceInterface.h:46
SourceXtractor::WorldCentroid
Definition
WorldCentroid.h:33
std::function
SourceXtractor
Definition
Aperture.h:30
SourceXtractor::ImageCoordinate
Definition
CoordinateSystem.h:43
Generated by
1.10.0