Table of Contents

Class GrayCodePattern

Namespace
Emgu.CV.StructuredLight
Assembly
Emgu.CV.dll

Class implementing the Gray-code pattern, based on Kyriakos Herakleous and Charalambos Poullis. 3DUNDERWORLD-SLS: An Open-Source Structured-Light Scanning System for Rapid Geometry Acquisition. arXiv preprint arXiv:1406.6595, 2014.

public class GrayCodePattern : SharedPtrObject, IDisposable, IStructuredLightPattern, IAlgorithm
Inheritance
GrayCodePattern
Implements
Inherited Members
Extension Methods

Constructors

GrayCodePattern(int, int)

Create a new GrayCodePattern

public GrayCodePattern(int width = 1024, int height = 768)

Parameters

width int

The width of the projector.

height int

The height of the projector.

Properties

AlgorithmPtr

public nint AlgorithmPtr { get; }

Property Value

nint

NumberOfPatternImages

Get the number of pattern images needed for the graycode pattern

public int NumberOfPatternImages { get; }

Property Value

int

StructuredLightPatternPtr

public nint StructuredLightPatternPtr { get; }

Property Value

nint

Methods

DisposeObject()

protected override void DisposeObject()

GetImagesForShadowMasks(IInputOutputArray, IInputOutputArray)

Generates the all-black and all-white images needed for shadowMasks computation. 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.

public void GetImagesForShadowMasks(IInputOutputArray blackImage, IInputOutputArray whiteImage)

Parameters

blackImage IInputOutputArray

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

whiteImage IInputOutputArray

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

GetProjPixel(IInputArray, int, int)

For a (x,y) pixel of a camera returns the corresponding projector pixel. 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.

public Point? GetProjPixel(IInputArray patternImages, int x, int y)

Parameters

patternImages IInputArray

The pattern images acquired by the camera, stored in a grayscale VectorOfMat.

x int

x coordinate of the image pixel.

y int

y coordinate of the image pixel.

Returns

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. If failed to calculate the project, null will be returned.

SetBlackThreshold(int)

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

public void SetBlackThreshold(int value)

Parameters

value int

The value

SetWhiteThreshold(int)

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

public void SetWhiteThreshold(int value)

Parameters

value int

The value