SourceXtractorPlusPlus  0.11
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 
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  // SNR Image accesses the underlying detection image, which may be a buffered image
38 
39  // get the SNR image
40  const auto& snr_image = source->getProperty<DetectionFrame>().getFrame()->getSnrImage();
41 
42  // go over all pixels
43  for (auto pixel_coord : source->getProperty<PixelCoordinateList>().getCoordinateList())
44  // enhance the counter if the SNR is above the level
45  if (snr_image->getValue(pixel_coord.m_x, pixel_coord.m_y) >= m_snr_level)
46  n_snr_level += 1;
47 
48  // check whether the pixel # is above the threshold
49  if (n_snr_level < m_min_pixel_count) {
50  return {};
51  } else {
52  return { source };
53  }
54 }
55 
56 } // SEImplementation namespace
57 
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.
T lock(T...args)
STL class.
const std::vector< PixelCoordinate > & getCoordinateList() const