OpenCV453
クラス | 公開メンバ関数 | 静的公開メンバ関数 | 全メンバ一覧
cv::structured_light::GrayCodePattern クラスabstract

Class implementing the Gray-code pattern, based on [UNDERWORLD]. [詳解]

#include <graycodepattern.hpp>

cv::structured_light::StructuredLightPatternを継承しています。

クラス

struct  Params
 Parameters of StructuredLightPattern constructor. [詳解]
 

公開メンバ関数

virtual CV_WRAP size_t getNumberOfPatternImages () const =0
 Get the number of pattern images needed for the graycode pattern. [詳解]
 
virtual CV_WRAP void setWhiteThreshold (size_t value)=0
 Sets the value for white threshold, needed for decoding. [詳解]
 
virtual CV_WRAP void setBlackThreshold (size_t value)=0
 Sets the value for black threshold, needed for decoding (shadowsmasks computation). [詳解]
 
virtual CV_WRAP void getImagesForShadowMasks (InputOutputArray blackImage, InputOutputArray whiteImage) const =0
 Generates the all-black and all-white images needed for shadowMasks computation. [詳解]
 
virtual CV_WRAP bool getProjPixel (InputArrayOfArrays patternImages, int x, int y, CV_OUT Point &projPix) const =0
 For a (x,y) pixel of a camera returns the corresponding projector pixel. [詳解]
 
- 基底クラス cv::structured_light::StructuredLightPattern に属する継承公開メンバ関数
virtual CV_WRAP bool generate (OutputArrayOfArrays patternImages)=0
 Generates the structured light pattern to project. [詳解]
 
virtual CV_WRAP bool decode (const std::vector< std::vector< Mat > > &patternImages, OutputArray disparityMap, InputArrayOfArrays blackImages=noArray(), InputArrayOfArrays whiteImages=noArray(), int flags=DECODE_3D_UNDERWORLD) const =0
 Decodes the structured light pattern, generating a disparity map [詳解]
 
- 基底クラス cv::Algorithm に属する継承公開メンバ関数
virtual CV_WRAP void clear ()
 Clears the algorithm state [詳解]
 
virtual void write (FileStorage &fs) const
 Stores algorithm parameters in a file storage [詳解]
 
CV_WRAP void write (const Ptr< FileStorage > &fs, const String &name=String()) const
 simplified API for language bindings これはオーバーロードされたメンバ関数です。利便性のために用意されています。元の関数との違いは引き数のみです。
 
virtual CV_WRAP void read (const FileNode &fn)
 Reads algorithm parameters from a file storage [詳解]
 
virtual CV_WRAP bool empty () const
 Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read [詳解]
 
virtual CV_WRAP void save (const String &filename) const
 
virtual CV_WRAP String getDefaultName () const
 

静的公開メンバ関数

static Ptr< GrayCodePatterncreate (const GrayCodePattern::Params &parameters=GrayCodePattern::Params())
 Constructor [詳解]
 
static CV_WRAP Ptr< GrayCodePatterncreate (int width, int height)
 
- 基底クラス cv::Algorithm に属する継承静的公開メンバ関数
template<typename _Tp >
static Ptr< _Tp > read (const FileNode &fn)
 Reads algorithm from the file node [詳解]
 
template<typename _Tp >
static Ptr< _Tp > load (const String &filename, const String &objname=String())
 Loads algorithm from the file [詳解]
 
template<typename _Tp >
static Ptr< _Tp > loadFromString (const String &strModel, const String &objname=String())
 Loads algorithm from a String [詳解]
 

その他の継承メンバ

- 基底クラス cv::Algorithm に属する継承限定公開メンバ関数
void writeFormat (FileStorage &fs) const
 

詳解

Class implementing the Gray-code pattern, based on [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.

関数詳解

◆ create()

static Ptr< GrayCodePattern > cv::structured_light::GrayCodePattern::create ( const GrayCodePattern::Params parameters = GrayCodePattern::Params())
static

Constructor

引数
parametersGrayCodePattern parameters GrayCodePattern::Params: the width and the height of the projector.

◆ getImagesForShadowMasks()

virtual CV_WRAP void cv::structured_light::GrayCodePattern::getImagesForShadowMasks ( InputOutputArray  blackImage,
InputOutputArray  whiteImage 
) const
pure virtual

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.

引数
blackImageThe generated all-black CV_8U image, at projector's resolution.
whiteImageThe generated all-white CV_8U image, at projector's resolution.

◆ getNumberOfPatternImages()

virtual CV_WRAP size_t cv::structured_light::GrayCodePattern::getNumberOfPatternImages ( ) const
pure virtual

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

戻り値
The number of pattern images needed for the graycode pattern.

◆ getProjPixel()

virtual CV_WRAP bool cv::structured_light::GrayCodePattern::getProjPixel ( InputArrayOfArrays  patternImages,
int  x,
int  y,
CV_OUT Point projPix 
) const
pure virtual

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.

引数
patternImagesThe pattern images acquired by the camera, stored in a grayscale vector < Mat >.
xx coordinate of the image pixel.
yy coordinate of the image pixel.
projPixProjector'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.

◆ setBlackThreshold()

virtual CV_WRAP void cv::structured_light::GrayCodePattern::setBlackThreshold ( size_t  value)
pure virtual

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

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.

引数
valueThe desired black threshold value.

◆ setWhiteThreshold()

virtual CV_WRAP void cv::structured_light::GrayCodePattern::setWhiteThreshold ( size_t  value)
pure virtual

Sets the value for white threshold, needed for decoding.

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.

引数
valueThe desired white threshold value.

このクラス詳解は次のファイルから抽出されました: