@Namespace(value="cv::structured_light") @Properties(inherit=opencv_structured_light.class) public class GrayCodePattern extends StructuredLightPattern
/** \brief Class implementing the Gray-code pattern, based on \cite UNDERWORLD. The generation of the pattern images is performed with Gray encoding using the traditional white and black colors. The information about the two image axes x, y is encoded separately into two different pattern sequences. A projector P with resolution (P_res_x, P_res_y) will result in Ncols = log 2 (P_res_x) encoded pattern images representing the columns, and in Nrows = log 2 (P_res_y) encoded pattern images representing the rows. For example a projector with resolution 1024x768 will result in Ncols = 10 and Nrows = 10.
However, the generated pattern sequence consists of both regular color and color-inverted images: inverted pattern images are images with the same structure as the original but with inverted colors. This provides an effective method for easily determining the intensity value of each pixel when it is lit (highest value) and when it is not lit (lowest value). So for a a projector with resolution 1024x768, the number of pattern images will be Ncols * 2 + Nrows * 2 = 40.
Modifier and Type | Class and Description |
---|---|
static class |
GrayCodePattern.Params
\brief Parameters of StructuredLightPattern constructor.
|
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
GrayCodePattern(Pointer p)
Pointer cast constructor.
|
Modifier and Type | Method and Description |
---|---|
static GrayCodePattern |
create() |
static GrayCodePattern |
create(GrayCodePattern.Params parameters)
\brief Constructor
|
static GrayCodePattern |
create(int width,
int height) |
void |
getImagesForShadowMasks(GpuMat blackImage,
GpuMat whiteImage) |
void |
getImagesForShadowMasks(Mat blackImage,
Mat whiteImage)
\brief Generates the all-black and all-white images needed for shadowMasks computation.
|
void |
getImagesForShadowMasks(UMat blackImage,
UMat whiteImage) |
long |
getNumberOfPatternImages()
\brief Get the number of pattern images needed for the graycode pattern.
|
boolean |
getProjPixel(GpuMatVector patternImages,
int x,
int y,
Point projPix) |
boolean |
getProjPixel(MatVector patternImages,
int x,
int y,
Point projPix)
\brief For a (x,y) pixel of a camera returns the corresponding projector pixel.
|
boolean |
getProjPixel(UMatVector patternImages,
int x,
int y,
Point projPix) |
void |
setBlackThreshold(long value)
\brief Sets the value for black threshold, needed for decoding (shadowsmasks computation).
|
void |
setWhiteThreshold(long value)
\brief Sets the value for white threshold, needed for decoding.
|
decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, generate, generate, generate
clear, empty, getDefaultName, position, read, save, save, write, write, write
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, hashCode, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetof, parseBytes, physicalBytes, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, toString, totalBytes, totalPhysicalBytes, withDeallocator, zero
public GrayCodePattern(Pointer p)
Pointer.Pointer(Pointer)
.@opencv_core.Ptr public static GrayCodePattern create(@Const @ByRef(nullValue="cv::structured_light::GrayCodePattern::Params()") GrayCodePattern.Params parameters)
parameters
- GrayCodePattern parameters GrayCodePattern::Params: the width and the height of the projector.@opencv_core.Ptr public static GrayCodePattern create()
@opencv_core.Ptr public static GrayCodePattern create(int width, int height)
@Cast(value="size_t") public long getNumberOfPatternImages()
public void setWhiteThreshold(@Cast(value="size_t") long value)
value
- The desired white threshold value.public void setBlackThreshold(@Cast(value="size_t") long value)
value
- The desired black threshold value.public void getImagesForShadowMasks(@ByVal Mat blackImage, @ByVal Mat whiteImage)
blackImage
- The generated all-black CV_8U image, at projector's resolution.whiteImage
- The generated all-white CV_8U image, at projector's resolution.public void getImagesForShadowMasks(@ByVal UMat blackImage, @ByVal UMat whiteImage)
public void getImagesForShadowMasks(@ByVal GpuMat blackImage, @ByVal GpuMat whiteImage)
@Cast(value="bool") public boolean getProjPixel(@ByVal MatVector patternImages, int x, int y, @ByRef Point projPix)
patternImages
- The pattern images acquired by the camera, stored in a grayscale vector < Mat >.x
- x coordinate of the image pixel.y
- y coordinate of the image pixel.projPix
- 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.@Cast(value="bool") public boolean getProjPixel(@ByVal UMatVector patternImages, int x, int y, @ByRef Point projPix)
Copyright © 2020. All rights reserved.