SourceXtractorPlusPlus
1.0.3
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
SEImplementation
src
lib
Plugin
CoreThresholdPartition
CoreThresholdPartitionStep.cpp
Go to the documentation of this file.
1
22
23
#include "
SEImplementation/Property/PixelCoordinateList.h
"
24
#include "
SEImplementation/Plugin/DetectionFrameImages/DetectionFrameImages.h
"
25
26
#include "
SEImplementation/Plugin/CoreThresholdPartition/CoreThresholdPartitionStep.h
"
27
28
namespace
SourceXtractor
{
29
30
CoreThresholdPartitionStep::CoreThresholdPartitionStep
(
double
snr_level,
unsigned
int
min_pixel_count) :
31
m_snr_level
(snr_level),
m_min_pixel_count
(min_pixel_count) {
32
}
33
34
std::vector<std::unique_ptr<SourceInterface>
>
CoreThresholdPartitionStep::partition
(
std::unique_ptr<SourceInterface>
source)
const
{
35
long
int
n_snr_level(0);
36
37
// get the SNR image
38
const
auto
snr_image = source->getProperty<
DetectionFrameImages
>().getLockedImage(
LayerSignalToNoiseMap
);
39
40
// go over all pixels
41
for
(
auto
pixel_coord : source->getProperty<
PixelCoordinateList
>().
getCoordinateList
())
42
// enhance the counter if the SNR is above the level
43
if
(snr_image->getValue(pixel_coord.m_x, pixel_coord.m_y) >=
m_snr_level
)
44
n_snr_level += 1;
45
46
// check whether the pixel # is above the threshold
47
std::vector<std::unique_ptr<SourceInterface>
> sources;
48
if
(n_snr_level >=
m_min_pixel_count
) {
49
sources.
emplace_back
(
std::move
(source));
50
}
51
return
sources;
52
}
53
54
}
// SEImplementation namespace
55
CoreThresholdPartitionStep.h
DetectionFrameImages.h
PixelCoordinateList.h
SourceXtractor::CoreThresholdPartitionStep::m_snr_level
double m_snr_level
Definition
CoreThresholdPartitionStep.h:49
SourceXtractor::CoreThresholdPartitionStep::partition
std::vector< std::unique_ptr< SourceInterface > > partition(std::unique_ptr< SourceInterface > source) const override
Definition
CoreThresholdPartitionStep.cpp:34
SourceXtractor::CoreThresholdPartitionStep::m_min_pixel_count
unsigned int m_min_pixel_count
Definition
CoreThresholdPartitionStep.h:50
SourceXtractor::CoreThresholdPartitionStep::CoreThresholdPartitionStep
CoreThresholdPartitionStep(double snr_level, unsigned int min_pixel_count)
Constructor.
Definition
CoreThresholdPartitionStep.cpp:30
SourceXtractor::DetectionFrameImages
Definition
DetectionFrameImages.h:30
SourceXtractor::PixelCoordinateList
Definition
PixelCoordinateList.h:33
SourceXtractor::PixelCoordinateList::getCoordinateList
const std::vector< PixelCoordinate > & getCoordinateList() const
Definition
PixelCoordinateList.h:43
std::vector::emplace_back
T emplace_back(T... args)
std::move
T move(T... args)
SourceXtractor
Definition
Aperture.h:30
SourceXtractor::LayerSignalToNoiseMap
@ LayerSignalToNoiseMap
Definition
Frame.h:42
std::unique_ptr
std::vector
Generated by
1.14.0