SourceXtractorPlusPlus
0.19.2
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 "
SEImplementation/Plugin/PixelBoundaries/PixelBoundaries.h
"
25
#include "
SEImplementation/Plugin/DetectionFrameGroupStamp/DetectionFrameGroupStamp.h
"
26
#include "
SEImplementation/Plugin/DetectionFrameSourceStamp/DetectionFrameSourceStamp.h
"
27
#include "
SEImplementation/Plugin/DetectionFrameCoordinates/DetectionFrameCoordinates.h
"
28
29
#include "
SEImplementation/Plugin/MeasurementFrameCoordinates/MeasurementFrameCoordinates.h
"
30
31
#include "
SEImplementation/Plugin/Jacobian/Jacobian.h
"
32
#include "
SEImplementation/Plugin/Jacobian/JacobianTask.h
"
33
34
namespace
SourceXtractor
{
35
36
void
JacobianGroupTask::computeProperties
(
SourceGroupInterface
&
group
)
const
{
37
auto
measurement_frame_coordinates
=
group
.begin()->getProperty<
MeasurementFrameCoordinates
>(
m_instance
).getCoordinateSystem();
38
auto
&
detection_group_stamp
=
group
.getProperty<
DetectionFrameGroupStamp
>();
39
auto
detection_frame_coordinates
=
group
.begin()->getProperty<
DetectionFrameCoordinates
>().getCoordinateSystem();
40
41
double
x
=
detection_group_stamp
.getTopLeft().m_x +
detection_group_stamp
.getStamp().getWidth() / 2.0;
42
double
y
=
detection_group_stamp
.getTopLeft().m_y +
detection_group_stamp
.getStamp().getHeight() / 2.0;
43
44
auto
frame_origin
=
measurement_frame_coordinates
->worldToImage(
detection_frame_coordinates
->imageToWorld(
ImageCoordinate
(
x
,
y
)));
45
auto
frame_dx
=
measurement_frame_coordinates
->worldToImage(
46
detection_frame_coordinates
->imageToWorld(
ImageCoordinate
(
x
+ 1.0,
y
)));
47
auto
frame_dy
=
measurement_frame_coordinates
->worldToImage(
48
detection_frame_coordinates
->imageToWorld(
ImageCoordinate
(
x
,
y
+ 1.0)));
49
50
group
.setIndexedProperty<
JacobianGroup
>(
m_instance
,
51
frame_dx
.m_x -
frame_origin
.m_x,
frame_dx
.m_y -
frame_origin
.m_y,
52
frame_dy
.m_x -
frame_origin
.m_x,
frame_dy
.m_y -
frame_origin
.m_y);
53
}
54
55
void
JacobianSourceTask::computeProperties
(
SourceInterface
&
source
)
const
{
56
auto
measurement_frame_coordinates
=
source
.getProperty<
MeasurementFrameCoordinates
>(
m_instance
).getCoordinateSystem();
57
auto
&
detection_boundaries
=
source
.getProperty<
PixelBoundaries
>();
58
auto
detection_frame_coordinates
=
source
.getProperty<
DetectionFrameCoordinates
>().getCoordinateSystem();
59
60
double
x
=
detection_boundaries
.getMin().m_x +
detection_boundaries
.getWidth() / 2.0;
61
double
y
=
detection_boundaries
.getMin().m_y +
detection_boundaries
.getHeight() / 2.0;
62
63
auto
frame_origin
=
measurement_frame_coordinates
->worldToImage(
detection_frame_coordinates
->imageToWorld(
ImageCoordinate
(
x
,
y
)));
64
auto
frame_dx
=
measurement_frame_coordinates
->worldToImage(
65
detection_frame_coordinates
->imageToWorld(
ImageCoordinate
(
x
+ 1.0,
y
)));
66
auto
frame_dy
=
measurement_frame_coordinates
->worldToImage(
67
detection_frame_coordinates
->imageToWorld(
ImageCoordinate
(
x
,
y
+ 1.0)));
68
69
source
.setIndexedProperty<
JacobianSource
>(
m_instance
,
70
frame_dx
.m_x -
frame_origin
.m_x,
frame_dx
.m_y -
frame_origin
.m_y,
71
frame_dy
.m_x -
frame_origin
.m_x,
frame_dy
.m_y -
frame_origin
.m_y);
72
}
73
74
}
// end SourceXtractor
DetectionFrameCoordinates.h
DetectionFrameGroupStamp.h
DetectionFrameSourceStamp.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
PixelBoundaries.h
SourceXtractor::DetectionFrameCoordinates
Definition
DetectionFrameCoordinates.h:26
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:36
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:55
SourceXtractor::JacobianSource
Definition
Jacobian.h:51
SourceXtractor::MeasurementFrameCoordinates
Definition
MeasurementFrameCoordinates.h:26
SourceXtractor::PixelBoundaries
The bounding box of all the pixels in the source. Both min and max coordinate are inclusive.
Definition
PixelBoundaries.h:37
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
std::function
SourceXtractor
Definition
Aperture.h:30
SourceXtractor::ImageCoordinate
Definition
CoordinateSystem.h:43
Generated by
1.9.8