SourceXtractorPlusPlus  0.14
Please provide a description of the project.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CoreThresholdPartitionStep.cpp
Go to the documentation of this file.
1 
25 
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 
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 
virtual std::vector< std::shared_ptr< SourceInterface > > partition(std::shared_ptr< SourceInterface > source) const override
CoreThresholdPartitionStep(double snr_level, unsigned int min_pixel_count)
Constructor.
STL class.
const std::vector< PixelCoordinate > & getCoordinateList() const