exposure_compensation.rst 3.87 KB

Exposure Compensation

detail::ExposureCompensator

Base class for all exposure compensators.

class CV_EXPORTS ExposureCompensator
{
public:
    virtual ~ExposureCompensator() {}

    enum { NO, GAIN, GAIN_BLOCKS };
    static Ptr<ExposureCompensator> createDefault(int type);

    void feed(const std::vector<Point> &corners, const std::vector<Mat> &images,
              const std::vector<Mat> &masks);
    virtual void feed(const std::vector<Point> &corners, const std::vector<Mat> &images,
                      const std::vector<std::pair<Mat,uchar> > &masks) = 0;
    virtual void apply(int index, Point corner, Mat &image, const Mat &mask) = 0;
};

detail::ExposureCompensator::feed

detil::ExposureCompensator::apply

Compensate exposure in the specified image.

detail::NoExposureCompensator

Stub exposure compensator which does nothing.

class CV_EXPORTS NoExposureCompensator : public ExposureCompensator
{
public:
    void feed(const std::vector<Point> &/*corners*/, const std::vector<Mat> &/*images*/,
              const std::vector<std::pair<Mat,uchar> > &/*masks*/) {};
    void apply(int /*index*/, Point /*corner*/, Mat &/*image*/, const Mat &/*mask*/) {};
};

detail::GainCompensator

Exposure compensator which tries to remove exposure related artifacts by adjusting image intensities, see [BL07]_ and [WJ10]_ for details.

class CV_EXPORTS GainCompensator : public ExposureCompensator
{
public:
    void feed(const std::vector<Point> &corners, const std::vector<Mat> &images,
              const std::vector<std::pair<Mat,uchar> > &masks);
    void apply(int index, Point corner, Mat &image, const Mat &mask);
    std::vector<double> gains() const;

private:
    /* hidden */
};

detail::BlocksGainCompensator

Exposure compensator which tries to remove exposure related artifacts by adjusting image block intensities, see [UES01]_ for details.

class CV_EXPORTS BlocksGainCompensator : public ExposureCompensator
{
public:
    BlocksGainCompensator(int bl_width = 32, int bl_height = 32)
            : bl_width_(bl_width), bl_height_(bl_height) {}
    void feed(const std::vector<Point> &corners, const std::vector<Mat> &images,
              const std::vector<std::pair<Mat,uchar> > &masks);
    void apply(int index, Point corner, Mat &image, const Mat &mask);

private:
    /* hidden */
};