OpenCV453
white_balance.hpp
[詳解]
1/*M///////////////////////////////////////////////////////////////////////////////////////
2//
3// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
4//
5// By downloading, copying, installing or using the software you agree to this license.
6// If you do not agree to this license, do not download, install,
7// copy or use the software.
8//
9//
10// License Agreement
11// For Open Source Computer Vision Library
12//
13// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
14// Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved.
15// Third party copyrights are property of their respective owners.
16//
17// Redistribution and use in source and binary forms, with or without modification,
18// are permitted provided that the following conditions are met:
19//
20// * Redistribution's of source code must retain the above copyright notice,
21// this list of conditions and the following disclaimer.
22//
23// * Redistribution's in binary form must reproduce the above copyright notice,
24// this list of conditions and the following disclaimer in the documentation
25// and/or other materials provided with the distribution.
26//
27// * The name of the copyright holders may not be used to endorse or promote products
28// derived from this software without specific prior written permission.
29//
30// This software is provided by the copyright holders and contributors "as is" and
31// any express or implied warranties, including, but not limited to, the implied
32// warranties of merchantability and fitness for a particular purpose are disclaimed.
33// In no event shall the Intel Corporation or contributors be liable for any direct,
34// indirect, incidental, special, exemplary, or consequential damages
35// (including, but not limited to, procurement of substitute goods or services;
36// loss of use, data, or profits; or business interruption) however caused
37// and on any theory of liability, whether in contract, strict liability,
38// or tort (including negligence or otherwise) arising in any way out of
39// the use of this software, even if advised of the possibility of such damage.
40//
41//M*/
42
43#ifndef __OPENCV_SIMPLE_COLOR_BALANCE_HPP__
44#define __OPENCV_SIMPLE_COLOR_BALANCE_HPP__
45
51#include <opencv2/core.hpp>
52
53namespace cv
54{
55namespace xphoto
56{
57
60
63class CV_EXPORTS_W WhiteBalancer : public Algorithm
64{
65 public:
72 CV_WRAP virtual void balanceWhite(InputArray src, OutputArray dst) = 0;
73};
74
79class CV_EXPORTS_W SimpleWB : public WhiteBalancer
80{
81 public:
84 CV_WRAP virtual float getInputMin() const = 0;
86 CV_WRAP virtual void setInputMin(float val) = 0;
87
90 CV_WRAP virtual float getInputMax() const = 0;
92 CV_WRAP virtual void setInputMax(float val) = 0;
93
96 CV_WRAP virtual float getOutputMin() const = 0;
98 CV_WRAP virtual void setOutputMin(float val) = 0;
99
102 CV_WRAP virtual float getOutputMax() const = 0;
104 CV_WRAP virtual void setOutputMax(float val) = 0;
105
108 CV_WRAP virtual float getP() const = 0;
110 CV_WRAP virtual void setP(float val) = 0;
111};
112
116
139class CV_EXPORTS_W GrayworldWB : public WhiteBalancer
140{
141 public:
145 CV_WRAP virtual float getSaturationThreshold() const = 0;
147 CV_WRAP virtual void setSaturationThreshold(float val) = 0;
148};
149
153
168class CV_EXPORTS_W LearningBasedWB : public WhiteBalancer
169{
170 public:
185 CV_WRAP virtual void extractSimpleFeatures(InputArray src, OutputArray dst) = 0;
186
190 CV_WRAP virtual int getRangeMaxVal() const = 0;
192 CV_WRAP virtual void setRangeMaxVal(int val) = 0;
193
197 CV_WRAP virtual float getSaturationThreshold() const = 0;
199 CV_WRAP virtual void setSaturationThreshold(float val) = 0;
200
205 CV_WRAP virtual int getHistBinNum() const = 0;
207 CV_WRAP virtual void setHistBinNum(int val) = 0;
208};
209
214CV_EXPORTS_W Ptr<LearningBasedWB> createLearningBasedWB(const String& path_to_model = String());
215
225CV_EXPORTS_W void applyChannelGains(InputArray src, OutputArray dst, float gainB, float gainG, float gainR);
227}
228}
229
230#endif // __OPENCV_SIMPLE_COLOR_BALANCE_HPP__
This type is very similar to InputArray except that it is used for input/output and output function p...
Definition: mat.hpp:295
This is a base class for all more or less complex algorithms in OpenCV
Definition: core.hpp:3091
Gray-world white balance algorithm
Definition: white_balance.hpp:140
More sophisticated learning-based automatic white balance algorithm.
Definition: white_balance.hpp:169
A simple white balance algorithm that works by independently stretching each of the input image chann...
Definition: white_balance.hpp:80
The base class for auto white balance algorithms.
Definition: white_balance.hpp:64
CV_EXPORTS_W void applyChannelGains(InputArray src, OutputArray dst, float gainB, float gainG, float gainR)
Implements an efficient fixed-point approximation for applying channel gains, which is the last step ...
CV_EXPORTS_W Ptr< GrayworldWB > createGrayworldWB()
Creates an instance of GrayworldWB
CV_EXPORTS_W Ptr< SimpleWB > createSimpleWB()
Creates an instance of SimpleWB
CV_EXPORTS_W Ptr< LearningBasedWB > createLearningBasedWB(const String &path_to_model=String())
Creates an instance of LearningBasedWB
"black box" representation of the file storage associated with a file on disk.
Definition: aruco.hpp:75
Definition: cvstd_wrapper.hpp:74