OpenCV for Unity  2.6.0
Enox Software / Please refer to OpenCV official document ( http://docs.opencv.org/4.9.0/index.html ) for the details of the argument of the method.
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
OpenCVForUnity.XphotoModule.GrayworldWB Class Reference

Gray-world white balance algorithm. More...

Inheritance diagram for OpenCVForUnity.XphotoModule.GrayworldWB:
OpenCVForUnity.XphotoModule.WhiteBalancer OpenCVForUnity.CoreModule.Algorithm OpenCVForUnity.DisposableOpenCVObject OpenCVForUnity.DisposableObject

Public Member Functions

float getSaturationThreshold ()
 Maximum saturation for a pixel to be included in the gray-world assumption. More...
 
void setSaturationThreshold (float val)
 
- Public Member Functions inherited from OpenCVForUnity.XphotoModule.WhiteBalancer
void balanceWhite (Mat src, Mat dst)
 Applies white balancing to the input image. More...
 
- Public Member Functions inherited from OpenCVForUnity.CoreModule.Algorithm
IntPtr getNativeObjAddr ()
 
virtual void clear ()
 Clears the algorithm state. More...
 
virtual bool empty ()
 Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read. More...
 
void save (string filename)
 
virtual string getDefaultName ()
 
- Public Member Functions inherited from OpenCVForUnity.DisposableObject
void Dispose ()
 
void ThrowIfDisposed ()
 

Static Public Member Functions

static new GrayworldWB __fromPtr__ (IntPtr addr)
 
- Static Public Member Functions inherited from OpenCVForUnity.XphotoModule.WhiteBalancer
static new WhiteBalancer __fromPtr__ (IntPtr addr)
 
- Static Public Member Functions inherited from OpenCVForUnity.CoreModule.Algorithm
static Algorithm __fromPtr__ (IntPtr addr)
 
- Static Public Member Functions inherited from OpenCVForUnity.DisposableObject
static IntPtr ThrowIfNullIntPtr (IntPtr ptr)
 

Protected Member Functions

override void Dispose (bool disposing)
 
- Protected Member Functions inherited from OpenCVForUnity.XphotoModule.WhiteBalancer
override void Dispose (bool disposing)
 
- Protected Member Functions inherited from OpenCVForUnity.DisposableOpenCVObject
 DisposableOpenCVObject ()
 
 DisposableOpenCVObject (IntPtr ptr)
 
 DisposableOpenCVObject (bool isEnabledDispose)
 
 DisposableOpenCVObject (IntPtr ptr, bool isEnabledDispose)
 
- Protected Member Functions inherited from OpenCVForUnity.DisposableObject
 DisposableObject ()
 
 DisposableObject (bool isEnabledDispose)
 

Additional Inherited Members

- Properties inherited from OpenCVForUnity.DisposableObject
bool IsDisposed [get, protected set]
 
bool IsEnabledDispose [get, set]
 

Detailed Description

Gray-world white balance algorithm.

This algorithm 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.

It 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 supports images of type CV_8UC3 and CV_16UC3.

Member Function Documentation

◆ __fromPtr__()

static new GrayworldWB OpenCVForUnity.XphotoModule.GrayworldWB.__fromPtr__ ( IntPtr  addr)
static

◆ Dispose()

override void OpenCVForUnity.XphotoModule.GrayworldWB.Dispose ( bool  disposing)
protectedvirtual

◆ getSaturationThreshold()

float OpenCVForUnity.XphotoModule.GrayworldWB.getSaturationThreshold ( )

Maximum saturation for a pixel to be included in the gray-world assumption.

See also
setSaturationThreshold

◆ setSaturationThreshold()

void OpenCVForUnity.XphotoModule.GrayworldWB.setSaturationThreshold ( float  val)

Maximum saturation for a pixel to be included in the gray-world assumption.

See also
getSaturationThreshold

The documentation for this class was generated from the following file: