SourceXtractorPlusPlus  0.11
Please provide a description of the project.
CompactModelBase.h
Go to the documentation of this file.
1 /*
2  * CompactModelBase.h
3  *
4  * Created on: Aug 19, 2019
5  * Author: mschefer
6  */
7 
8 #ifndef _MODELFITTING_MODELS_COMPACTMODELBASE_H_
9 #define _MODELFITTING_MODELS_COMPACTMODELBASE_H_
10 
13 
14 #include "SEUtils/Mat22.h"
15 
16 namespace ModelFitting {
17 
18 using SExtractor::Mat22;
19 
20 template <typename ImageType>
21 class CompactModelBase : public ExtendedModel<ImageType> {
22 
23 public:
25  std::shared_ptr<BasicParameter> rotation, double width, double height,
28 
29  virtual ~CompactModelBase() = default;
30 
31 protected:
33 
34  template<typename ModelEvaluator>
35  float samplePixel(const ModelEvaluator& model_eval, int x, int y, unsigned int subsampling) const;
36 
37  template<typename ModelEvaluator>
38  float adaptiveSamplePixel(const ModelEvaluator& model_eval, int x, int y, unsigned int max_subsampling, float threshold=1.1) const;
39 
40  double getMaxRadiusSqr(std::size_t size_x, std::size_t size_y, const Mat22& transform) const;
41 
42  // Jacobian transform
45 
46 private:
50 };
51 
52 }
53 
55 
56 
57 #endif /* _MODELFITTING_MODELS_COMPACTMODELBASE_H_ */
double getMaxRadiusSqr(std::size_t size_x, std::size_t size_y, const Mat22 &transform) const
float samplePixel(const ModelEvaluator &model_eval, int x, int y, unsigned int subsampling) const
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > x
std::shared_ptr< BasicParameter > m_x_scale
std::shared_ptr< BasicParameter > m_rotation
Mat22 getCombinedTransform(double pixel_scale) const
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > y
std::shared_ptr< BasicParameter > m_y_scale
float adaptiveSamplePixel(const ModelEvaluator &model_eval, int x, int y, unsigned int max_subsampling, float threshold=1.1) const
virtual ~CompactModelBase()=default
const double pixel_scale
Definition: TestImage.cpp:75
std::pair< double, double > transform(int x, int y, const std::array< double, 4 > &t)
CompactModelBase(std::shared_ptr< BasicParameter > x_scale, std::shared_ptr< BasicParameter > y_scale, std::shared_ptr< BasicParameter > rotation, double width, double height, std::shared_ptr< BasicParameter > x, std::shared_ptr< BasicParameter > y, std::tuple< double, double, double, double > transform)