SourceXtractorPlusPlus
0.21
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
SEImplementation
src
lib
Plugin
DetectionFrameSourceStamp
DetectionFrameSourceStampTask.cpp
Go to the documentation of this file.
1
23
#include <mutex>
24
25
#include "
SEFramework/Image/Image.h
"
26
#include "
SEFramework/Image/VectorImage.h
"
27
#include "
SEImplementation/Plugin/PixelBoundaries/PixelBoundaries.h
"
28
#include "
SEImplementation/Plugin/DetectionFrameImages/DetectionFrameImages.h
"
29
30
#include "
SEImplementation/Plugin/DetectionFrameSourceStamp/DetectionFrameSourceStamp.h
"
31
#include "
SEImplementation/Plugin/DetectionFrameSourceStamp/DetectionFrameSourceStampTask.h
"
32
33
#include "
SEImplementation/Measurement/MultithreadedMeasurement.h
"
34
35
namespace
SourceXtractor
{
36
37
void
DetectionFrameSourceStampTask::computeProperties
(
SourceInterface
&
source
)
const
{
38
39
auto
detection_frame_images
=
source
.getProperty<
DetectionFrameImages
>();
40
41
const
auto
&
boundaries
=
source
.getProperty<
PixelBoundaries
>();
42
auto
min
=
boundaries
.getMin();
43
auto
max
=
boundaries
.getMax();
44
45
// FIXME temporary, for now just enlarge the area by a fixed amount of pixels
46
PixelCoordinate
border
= (
max
-
min
) * .8 +
PixelCoordinate
(2, 2);
47
48
min
-=
border
;
49
max
+=
border
;
50
51
// clip to image size
52
min
.m_x =
std::max
(
min
.m_x, 0);
53
min
.m_y =
std::max
(
min
.m_y, 0);
54
max
.m_x =
std::min
(
max
.m_x,
detection_frame_images
.getWidth() - 1);
55
max
.m_y =
std::min
(
max
.m_y,
detection_frame_images
.getHeight() - 1);
56
57
auto
width =
max
.m_x -
min
.m_x +1;
58
auto
height =
max
.m_y -
min
.m_y + 1;
59
60
auto
stamp
=
VectorImage<DetectionImage::PixelType>::create
(
61
*
detection_frame_images
.getImageChunk(
LayerSubtractedImage
,
min
.m_x,
min
.m_y, width, height));
62
auto
filtered_stamp
=
VectorImage<DetectionImage::PixelType>::create
(
63
*
detection_frame_images
.getImageChunk(
LayerFilteredImage
,
min
.m_x,
min
.m_y, width, height));
64
auto
thresholded_stamp
=
VectorImage<DetectionImage::PixelType>::create
(
65
*
detection_frame_images
.getImageChunk(
LayerThresholdedImage
,
min
.m_x,
min
.m_y, width, height));
66
auto
variance_stamp
=
VectorImage<WeightImage::PixelType>::create
(
67
*
detection_frame_images
.getImageChunk(
LayerVarianceMap
,
min
.m_x,
min
.m_y, width, height));
68
auto
threshold_map_stamp
=
VectorImage<DetectionImage::PixelType>::create
(
69
*
detection_frame_images
.getImageChunk(
LayerDetectionThresholdMap
,
min
.m_x,
min
.m_y, width, height));
70
71
source
.setProperty<
DetectionFrameSourceStamp
>(
stamp
,
filtered_stamp
,
thresholded_stamp
,
min
,
variance_stamp
,
threshold_map_stamp
);
72
}
73
74
}
// SEImplementation namespace
DetectionFrameImages.h
DetectionFrameSourceStampTask.h
DetectionFrameSourceStamp.h
Image.h
MultithreadedMeasurement.h
PixelBoundaries.h
VectorImage.h
SourceXtractor::DetectionFrameImages
Definition
DetectionFrameImages.h:30
SourceXtractor::DetectionFrameSourceStampTask::computeProperties
void computeProperties(SourceInterface &source) const override
Computes one or more properties for the Source.
Definition
DetectionFrameSourceStampTask.cpp:37
SourceXtractor::DetectionFrameSourceStamp
A copy of the rectangular region of the detection image just large enough to include the whole Source...
Definition
DetectionFrameSourceStamp.h:36
SourceXtractor::PixelBoundaries
The bounding box of all the pixels in the source. Both min and max coordinate are inclusive.
Definition
PixelBoundaries.h:37
SourceXtractor::SourceInterface
The SourceInterface is an abstract "source" that has properties attached to it.
Definition
SourceInterface.h:46
SourceXtractor::VectorImage::create
static std::shared_ptr< VectorImage< T > > create(Args &&... args)
Definition
VectorImage.h:100
std::function
std::max
T max(T... args)
std::min
T min(T... args)
SourceXtractor
Definition
Aperture.h:30
SourceXtractor::LayerVarianceMap
@ LayerVarianceMap
Definition
Frame.h:45
SourceXtractor::LayerFilteredImage
@ LayerFilteredImage
Definition
Frame.h:40
SourceXtractor::LayerDetectionThresholdMap
@ LayerDetectionThresholdMap
Definition
Frame.h:46
SourceXtractor::LayerThresholdedImage
@ LayerThresholdedImage
Definition
Frame.h:41
SourceXtractor::LayerSubtractedImage
@ LayerSubtractedImage
Definition
Frame.h:39
SourceXtractor::PixelCoordinate
A pixel coordinate made of two integers m_x and m_y.
Definition
PixelCoordinate.h:37
Generated by
1.10.0