Trait opencv::prelude::GrayCodePattern
source · pub trait GrayCodePattern: GrayCodePatternConst + StructuredLightPattern {
// Required method
fn as_raw_mut_GrayCodePattern(&mut self) -> *mut c_void;
// Provided methods
fn set_white_threshold(&mut self, value: size_t) -> Result<()> { ... }
fn set_black_threshold(&mut self, value: size_t) -> Result<()> { ... }
}
Expand description
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§
fn as_raw_mut_GrayCodePattern(&mut self) -> *mut c_void
Provided Methods§
sourcefn set_white_threshold(&mut self, value: size_t) -> Result<()>
fn set_white_threshold(&mut self, value: size_t) -> Result<()>
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.
sourcefn set_black_threshold(&mut self, value: size_t) -> Result<()>
fn set_black_threshold(&mut self, value: size_t) -> Result<()>
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.
Implementations§
source§impl dyn GrayCodePattern + '_
impl dyn GrayCodePattern + '_
sourcepub fn create(
parameters: &GrayCodePattern_Params
) -> Result<Ptr<dyn GrayCodePattern>>
pub fn create( parameters: &GrayCodePattern_Params ) -> Result<Ptr<dyn GrayCodePattern>>
Constructor
Parameters
- parameters: GrayCodePattern parameters GrayCodePattern::Params: the width and the height of the projector.
C++ default parameters
- parameters: GrayCodePattern::Params()