Go to the documentation of this file.00001
00002 #ifndef brip_gain_offset_solver_h_
00003 #define brip_gain_offset_solver_h_
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include <vil/vil_image_view.h>
00025
00026 class brip_gain_offset_solver
00027 {
00028 public:
00029
00030 brip_gain_offset_solver() : ni_(0), nj_(0), gain_(1.0f), offset_(0.0f),
00031 t_mask_(false), m_mask_(false), n_valid_pix_(0) {}
00032
00033
00034 brip_gain_offset_solver(vil_image_view<float> const& model_image,
00035 vil_image_view<float> const& test_image);
00036
00037
00038 brip_gain_offset_solver(vil_image_view<float> const& model_image,
00039 vil_image_view<float> const& test_image,
00040 vil_image_view<unsigned char> const& model_mask,
00041 vil_image_view<unsigned char> const& test_mask);
00042
00043 ~brip_gain_offset_solver() {}
00044
00045
00046 void set_model_image(vil_image_view<float> const& image) {model_image_ = image;}
00047 void set_test_image (vil_image_view<float> const& image) {test_image_ = image;}
00048
00049 void set_model_mask(vil_image_view<unsigned char> const& mask) {model_mask_ = mask;}
00050 void set_test_mask (vil_image_view<unsigned char> const& mask) {test_mask_ = mask;}
00051
00052
00053 unsigned ni() const {return ni_;}
00054 unsigned nj() const {return nj_;}
00055 float gain() const {return gain_;}
00056 float offset()const {return offset_;}
00057
00058 bool solve();
00059
00060 vil_image_view<float> mapped_test_image();
00061 protected:
00062
00063 void compute_valid_pix();
00064
00065 unsigned ni_, nj_;
00066 vil_image_view<float> model_image_;
00067 vil_image_view<float> test_image_;
00068 float gain_;
00069 float offset_;
00070 vil_image_view<unsigned char> model_mask_;
00071 vil_image_view<unsigned char> test_mask_;
00072 bool t_mask_;
00073 bool m_mask_;
00074 unsigned n_valid_pix_;
00075 };
00076
00077 #endif // brip_gain_offset_solver_h_