View Source Evision.XPhoto.LearningBasedWB (Evision v0.2.9)

Summary

Types

t()

Type that represents an XPhoto.LearningBasedWB struct.

Functions

Implements the feature extraction part of the algorithm.

Implements the feature extraction part of the algorithm.

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

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

Threshold that is used to determine saturated pixels, i.e. pixels where at least one of the channels exceeds \f$\texttt{saturation\_threshold}\times\texttt{range\_max\_val}\f$ are ignored.

setHistBinNum

setRangeMaxVal

setSaturationThreshold

Types

@type t() :: %Evision.XPhoto.LearningBasedWB{ref: reference()}

Type that represents an XPhoto.LearningBasedWB struct.

  • ref. reference()

    The underlying erlang resource variable.

Functions

Link to this function

extractSimpleFeatures(named_args)

View Source
@spec extractSimpleFeatures(Keyword.t()) :: any() | {:error, String.t()}
Link to this function

extractSimpleFeatures(self, src)

View Source
@spec extractSimpleFeatures(t(), Evision.Mat.maybe_mat_in()) ::
  Evision.Mat.t() | {:error, String.t()}

Implements the feature extraction part of the algorithm.

Positional Arguments
  • self: Evision.XPhoto.LearningBasedWB.t()

  • src: Evision.Mat.

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

Return
  • dst: Evision.Mat.t().

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

In accordance with @cite Cheng2015 , computes the following features for the input image:

  1. Chromaticity of an average (R,G,B) tuple
  2. Chromaticity of the brightest (R,G,B) tuple (while ignoring saturated pixels)
  3. Chromaticity of the dominant (R,G,B) tuple (the one that has the highest value in the RGB histogram)
  4. 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.

Python prototype (for reference only):

extractSimpleFeatures(src[, dst]) -> dst
Link to this function

extractSimpleFeatures(self, src, opts)

View Source
@spec extractSimpleFeatures(
  t(),
  Evision.Mat.maybe_mat_in(),
  [{atom(), term()}, ...] | nil
) ::
  Evision.Mat.t() | {:error, String.t()}

Implements the feature extraction part of the algorithm.

Positional Arguments
  • self: Evision.XPhoto.LearningBasedWB.t()

  • src: Evision.Mat.

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

Return
  • dst: Evision.Mat.t().

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

In accordance with @cite Cheng2015 , computes the following features for the input image:

  1. Chromaticity of an average (R,G,B) tuple
  2. Chromaticity of the brightest (R,G,B) tuple (while ignoring saturated pixels)
  3. Chromaticity of the dominant (R,G,B) tuple (the one that has the highest value in the RGB histogram)
  4. 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.

Python prototype (for reference only):

extractSimpleFeatures(src[, dst]) -> dst
Link to this function

getHistBinNum(named_args)

View Source
@spec getHistBinNum(Keyword.t()) :: any() | {:error, String.t()}
@spec getHistBinNum(t()) :: integer() | {:error, String.t()}

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

Positional Arguments
  • self: Evision.XPhoto.LearningBasedWB.t()
Return
  • retval: integer()

@see setHistBinNum/2

Python prototype (for reference only):

getHistBinNum() -> retval
Link to this function

getRangeMaxVal(named_args)

View Source
@spec getRangeMaxVal(Keyword.t()) :: any() | {:error, String.t()}
@spec getRangeMaxVal(t()) :: integer() | {:error, String.t()}

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

Positional Arguments
  • self: Evision.XPhoto.LearningBasedWB.t()
Return
  • retval: integer()

@see setRangeMaxVal/2

Python prototype (for reference only):

getRangeMaxVal() -> retval
Link to this function

getSaturationThreshold(named_args)

View Source
@spec getSaturationThreshold(Keyword.t()) :: any() | {:error, String.t()}
@spec getSaturationThreshold(t()) :: number() | {:error, String.t()}

Threshold that is used to determine saturated pixels, i.e. pixels where at least one of the channels exceeds \f$\texttt{saturation\_threshold}\times\texttt{range\_max\_val}\f$ are ignored.

Positional Arguments
  • self: Evision.XPhoto.LearningBasedWB.t()
Return
  • retval: float

@see setSaturationThreshold/2

Python prototype (for reference only):

getSaturationThreshold() -> retval
Link to this function

setHistBinNum(named_args)

View Source
@spec setHistBinNum(Keyword.t()) :: any() | {:error, String.t()}
Link to this function

setHistBinNum(self, val)

View Source
@spec setHistBinNum(t(), integer()) :: t() | {:error, String.t()}

setHistBinNum

Positional Arguments
  • self: Evision.XPhoto.LearningBasedWB.t()
  • val: integer()

@see getHistBinNum/1

Python prototype (for reference only):

setHistBinNum(val) -> None
Link to this function

setRangeMaxVal(named_args)

View Source
@spec setRangeMaxVal(Keyword.t()) :: any() | {:error, String.t()}
Link to this function

setRangeMaxVal(self, val)

View Source
@spec setRangeMaxVal(t(), integer()) :: t() | {:error, String.t()}

setRangeMaxVal

Positional Arguments
  • self: Evision.XPhoto.LearningBasedWB.t()
  • val: integer()

@see getRangeMaxVal/1

Python prototype (for reference only):

setRangeMaxVal(val) -> None
Link to this function

setSaturationThreshold(named_args)

View Source
@spec setSaturationThreshold(Keyword.t()) :: any() | {:error, String.t()}
Link to this function

setSaturationThreshold(self, val)

View Source
@spec setSaturationThreshold(t(), number()) :: t() | {:error, String.t()}

setSaturationThreshold

Positional Arguments
  • self: Evision.XPhoto.LearningBasedWB.t()
  • val: float

@see getSaturationThreshold/1

Python prototype (for reference only):

setSaturationThreshold(val) -> None