SourceXtractorPlusPlus 0.21
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
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
16namespace ModelFitting {
17
19
20template <typename ImageType>
21class CompactModelBase : public ExtendedModel<ImageType> {
22
23public:
25 std::shared_ptr<BasicParameter> rotation, double width, double height,
28
29 virtual ~CompactModelBase() = default;
30
31protected:
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 sampleStochastic(const ModelEvaluator& model_eval, int x, int y, unsigned int samples=100) const;
39
40 template<typename ModelEvaluator>
41 float adaptiveSamplePixel(const ModelEvaluator& model_eval, int x, int y, unsigned int max_subsampling, float threshold=1.1) const;
42
44
45 void renormalize(ImageType& image, double flux) const;
46
47 // Jacobian transform
50
51private:
52 double computeSqrDistanceLineToOrigin(double x1, double y1, double x2, double y2) const;
53
57};
58
59}
60
62
63
64#endif /* _MODELFITTING_MODELS_COMPACTMODELBASE_H_ */
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > x
std::shared_ptr< DependentParameter< std::shared_ptr< EngineParameter > > > y
const double pixel_scale
Definition TestImage.cpp:74
std::shared_ptr< BasicParameter > m_rotation
float samplePixel(const ModelEvaluator &model_eval, int x, int y, unsigned int subsampling) const
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)
void renormalize(ImageType &image, double flux) const
std::shared_ptr< BasicParameter > m_y_scale
double getMaxRadiusSqr(std::size_t size_x, std::size_t size_y, const Mat22 &transform) const
std::shared_ptr< BasicParameter > m_x_scale
double computeSqrDistanceLineToOrigin(double x1, double y1, double x2, double y2) const
Mat22 getCombinedTransform(double pixel_scale) const
virtual ~CompactModelBase()=default
float adaptiveSamplePixel(const ModelEvaluator &model_eval, int x, int y, unsigned int max_subsampling, float threshold=1.1) const
float sampleStochastic(const ModelEvaluator &model_eval, int x, int y, unsigned int samples=100) const
T transform(T... args)