SourceXtractorPlusPlus  0.11
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 
37  SeFloat scaling_factor, SeFloat median_rms) :
38  m_background_level(background_level),
39  m_scaling_factor(scaling_factor),
40  m_median_rms(median_rms) {
41  // make sure the variance is a positive value
43  background_variance->getWidth(), background_variance->getHeight(),
44  [background_variance](int x, int y) -> SeFloat {
45  // just set everything below zero to 0.0
46  //return background_variance->getValue(x,y) < 0.0 ? 0.0 : background_variance->getValue(x,y);
47  // the long version for "fabs()"
48  //return background_variance->getValue(x,y) < 0.0 ? -1.0*background_variance->getValue(x,y) : background_variance->getValue(x,y);
49  // the short version for "fabs()"
50  return fabs(background_variance->getValue(x,y));
51  }
52  );
53  }
54 
56  return m_background_level;
57  }
58 
60  return m_background_variance;
61  }
62 
64  return m_scaling_factor;
65  }
66 
68  return m_median_rms;
69  }
70 
71 private:
75 };
76 
78 public:
79 
80  virtual ~BackgroundAnalyzer() = default;
81 
84  std::shared_ptr<Image<unsigned char>> mask, WeightImage::PixelType variance_threshold) const = 0;
85 };
86 
87 }
88 
89 
90 #endif /* SEFRAMEWORK_SEFRAMEWORK_BACKGROUND_BACKGROUNDANALYZER_H_ */
virtual ~BackgroundAnalyzer()=default
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
BackgroundModel(std::shared_ptr< Image< SeFloat >> background_level, std::shared_ptr< Image< SeFloat >> background_variance, SeFloat scaling_factor, SeFloat median_rms)
SeFloat32 SeFloat
Definition: Types.h:32
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > y
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
Interface representing an image.
Definition: Image.h:43
std::shared_ptr< Image< SeFloat > > getVarianceMap() const
std::shared_ptr< Image< SeFloat > > m_background_level