Class cv::xphoto::LearningBasedWB#
More sophisticated learning-based automatic white balance algorithm. View details
#include <opencv2/xphoto/white_balance.hpp>Collaboration diagram for cv::xphoto::LearningBasedWB:
Public Member Functions#
Public Member Functions inherited from cv::xphoto::WhiteBalancer
Return |
Name |
Description |
|---|---|---|
|
Applies white balancing to the input image. |
Public Member Functions inherited from cv::Algorithm
Return |
Name |
Description |
|---|---|---|
|
Clears the algorithm state. |
|
|
Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read. |
|
|
Reads algorithm parameters from a file storage. |
|
|
||
|
|
|
|
Stores algorithm parameters in a file storage. |
|
|
Static Public Member Functions#
Static Public Member Functions inherited from cv::Algorithm
Return |
Name |
Description |
|---|---|---|
|
|
Loads algorithm from the file. |
|
|
Loads algorithm from a String. |
|
Reads algorithm from the file node. |
Additional Inherited Members#
Protected Member Functions inherited from cv::Algorithm
Return |
Name |
Description |
|---|---|---|
|
Detailed Description#
More sophisticated learning-based automatic white balance algorithm.
As GrayworldWB, this algorithm works by applying different gains to the input image channels, but their computation is a bit more involved compared to the simple gray-world assumption. More details about the algorithm can be found in Cheng2015 .
To mask out saturated pixels this function uses only pixels that satisfy the following condition:
Member Function Documentation#
extractSimpleFeatures()#
void cv::xphoto::LearningBasedWB::extractSimpleFeatures(
InputArray src,
OutputArray dst )
Python:
cv.xphoto.LearningBasedWB.extractSimpleFeatures(src[, dst]) -> dst
Implements the feature extraction part of the algorithm.
In accordance with [62] , computes the following features for the input image:
Chromaticity of an average (R,G,B) tuple
Chromaticity of the brightest (R,G,B) tuple (while ignoring saturated pixels)
Chromaticity of the dominant (R,G,B) tuple (the one that has the highest value in the RGB histogram)
Mode of the chromaticity palette, that is constructed by taking 300 most common colors according to the RGB histogram and projecting them on the chromaticity plane. Mode is the most high-density point of the palette, which is computed by a straightforward fixed-bandwidth kernel density estimator with a Epanechnikov kernel function.
Parameters
src— Input three-channel image (BGR color space is assumed).dst— An array of four (r,g) chromaticity tuples corresponding to the features listed above.
getHistBinNum()#
int cv::xphoto::LearningBasedWB::getHistBinNum()
Python:
cv.xphoto.LearningBasedWB.getHistBinNum() -> retval
Defines the size of one dimension of a three-dimensional RGB histogram that is used internally by the algorithm. It often makes sense to increase the number of bins for images with higher bit depth (e.g. 256 bins for a 12 bit image).
See also
getRangeMaxVal()#
int cv::xphoto::LearningBasedWB::getRangeMaxVal()
Python:
cv.xphoto.LearningBasedWB.getRangeMaxVal() -> retval
Maximum possible value of the input image (e.g. 255 for 8 bit images, 4095 for 12 bit images)
See also
getSaturationThreshold()#
float cv::xphoto::LearningBasedWB::getSaturationThreshold()
Python:
cv.xphoto.LearningBasedWB.getSaturationThreshold() -> retval
Threshold that is used to determine saturated pixels, i.e. pixels where at least one of the channels exceeds \(\texttt{saturation_threshold}\times\texttt{range_max_val}\) are ignored.
See also
setHistBinNum()#
void cv::xphoto::LearningBasedWB::setHistBinNum(int val)
Python:
cv.xphoto.LearningBasedWB.setHistBinNum(val)
Defines the size of one dimension of a three-dimensional RGB histogram that is used internally by the algorithm. It often makes sense to increase the number of bins for images with higher bit depth (e.g. 256 bins for a 12 bit image).
See also
setRangeMaxVal()#
void cv::xphoto::LearningBasedWB::setRangeMaxVal(int val)
Python:
cv.xphoto.LearningBasedWB.setRangeMaxVal(val)
Maximum possible value of the input image (e.g. 255 for 8 bit images, 4095 for 12 bit images)
See also
setSaturationThreshold()#
void cv::xphoto::LearningBasedWB::setSaturationThreshold(float val)
Python:
cv.xphoto.LearningBasedWB.setSaturationThreshold(val)
Threshold that is used to determine saturated pixels, i.e. pixels where at least one of the channels exceeds \(\texttt{saturation_threshold}\times\texttt{range_max_val}\) are ignored.
See also
Source file#
The documentation for this class was generated from the following file:
opencv2/xphoto/white_balance.hpp