SourceXtractorPlusPlus 1.0.3
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
DetectionFrameSourceStampTask.cpp
Go to the documentation of this file.
1
22
23#include <mutex>
24
29
32
34
35namespace SourceXtractor {
36
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
61 *detection_frame_images.getImageChunk(LayerSubtractedImage, min.m_x, min.m_y, width, height));
63 *detection_frame_images.getImageChunk(LayerFilteredImage, min.m_x, min.m_y, width, height));
65 *detection_frame_images.getImageChunk(LayerThresholdedImage, min.m_x, min.m_y, width, height));
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
void computeProperties(SourceInterface &source) const override
Computes one or more properties for the Source.
A copy of the rectangular region of the detection image just large enough to include the whole Source...
The bounding box of all the pixels in the source. Both min and max coordinate are inclusive.
The SourceInterface is an abstract "source" that has properties attached to it.
const PropertyType & getProperty(unsigned int index=0) const
Convenience template method to call getProperty() with a more user-friendly syntax.
static std::shared_ptr< VectorImage< T > > create(Args &&... args)
T max(T... args)
T min(T... args)
@ LayerVarianceMap
Definition Frame.h:45
@ LayerFilteredImage
Definition Frame.h:40
@ LayerDetectionThresholdMap
Definition Frame.h:46
@ LayerThresholdedImage
Definition Frame.h:41
@ LayerSubtractedImage
Definition Frame.h:39
A pixel coordinate made of two integers m_x and m_y.