Table of Contents

Class LearningBasedWB

Namespace
OpenCvSharp.XPhoto
Assembly
OpenCvSharp.dll

More sophisticated learning-based automatic white balance algorithm.

public class LearningBasedWB : WhiteBalancer, IDisposable, ICvPtrHolder
Inheritance
LearningBasedWB
Implements
Inherited Members

Properties

HistBinNum

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

public int HistBinNum { get; set; }

Property Value

int

RangeMaxVal

Maximum possible value of the input image (e.g. 255 for 8 bit images, 4095 for 12 bit images)

public int RangeMaxVal { get; set; }

Property Value

int

SaturationThreshold

Threshold that is used to determine saturated pixels, i.e. pixels where at least one of the channels exceeds

public float SaturationThreshold { get; set; }

Property Value

float

Methods

BalanceWhite(InputArray, OutputArray)

Applies white balancing to the input image.

public override void BalanceWhite(InputArray src, OutputArray dst)

Parameters

src InputArray

Input image

dst OutputArray

White balancing result

Create(string?)

Creates an instance of LearningBasedWB

public static LearningBasedWB Create(string? model)

Parameters

model string

Path to a .yml file with the model. If not specified, the default model is used

Returns

LearningBasedWB

DisposeManaged()

Releases managed resources

protected override void DisposeManaged()

ExtractSimpleFeatures(InputArray, OutputArray)

Implements the feature extraction part of the algorithm.

public void ExtractSimpleFeatures(InputArray src, OutputArray dst)

Parameters

src InputArray

Input three-channel image (BGR color space is assumed).

dst OutputArray

An array of four (r,g) chromaticity tuples corresponding to the features listed above.