SourceXtractorPlusPlus
0.8
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/Plugin/CoreThresholdPartition/CoreThresholdPartitionStep.h
"
24
25
#include "
SEFramework/Property/DetectionFrame.h
"
26
#include "
SEImplementation/Property/PixelCoordinateList.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<
DetectionFrame
>().getFrame()->getSnrImage();
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::CoreThresholdPartitionStep::m_snr_level
double m_snr_level
Definition:
CoreThresholdPartitionStep.h:49
SourceXtractor::PixelCoordinateList
Definition:
PixelCoordinateList.h:30
SourceXtractor::CoreThresholdPartitionStep::partition
virtual std::vector< std::shared_ptr< SourceInterface > > partition(std::shared_ptr< SourceInterface > source) const override
Definition:
CoreThresholdPartitionStep.cpp:34
SourceXtractor::DetectionFrame
Definition:
DetectionFrame.h:33
SourceXtractor::CoreThresholdPartitionStep::CoreThresholdPartitionStep
CoreThresholdPartitionStep(double snr_level, unsigned int min_pixel_count)
Constructor.
Definition:
CoreThresholdPartitionStep.cpp:30
DetectionFrame.h
CoreThresholdPartitionStep.h
std::vector
STL class.
SourceXtractor::PixelCoordinateList::getCoordinateList
const std::vector< PixelCoordinate > & getCoordinateList() const
Definition:
PixelCoordinateList.h:40
SourceXtractor::CoreThresholdPartitionStep::m_min_pixel_count
unsigned int m_min_pixel_count
Definition:
CoreThresholdPartitionStep.h:50
Generated by
1.8.5