SourceXtractorPlusPlus
0.15
Please provide a description of the project.
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
SEImplementation
src
lib
Plugin
CoreThresholdPartition
CoreThresholdPartitionStep.cpp
Go to the documentation of this file.
1
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::shared_ptr<SourceInterface>
>
CoreThresholdPartitionStep::partition
(
std::shared_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
if
(n_snr_level <
m_min_pixel_count
) {
48
return
{};
49
}
else
{
50
return
{ source };
51
}
52
}
53
54
}
// SEImplementation namespace
55
PixelCoordinateList.h
std::shared_ptr
SourceXtractor::DetectionFrameImages
Definition:
DetectionFrameImages.h:30
SourceXtractor::CoreThresholdPartitionStep::m_snr_level
double m_snr_level
Definition:
CoreThresholdPartitionStep.h:49
SourceXtractor::PixelCoordinateList
Definition:
PixelCoordinateList.h:31
SourceXtractor::CoreThresholdPartitionStep::partition
virtual std::vector< std::shared_ptr< SourceInterface > > partition(std::shared_ptr< SourceInterface > source) const override
Definition:
CoreThresholdPartitionStep.cpp:34
SourceXtractor::CoreThresholdPartitionStep::CoreThresholdPartitionStep
CoreThresholdPartitionStep(double snr_level, unsigned int min_pixel_count)
Constructor.
Definition:
CoreThresholdPartitionStep.cpp:30
SourceXtractor::LayerSignalToNoiseMap
Definition:
Frame.h:41
CoreThresholdPartitionStep.h
std::vector
STL class.
SourceXtractor::PixelCoordinateList::getCoordinateList
const std::vector< PixelCoordinate > & getCoordinateList() const
Definition:
PixelCoordinateList.h:41
DetectionFrameImages.h
SourceXtractor::CoreThresholdPartitionStep::m_min_pixel_count
unsigned int m_min_pixel_count
Definition:
CoreThresholdPartitionStep.h:50
Generated by
1.8.5