SourceXtractorPlusPlus  0.10
Please provide a description of the project.
BackgroundAnalyzer.h
Go to the documentation of this file.
1 
17 /*
18  * BackgroundAnalyzer.h
19  *
20  * Created on: Mar 28, 2017
21  * Author: mschefer
22  */
23 
24 #ifndef _SEFRAMEWORK_BACKGROUND_BACKGROUNDANALYZER_H_
25 #define _SEFRAMEWORK_BACKGROUND_BACKGROUNDANALYZER_H_
26 
29 
30 namespace SourceXtractor {
31 
32 
34 public:
35 
36  BackgroundModel(std::shared_ptr<Image<SeFloat>> background_level, std::shared_ptr<Image<SeFloat>> background_variance, SeFloat scaling_factor) :
37  m_background_level(background_level),
38  m_scaling_factor(scaling_factor) {
39  // make sure the variance is a positive value
41  background_variance->getWidth(), background_variance->getHeight(),
42  [background_variance](int x, int y) -> SeFloat {
43  // just set everything below zero to 0.0
44  //return background_variance->getValue(x,y) < 0.0 ? 0.0 : background_variance->getValue(x,y);
45  // the long version for "fabs()"
46  //return background_variance->getValue(x,y) < 0.0 ? -1.0*background_variance->getValue(x,y) : background_variance->getValue(x,y);
47  // the short version for "fabs()"
48  return fabs(background_variance->getValue(x,y));
49  }
50  );
51  }
52 
54  return m_background_level;
55  }
56 
58  return m_background_variance;
59  }
60 
62  return m_scaling_factor;
63  }
64 
65 private:
69 };
70 
72 public:
73 
74  virtual ~BackgroundAnalyzer() = default;
75 
78  std::shared_ptr<Image<unsigned char>> mask, WeightImage::PixelType variance_threshold) const = 0;
79 };
80 
81 }
82 
83 
84 #endif /* SEFRAMEWORK_SEFRAMEWORK_BACKGROUND_BACKGROUNDANALYZER_H_ */
virtual ~BackgroundAnalyzer()=default
STL class.
static std::shared_ptr< ImageBase< T > > create(Args &&... args)
std::shared_ptr< Image< SeFloat > > getLevelMap() const
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > x
SeFloat32 SeFloat
Definition: Types.h:32
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > y
BackgroundModel(std::shared_ptr< Image< SeFloat >> background_level, std::shared_ptr< Image< SeFloat >> background_variance, SeFloat scaling_factor)
T fabs(T... args)
std::shared_ptr< Image< SeFloat > > m_background_variance
virtual BackgroundModel analyzeBackground(std::shared_ptr< DetectionImage > image, std::shared_ptr< WeightImage > variance_map, std::shared_ptr< Image< unsigned char >> mask, WeightImage::PixelType variance_threshold) const =0
std::shared_ptr< Image< SeFloat > > getVarianceMap() const
std::shared_ptr< Image< SeFloat > > m_background_level