|
|
@ -55,10 +55,33 @@ namespace cv { namespace xphoto { |
|
|
|
//! @addtogroup xphoto
|
|
|
|
//! @addtogroup xphoto
|
|
|
|
//! @{
|
|
|
|
//! @{
|
|
|
|
|
|
|
|
|
|
|
|
/** @brief The function implements a simple grayworld white balance algorithm.
|
|
|
|
/** @brief Implements a simple grayworld white balance algorithm.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The function autowbGrayworld scales the values of pixels based on a |
|
|
|
|
|
|
|
gray-world assumption which states that the average of all channels |
|
|
|
|
|
|
|
should result in a gray image. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This function adds a modification which thresholds pixels based on their |
|
|
|
|
|
|
|
saturation value and only uses pixels below the provided threshold in |
|
|
|
|
|
|
|
finding average pixel values. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Saturation is calculated using the following for a 3-channel RGB image per |
|
|
|
|
|
|
|
pixel I and is in the range [0, 1]: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
\f[ \texttt{Saturation} [I] = \frac{\textrm{max}(R,G,B) - \textrm{min}(R,G,B) |
|
|
|
|
|
|
|
}{\textrm{max}(R,G,B)} \f] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
A threshold of 1 means that all pixels are used to white-balance, while a |
|
|
|
|
|
|
|
threshold of 0 means no pixels are used. Lower thresholds are useful in |
|
|
|
|
|
|
|
white-balancing saturated images. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Currently only works on images of type @ref CV_8UC3. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@param src Input array. |
|
|
|
|
|
|
|
@param dst Output array of the same size and type as src. |
|
|
|
|
|
|
|
@param thresh Maximum saturation for a pixel to be included in the |
|
|
|
|
|
|
|
gray-world assumption. |
|
|
|
|
|
|
|
|
|
|
|
@param src |
|
|
|
|
|
|
|
@param dst |
|
|
|
|
|
|
|
@sa balanceWhite |
|
|
|
@sa balanceWhite |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
CV_EXPORTS_W void autowbGrayworld(InputArray src, OutputArray dst, |
|
|
|
CV_EXPORTS_W void autowbGrayworld(InputArray src, OutputArray dst, |
|
|
|