🤖 AIによる機械翻訳(非公式) — これは OpenCV 5.0.0 公式リファレンス(英語)を AI (Claude) で自動翻訳したものです。訳に誤りを含む場合があります。正確な情報は 公式英語版(原文) を参照してください。

クラス GrayCodePattern


  • public class GrayCodePattern extends StructuredLightPattern
    CITE: UNDERWORLD に基づくグレイコードパターンを実装するクラス。パターン画像の生成は、従来の白と黒の色を用いたグレイ符号化によって行われる。2つの画像軸 x, y に関する情報は、それぞれ別個の2つのパターン系列に符号化される。解像度 (P_res_x, P_res_y) のプロジェクタ P では、列を表す Ncols = log 2 (P_res_x) 枚の符号化パターン画像と、行を表す Nrows = log 2 (P_res_y) 枚の符号化パターン画像が生成される。例えば解像度 1024x768 のプロジェクタでは Ncols = 10、Nrows = 10 となる。ただし、生成されるパターン系列は通常の色の画像と色を反転させた画像の両方から構成される。反転パターン画像は、元の画像と同じ構造を持ちながら色を反転させた画像である。これにより、各ピクセルが照らされているとき (最高値) と照らされていないとき (最低値) の強度値を容易に判定する効果的な手法が得られる。したがって解像度 1024x768 のプロジェクタでは、パターン画像の枚数は Ncols * 2 + Nrows * 2 = 40 となる。
    • コンストラクタの詳細

      • GrayCodePattern

        protected GrayCodePattern​(long addr)
    • メソッドの詳細

      • create

        public static GrayCodePattern create​(int width,
                                             int height)
        Constructor
        引数:
        width - 自動生成
        height - 自動生成
        戻り値:
        自動生成
      • getNumberOfPatternImages

        public long getNumberOfPatternImages()
        Get the number of pattern images needed for the graycode pattern.
        戻り値:
        グレイコードパターンに必要なパターン画像の枚数。
      • setWhiteThreshold

        public void setWhiteThreshold​(long value)
        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.
        引数:
        value - 設定する白色のしきい値。
      • setBlackThreshold

        public void setBlackThreshold​(long value)
        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.
        引数:
        value - 設定する黒色のしきい値。
      • getImagesForShadowMasks

        public void getImagesForShadowMasks​(Mat blackImage,
                                            Mat whiteImage)
        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.
        引数:
        blackImage - 生成される全面黒のCV_8U画像。プロジェクタの解像度。
        whiteImage - 生成される全面白のCV_8U画像。プロジェクタの解像度。
      • getProjPixel

        public boolean getProjPixel​(java.util.List<Mat> patternImages,
                                    int x,
                                    int y,
                                    Point projPix)
        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.
        引数:
        patternImages - カメラで取得したパターン画像。グレースケールのvector < Mat >に格納される。
        x - 画像ピクセルのx座標。
        y - 画像ピクセルのy座標。
        projPix - カメラのピクセルに対応するプロジェクタのピクセル。projPix.xおよびprojPix.yは、カメラで復号対象となるピクセルに対応するプロジェクタのピクセルの画像座標である。
        戻り値:
        自動生成