View Source Evision.Intensitytransform (Evision v0.1.28)

Link to this section Summary

Types

t()

Type that represents an Intensitytransform struct.

Functions

Given an input bgr or grayscale image, apply autoscaling on domain [0, 255] to increase the contrast of the input image and return the resulting image.

Given an input color image, enhance low-light images using the BIMEF method (@cite ying2017bio @cite ying2017new).

Given an input color image, enhance low-light images using the BIMEF method (@cite ying2017bio @cite ying2017new).

Given an input color image, enhance low-light images using the BIMEF method (@cite ying2017bio @cite ying2017new).

Given an input color image, enhance low-light images using the BIMEF method (@cite ying2017bio @cite ying2017new).

Given an input bgr or grayscale image, apply linear contrast stretching on domain [0, 255] and return the resulting image.

Given an input bgr or grayscale image and constant gamma, apply power-law transformation, a.k.a. gamma correction to the image on domain [0, 255] and return the resulting image.

Given an input bgr or grayscale image and constant c, apply log transformation to the image on domain [0, 255] and return the resulting image.

Link to this section Types

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

Type that represents an Intensitytransform struct.

  • ref. reference()

    The underlying erlang resource variable.

Link to this section Functions

Link to this function

autoscaling(input, output)

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

Given an input bgr or grayscale image, apply autoscaling on domain [0, 255] to increase the contrast of the input image and return the resulting image.

Positional Arguments
  • input: Evision.Mat.t().

    input bgr or grayscale image.

  • output: Evision.Mat.t().

    resulting image of autoscaling.

Python prototype (for reference only):

autoscaling(input, output) -> None
Link to this function

bimef2(input, k, mu, a, b)

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

Given an input color image, enhance low-light images using the BIMEF method (@cite ying2017bio @cite ying2017new).

Positional Arguments
  • input: Evision.Mat.t().

    input color image.

  • k: float.

    exposure ratio.

  • mu: float.

    enhancement ratio.

  • a: float.

    a-parameter in the Camera Response Function (CRF).

  • b: float.

    b-parameter in the Camera Response Function (CRF).

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

    resulting image.

This is an overloaded function with the exposure ratio given as parameter.

@warning This is a C++ implementation of the original MATLAB algorithm. Compared to the original code, this implementation is a little bit slower and does not provide the same results. In particular, quality of the image enhancement is degraded for the bright areas in certain conditions.

Python prototype (for reference only):

BIMEF2(input, k, mu, a, b[, output]) -> output
Link to this function

bimef2(input, k, mu, a, b, opts)

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

Given an input color image, enhance low-light images using the BIMEF method (@cite ying2017bio @cite ying2017new).

Positional Arguments
  • input: Evision.Mat.t().

    input color image.

  • k: float.

    exposure ratio.

  • mu: float.

    enhancement ratio.

  • a: float.

    a-parameter in the Camera Response Function (CRF).

  • b: float.

    b-parameter in the Camera Response Function (CRF).

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

    resulting image.

This is an overloaded function with the exposure ratio given as parameter.

@warning This is a C++ implementation of the original MATLAB algorithm. Compared to the original code, this implementation is a little bit slower and does not provide the same results. In particular, quality of the image enhancement is degraded for the bright areas in certain conditions.

Python prototype (for reference only):

BIMEF2(input, k, mu, a, b[, output]) -> output
@spec bimef(Evision.Mat.maybe_mat_in()) :: Evision.Mat.t() | {:error, String.t()}

Given an input color image, enhance low-light images using the BIMEF method (@cite ying2017bio @cite ying2017new).

Positional Arguments
  • input: Evision.Mat.t().

    input color image.

Keyword Arguments
  • mu: float.

    enhancement ratio.

  • a: float.

    a-parameter in the Camera Response Function (CRF).

  • b: float.

    b-parameter in the Camera Response Function (CRF).

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

    resulting image.

@warning This is a C++ implementation of the original MATLAB algorithm. Compared to the original code, this implementation is a little bit slower and does not provide the same results. In particular, quality of the image enhancement is degraded for the bright areas in certain conditions.

Python prototype (for reference only):

BIMEF(input[, output[, mu[, a[, b]]]]) -> output
@spec bimef(Evision.Mat.maybe_mat_in(), [{atom(), term()}, ...] | nil) ::
  Evision.Mat.t() | {:error, String.t()}

Given an input color image, enhance low-light images using the BIMEF method (@cite ying2017bio @cite ying2017new).

Positional Arguments
  • input: Evision.Mat.t().

    input color image.

Keyword Arguments
  • mu: float.

    enhancement ratio.

  • a: float.

    a-parameter in the Camera Response Function (CRF).

  • b: float.

    b-parameter in the Camera Response Function (CRF).

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

    resulting image.

@warning This is a C++ implementation of the original MATLAB algorithm. Compared to the original code, this implementation is a little bit slower and does not provide the same results. In particular, quality of the image enhancement is degraded for the bright areas in certain conditions.

Python prototype (for reference only):

BIMEF(input[, output[, mu[, a[, b]]]]) -> output
Link to this function

contrastStretching(input, output, r1, s1, r2, s2)

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

Given an input bgr or grayscale image, apply linear contrast stretching on domain [0, 255] and return the resulting image.

Positional Arguments
  • input: Evision.Mat.t().

    input bgr or grayscale image.

  • output: Evision.Mat.t().

    resulting image of contrast stretching.

  • r1: int.

    x coordinate of first point (r1, s1) in the transformation function.

  • s1: int.

    y coordinate of first point (r1, s1) in the transformation function.

  • r2: int.

    x coordinate of second point (r2, s2) in the transformation function.

  • s2: int.

    y coordinate of second point (r2, s2) in the transformation function.

Python prototype (for reference only):

contrastStretching(input, output, r1, s1, r2, s2) -> None
Link to this function

gammaCorrection(input, output, gamma)

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

Given an input bgr or grayscale image and constant gamma, apply power-law transformation, a.k.a. gamma correction to the image on domain [0, 255] and return the resulting image.

Positional Arguments
  • input: Evision.Mat.t().

    input bgr or grayscale image.

  • output: Evision.Mat.t().

    resulting image of gamma corrections.

  • gamma: float.

    constant in c*r^gamma where r is pixel value.

Python prototype (for reference only):

gammaCorrection(input, output, gamma) -> None
Link to this function

logTransform(input, output)

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

Given an input bgr or grayscale image and constant c, apply log transformation to the image on domain [0, 255] and return the resulting image.

Positional Arguments
  • input: Evision.Mat.t().

    input bgr or grayscale image.

  • output: Evision.Mat.t().

    resulting image of log transformations.

Python prototype (for reference only):

logTransform(input, output) -> None