Exposure Compensation — OpenCV 2.4.13.4 documentation

### Navigation

- index
- next |
- previous |
- OpenCV 2.4.13.4 documentation »
- OpenCV API Reference »
- stitching. Images stitching »

# Exposure Compensation

## detail::ExposureCompensator

class `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

C++:`` void `detail::ExposureCompensator::``feed`(const std::vector<Point>& corners, const std::vector<Mat>& images, const std::vector<Mat>& masks)

C++:`` void `detail::ExposureCompensator::``feed`(const std::vector<Point>& corners, const std::vector<Mat>& images, const std::vector<std::pair<Mat, uchar>>& masks)

  Parameters: | corners – Source image top-left corners images – Source images masks – Image masks to update (second value in pair specifies the value which should be used to detect where image is)

## detil::ExposureCompensator::apply

Compensate exposure in the specified image.

C++:`` void `detail::ExposureCompensator::``apply`(int index, Point corner, Mat& image, const Mat& mask)

  Parameters: | index – Image index corner – Image top-left corner image – Image to process mask – Image mask

## detail::NoExposureCompensator

class `detail::``NoExposureCompensator` : public `detail::``ExposureCompensator`

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*/) {};
    };

See also

`detail::ExposureCompensator`

## detail::GainCompensator

class `detail::``GainCompensator` : public `detail::``ExposureCompensator`

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 */
    };

See also

`detail::ExposureCompensator`

## detail::BlocksGainCompensator

class `detail::``BlocksGainCompensator` : public `detail::``ExposureCompensator`

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 */
    };

See also

`detail::ExposureCompensator`

## Help and Feedback

You did not find what you were looking for?

- Ask a question on the Q&A forum.
- If you think something is missing or wrong in the documentation, please file a bug report.

### Navigation

- index
- next |
- previous |
- OpenCV 2.4.13.4 documentation »
- OpenCV API Reference »
- stitching. Images stitching »