pub trait GrayCodePatternTraitConst: StructuredLightPatternTraitConst {
// Required method
fn as_raw_GrayCodePattern(&self) -> *const c_void;
// Provided methods
fn get_number_of_pattern_images(&self) -> Result<size_t> { ... }
fn get_images_for_shadow_masks(
&self,
black_image: &mut impl ToInputOutputArray,
white_image: &mut impl ToInputOutputArray,
) -> Result<()> { ... }
fn get_proj_pixel(
&self,
pattern_images: &impl ToInputArray,
x: i32,
y: i32,
proj_pix: &mut Point,
) -> Result<bool> { ... }
}
Expand description
Constant methods for crate::structured_light::GrayCodePattern
Required Methods§
fn as_raw_GrayCodePattern(&self) -> *const c_void
Provided Methods§
sourcefn get_number_of_pattern_images(&self) -> Result<size_t>
fn get_number_of_pattern_images(&self) -> Result<size_t>
Get the number of pattern images needed for the graycode pattern.
§Returns
The number of pattern images needed for the graycode pattern.
sourcefn get_images_for_shadow_masks(
&self,
black_image: &mut impl ToInputOutputArray,
white_image: &mut impl ToInputOutputArray,
) -> Result<()>
fn get_images_for_shadow_masks( &self, black_image: &mut impl ToInputOutputArray, white_image: &mut impl ToInputOutputArray, ) -> Result<()>
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.
sourcefn get_proj_pixel(
&self,
pattern_images: &impl ToInputArray,
x: i32,
y: i32,
proj_pix: &mut Point,
) -> Result<bool>
fn get_proj_pixel( &self, pattern_images: &impl ToInputArray, x: i32, y: i32, proj_pix: &mut Point, ) -> Result<bool>
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.