SourceXtractorPlusPlus
0.13
Please provide a description of the project.
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
std::shared_ptr<DetectionImage>
stamp =
VectorImage<DetectionImage::PixelType>::create
(
61
*detection_frame_images.getImageChunk(
LayerSubtractedImage
,
min
.m_x,
min
.m_y, width, height));
62
std::shared_ptr<DetectionImage>
filtered_stamp =
VectorImage<DetectionImage::PixelType>::create
(
63
*detection_frame_images.getImageChunk(
LayerFilteredImage
,
min
.m_x,
min
.m_y, width, height));
64
std::shared_ptr<DetectionImage>
thresholded_stamp =
VectorImage<DetectionImage::PixelType>::create
(
65
*detection_frame_images.getImageChunk(
LayerThresholdedImage
,
min
.m_x,
min
.m_y, width, height));
66
std::shared_ptr<WeightImage>
variance_stamp =
VectorImage<WeightImage::PixelType>::create
(
67
*detection_frame_images.getImageChunk(
LayerVarianceMap
,
min
.m_x,
min
.m_y, width, height));
68
std::shared_ptr<DetectionImage>
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
SourceXtractor::PixelBoundaries
The bounding box of all the pixels in the source. Both min and max coordinate are inclusive.
Definition:
PixelBoundaries.h:37
SourceXtractor::PixelCoordinate
A pixel coordinate made of two integers m_x and m_y.
Definition:
PixelCoordinate.h:37
SourceXtractor::DetectionFrameImages
Definition:
DetectionFrameImages.h:32
PixelBoundaries.h
std::shared_ptr
STL class.
SourceXtractor::LayerVarianceMap
@ LayerVarianceMap
Definition:
Frame.h:44
SourceXtractor::LayerFilteredImage
@ LayerFilteredImage
Definition:
Frame.h:39
VectorImage.h
SourceXtractor
Definition:
Aperture.h:30
SourceXtractor::LayerDetectionThresholdMap
@ LayerDetectionThresholdMap
Definition:
Frame.h:45
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::VectorImage::create
static std::shared_ptr< VectorImage< T > > create(Args &&... args)
Definition:
VectorImage.h:89
Image.h
std::min
T min(T... args)
DetectionFrameSourceStamp.h
MultithreadedMeasurement.h
DetectionFrameSourceStampTask.h
SourceXtractor::SourceInterface::getProperty
const PropertyType & getProperty(unsigned int index=0) const
Convenience template method to call getProperty() with a more user-friendly syntax.
Definition:
SourceInterface.h:57
SourceXtractor::LayerSubtractedImage
@ LayerSubtractedImage
Definition:
Frame.h:38
SourceXtractor::SourceInterface
The SourceInterface is an abstract "source" that has properties attached to it.
Definition:
SourceInterface.h:46
std::max
T max(T... args)
SourceXtractor::DetectionFrameSourceStampTask::computeProperties
virtual void computeProperties(SourceInterface &source) const override
Computes one or more properties for the Source.
Definition:
DetectionFrameSourceStampTask.cpp:37
SourceXtractor::SourceInterface::setProperty
void setProperty(Args... args)
Definition:
SourceInterface.h:72
DetectionFrameImages.h
SourceXtractor::LayerThresholdedImage
@ LayerThresholdedImage
Definition:
Frame.h:40
Generated by
1.8.20