Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 #ifndef __OPENCV_STITCHING_EXPOSURE_COMPENSATE_HPP__
00044 #define __OPENCV_STITCHING_EXPOSURE_COMPENSATE_HPP__
00045
00046 #include "opencv2/core/core.hpp"
00047
00048 namespace cv {
00049 namespace detail {
00050
00051 class CV_EXPORTS ExposureCompensator
00052 {
00053 public:
00054 virtual ~ExposureCompensator() {}
00055
00056 enum { NO, GAIN, GAIN_BLOCKS };
00057 static Ptr<ExposureCompensator> createDefault(int type);
00058
00059 void feed(const std::vector<Point> &corners, const std::vector<Mat> &images,
00060 const std::vector<Mat> &masks);
00061 virtual void feed(const std::vector<Point> &corners, const std::vector<Mat> &images,
00062 const std::vector<std::pair<Mat,uchar> > &masks) = 0;
00063 virtual void apply(int index, Point corner, Mat &image, const Mat &mask) = 0;
00064 };
00065
00066
00067 class CV_EXPORTS NoExposureCompensator : public ExposureCompensator
00068 {
00069 public:
00070 void feed(const std::vector<Point> &, const std::vector<Mat> &,
00071 const std::vector<std::pair<Mat,uchar> > &) {};
00072 void apply(int , Point , Mat &, const Mat &) {};
00073 };
00074
00075
00076 class CV_EXPORTS GainCompensator : public ExposureCompensator
00077 {
00078 public:
00079 void feed(const std::vector<Point> &corners, const std::vector<Mat> &images,
00080 const std::vector<std::pair<Mat,uchar> > &masks);
00081 void apply(int index, Point corner, Mat &image, const Mat &mask);
00082 std::vector<double> gains() const;
00083
00084 private:
00085 Mat_<double> gains_;
00086 };
00087
00088
00089 class CV_EXPORTS BlocksGainCompensator : public ExposureCompensator
00090 {
00091 public:
00092 BlocksGainCompensator(int bl_width = 32, int bl_height = 32)
00093 : bl_width_(bl_width), bl_height_(bl_height) {}
00094 void feed(const std::vector<Point> &corners, const std::vector<Mat> &images,
00095 const std::vector<std::pair<Mat,uchar> > &masks);
00096 void apply(int index, Point corner, Mat &image, const Mat &mask);
00097
00098 private:
00099 int bl_width_, bl_height_;
00100 std::vector<Mat_<float> > gain_maps_;
00101 };
00102
00103 }
00104 }
00105
00106 #endif // __OPENCV_STITCHING_EXPOSURE_COMPENSATE_HPP__