OpenCV  3.1.0
Open Source Computer Vision
Enumerations | Functions
Additional photo processing algorithms

Enumerations

enum  cv::xphoto::InpaintTypes { cv::xphoto::INPAINT_SHIFTMAP = 0 }
 various inpainting algorithms More...
 
enum  cv::xphoto::WhitebalanceTypes {
  cv::xphoto::WHITE_BALANCE_SIMPLE = 0,
  cv::xphoto::WHITE_BALANCE_GRAYWORLD = 1
}
 various white balance algorithms More...
 

Functions

void cv::xphoto::autowbGrayworld (InputArray src, OutputArray dst, float thresh=0.5f)
 Implements a simple grayworld white balance algorithm. More...
 
void cv::xphoto::balanceWhite (const Mat &src, Mat &dst, const int algorithmType, const float inputMin=0.0f, const float inputMax=255.0f, const float outputMin=0.0f, const float outputMax=255.0f)
 The function implements different algorithm of automatic white balance,. More...
 
void cv::xphoto::dctDenoising (const Mat &src, Mat &dst, const double sigma, const int psize=16)
 The function implements simple dct-based denoising. More...
 
void cv::xphoto::inpaint (const Mat &src, const Mat &mask, Mat &dst, const int algorithmType)
 The function implements different single-image inpainting algorithms. More...
 

Detailed Description

Enumeration Type Documentation

various inpainting algorithms

Enumerator
INPAINT_SHIFTMAP 

This algorithm searches for dominant correspondences (transformations) of image patches and tries to seamlessly fill-in the area to be inpainted using this transformations

various white balance algorithms

Enumerator
WHITE_BALANCE_SIMPLE 

perform smart histogram adjustments (ignoring 4% pixels with minimal and maximal values) for each channel

WHITE_BALANCE_GRAYWORLD 

Function Documentation

void cv::xphoto::autowbGrayworld ( InputArray  src,
OutputArray  dst,
float  thresh = 0.5f 
)

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]:

\[ \texttt{Saturation} [I] = \frac{\textrm{max}(R,G,B) - \textrm{min}(R,G,B) }{\textrm{max}(R,G,B)} \]

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 CV_8UC3.

Parameters
srcInput array.
dstOutput array of the same size and type as src.
threshMaximum saturation for a pixel to be included in the gray-world assumption.
See also
balanceWhite
void cv::xphoto::balanceWhite ( const Mat src,
Mat dst,
const int  algorithmType,
const float  inputMin = 0.0f,
const float  inputMax = 255.0f,
const float  outputMin = 0.0f,
const float  outputMax = 255.0f 
)

The function implements different algorithm of automatic white balance,.

i.e. it tries to map image's white color to perceptual white (this can be violated due to specific illumination or camera settings).

Parameters
src
dst
algorithmTypesee xphoto::WhitebalanceTypes
inputMinminimum value in the input image
inputMaxmaximum value in the input image
outputMinminimum value in the output image
outputMaxmaximum value in the output image
See also
cvtColor, equalizeHist
void cv::xphoto::dctDenoising ( const Mat src,
Mat dst,
const double  sigma,
const int  psize = 16 
)

The function implements simple dct-based denoising.

http://www.ipol.im/pub/art/2011/ys-dct/.

Parameters
srcsource image
dstdestination image
sigmaexpected noise standard deviation
psizesize of block side where dct is computed
See also
fastNlMeansDenoising
void cv::xphoto::inpaint ( const Mat src,
const Mat mask,
Mat dst,
const int  algorithmType 
)

The function implements different single-image inpainting algorithms.

See the original paper [63] for details.

Parameters
srcsource image, it could be of any type and any number of channels from 1 to 4. In case of 3- and 4-channels images the function expect them in CIELab colorspace or similar one, where first color component shows intensity, while second and third shows colors. Nonetheless you can try any colorspaces.
maskmask (CV_8UC1), where non-zero pixels indicate valid image area, while zero pixels indicate area to be inpainted
dstdestination image
algorithmTypesee xphoto::InpaintTypes