View Source Evision.StructuredLight.GrayCodePattern (Evision v0.1.38)

Summary

Types

t()

Type that represents an StructuredLight.GrayCodePattern struct.

Functions

Constructor

Generates the all-black and all-white images needed for shadowMasks computation.

Get the number of pattern images needed for the graycode pattern.

For a (x,y) pixel of a camera returns the corresponding projector pixel.

Sets the value for black threshold, needed for decoding (shadowsmasks computation).

Sets the value for white threshold, needed for decoding.

Types

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

Type that represents an StructuredLight.GrayCodePattern struct.

  • ref. reference()

    The underlying erlang resource variable.

Functions

@spec create(integer(), integer()) :: t() | {:error, String.t()}

Constructor

Positional Arguments
  • width: int
  • height: int
Return
  • retval: Evision.StructuredLight.GrayCodePattern.t()

Python prototype (for reference only):

create(width, height) -> retval
Link to this function

getImagesForShadowMasks(self, blackImage, whiteImage)

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

Generates the all-black and all-white images needed for shadowMasks computation.

Positional Arguments
  • self: Evision.StructuredLight.GrayCodePattern.t()
Return
  • blackImage: Evision.Mat.t().

    The generated all-black CV_8U image, at projector's resolution.

  • whiteImage: Evision.Mat.t().

    The generated all-white CV_8U image, at projector's resolution.

    To identify shadow regions, the regions of two images where the pixels are not lit by projector's light and thus where there is not coded information, the 3DUNDERWORLD algorithm computes a shadow mask for the two cameras views, starting from a white and a black images captured by each camera. This method generates these two additional images to project.

Python prototype (for reference only):

getImagesForShadowMasks(blackImage, whiteImage) -> blackImage, whiteImage
Link to this function

getNumberOfPatternImages(self)

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

Get the number of pattern images needed for the graycode pattern.

Positional Arguments
  • self: Evision.StructuredLight.GrayCodePattern.t()
Return
  • retval: size_t

@return The number of pattern images needed for the graycode pattern.

Python prototype (for reference only):

getNumberOfPatternImages() -> retval
Link to this function

getProjPixel(self, patternImages, x, y)

View Source
@spec getProjPixel(t(), [Evision.Mat.maybe_mat_in()], integer(), integer()) ::
  {number(), number()} | false | {:error, String.t()}

For a (x,y) pixel of a camera returns the corresponding projector pixel.

Positional Arguments
  • self: Evision.StructuredLight.GrayCodePattern.t()

  • patternImages: [Evision.Mat].

    The pattern images acquired by the camera, stored in a grayscale vector < Mat >.

  • x: int.

    x coordinate of the image pixel.

  • y: int.

    y coordinate of the image pixel.

Return
  • retval: bool

  • projPix: Point.

    Projector's pixel corresponding to the camera's pixel: projPix.x and projPix.y are the image coordinates of the projector's pixel corresponding to the pixel being decoded in a camera.

    The function decodes each pixel in the pattern images acquired by a camera into their corresponding decimal numbers representing the projector's column and row, providing a mapping between camera's and projector's pixel.

Python prototype (for reference only):

getProjPixel(patternImages, x, y) -> retval, projPix
Link to this function

setBlackThreshold(self, value)

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

Sets the value for black threshold, needed for decoding (shadowsmasks computation).

Positional Arguments
  • self: Evision.StructuredLight.GrayCodePattern.t()

  • value: size_t.

    The desired black threshold value.

    Black threshold is a number between 0-255 that represents the minimum brightness difference required for valid pixels, between the fully illuminated (white) and the not illuminated images (black); used in computeShadowMasks method.

Python prototype (for reference only):

setBlackThreshold(value) -> None
Link to this function

setWhiteThreshold(self, value)

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

Sets the value for white threshold, needed for decoding.

Positional Arguments
  • self: Evision.StructuredLight.GrayCodePattern.t()

  • value: size_t.

    The desired white threshold value.

    White threshold is a number between 0-255 that represents the minimum brightness difference required for valid pixels, between the graycode pattern and its inverse images; used in getProjPixel method.

Python prototype (for reference only):

setWhiteThreshold(value) -> None