[][src]Trait opencv::hub_prelude::GrayCodePattern

pub trait GrayCodePattern: StructuredLightPattern {
    pub fn as_raw_GrayCodePattern(&self) -> *const c_void;
pub fn as_raw_mut_GrayCodePattern(&mut self) -> *mut c_void; pub fn get_number_of_pattern_images(&self) -> Result<size_t> { ... }
pub fn set_white_threshold(&mut self, value: size_t) -> Result<()> { ... }
pub fn set_black_threshold(&mut self, value: size_t) -> Result<()> { ... }
pub fn get_images_for_shadow_masks(
        &self,
        black_image: &mut dyn ToInputOutputArray,
        white_image: &mut dyn ToInputOutputArray
    ) -> Result<()> { ... }
pub fn get_proj_pixel(
        &self,
        pattern_images: &dyn ToInputArray,
        x: i32,
        y: i32,
        proj_pix: &mut Point
    ) -> Result<bool> { ... } }

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.

Required methods

Loading content...

Provided methods

pub fn get_number_of_pattern_images(&self) -> Result<size_t>[src]

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

Returns

The number of pattern images needed for the graycode pattern.

pub fn set_white_threshold(&mut self, value: size_t) -> Result<()>[src]

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.

Parameters

  • value: The desired white threshold value.

pub fn set_black_threshold(&mut self, value: size_t) -> Result<()>[src]

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.

Parameters

  • value: The desired black threshold value.

pub fn get_images_for_shadow_masks(
    &self,
    black_image: &mut dyn ToInputOutputArray,
    white_image: &mut dyn ToInputOutputArray
) -> Result<()>
[src]

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.

Parameters

  • blackImage: The generated all-black CV_8U image, at projector's resolution.
  • whiteImage: The generated all-white CV_8U image, at projector's resolution.

pub fn get_proj_pixel(
    &self,
    pattern_images: &dyn ToInputArray,
    x: i32,
    y: i32,
    proj_pix: &mut Point
) -> Result<bool>
[src]

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.

Parameters

  • 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.
Loading content...

Implementations

impl<'_> dyn GrayCodePattern + '_[src]

pub fn create(
    parameters: &GrayCodePattern_Params
) -> Result<Ptr<dyn GrayCodePattern>>
[src]

Constructor

Parameters

  • parameters: GrayCodePattern parameters GrayCodePattern::Params: the width and the height of the projector.

C++ default parameters

  • parameters: GrayCodePattern::Params()

pub fn create_1(width: i32, height: i32) -> Result<Ptr<dyn GrayCodePattern>>[src]

Implementors

Loading content...