Struct opencv::structured_light::GrayCodePattern
source · pub struct GrayCodePattern { /* private fields */ }
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.
Implementations§
source§impl GrayCodePattern
impl GrayCodePattern
sourcepub fn create(
parameters: &impl GrayCodePattern_ParamsTraitConst
) -> Result<Ptr<GrayCodePattern>>
pub fn create( parameters: &impl GrayCodePattern_ParamsTraitConst ) -> Result<Ptr<GrayCodePattern>>
sourcepub fn create_def() -> Result<Ptr<GrayCodePattern>>
pub fn create_def() -> Result<Ptr<GrayCodePattern>>
Constructor
§Parameters
- parameters: GrayCodePattern parameters GrayCodePattern::Params: the width and the height of the projector.
§Note
This alternative version of GrayCodePattern::create function uses the following default values for its arguments:
- parameters: GrayCodePattern::Params()
pub fn create_1(width: i32, height: i32) -> Result<Ptr<GrayCodePattern>>
Trait Implementations§
source§impl AlgorithmTrait for GrayCodePattern
impl AlgorithmTrait for GrayCodePattern
source§impl AlgorithmTraitConst for GrayCodePattern
impl AlgorithmTraitConst for GrayCodePattern
fn as_raw_Algorithm(&self) -> *const c_void
source§fn write(&self, fs: &mut impl FileStorageTrait) -> Result<()>
fn write(&self, fs: &mut impl FileStorageTrait) -> Result<()>
source§fn write_1(&self, fs: &mut impl FileStorageTrait, name: &str) -> Result<()>
fn write_1(&self, fs: &mut impl FileStorageTrait, name: &str) -> Result<()>
source§fn write_with_name(&self, fs: &Ptr<FileStorage>, name: &str) -> Result<()>
fn write_with_name(&self, fs: &Ptr<FileStorage>, name: &str) -> Result<()>
source§fn write_with_name_def(&self, fs: &Ptr<FileStorage>) -> Result<()>
fn write_with_name_def(&self, fs: &Ptr<FileStorage>) -> Result<()>
§Note
source§fn empty(&self) -> Result<bool>
fn empty(&self) -> Result<bool>
source§fn save(&self, filename: &str) -> Result<()>
fn save(&self, filename: &str) -> Result<()>
source§fn get_default_name(&self) -> Result<String>
fn get_default_name(&self) -> Result<String>
source§impl Boxed for GrayCodePattern
impl Boxed for GrayCodePattern
source§unsafe fn from_raw(
ptr: <GrayCodePattern as OpenCVFromExtern>::ExternReceive
) -> Self
unsafe fn from_raw( ptr: <GrayCodePattern as OpenCVFromExtern>::ExternReceive ) -> Self
source§fn into_raw(
self
) -> <GrayCodePattern as OpenCVTypeExternContainer>::ExternSendMut
fn into_raw( self ) -> <GrayCodePattern as OpenCVTypeExternContainer>::ExternSendMut
source§fn as_raw(&self) -> <GrayCodePattern as OpenCVTypeExternContainer>::ExternSend
fn as_raw(&self) -> <GrayCodePattern as OpenCVTypeExternContainer>::ExternSend
source§fn as_raw_mut(
&mut self
) -> <GrayCodePattern as OpenCVTypeExternContainer>::ExternSendMut
fn as_raw_mut( &mut self ) -> <GrayCodePattern as OpenCVTypeExternContainer>::ExternSendMut
source§impl Debug for GrayCodePattern
impl Debug for GrayCodePattern
source§impl Drop for GrayCodePattern
impl Drop for GrayCodePattern
source§impl From<GrayCodePattern> for Algorithm
impl From<GrayCodePattern> for Algorithm
source§fn from(s: GrayCodePattern) -> Self
fn from(s: GrayCodePattern) -> Self
source§impl From<GrayCodePattern> for StructuredLightPattern
impl From<GrayCodePattern> for StructuredLightPattern
source§fn from(s: GrayCodePattern) -> Self
fn from(s: GrayCodePattern) -> Self
source§impl GrayCodePatternTrait for GrayCodePattern
impl GrayCodePatternTrait for GrayCodePattern
source§impl GrayCodePatternTraitConst for GrayCodePattern
impl GrayCodePatternTraitConst for GrayCodePattern
fn as_raw_GrayCodePattern(&self) -> *const c_void
source§fn get_number_of_pattern_images(&self) -> Result<size_t>
fn get_number_of_pattern_images(&self) -> Result<size_t>
source§fn 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<()>
source§fn 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>
source§impl StructuredLightPatternTraitConst for GrayCodePattern
impl StructuredLightPatternTraitConst for GrayCodePattern
fn as_raw_StructuredLightPattern(&self) -> *const c_void
source§fn decode(
&self,
pattern_images: &Vector<Vector<Mat>>,
disparity_map: &mut impl ToOutputArray,
black_images: &impl ToInputArray,
white_images: &impl ToInputArray,
flags: i32
) -> Result<bool>
fn decode( &self, pattern_images: &Vector<Vector<Mat>>, disparity_map: &mut impl ToOutputArray, black_images: &impl ToInputArray, white_images: &impl ToInputArray, flags: i32 ) -> Result<bool>
source§fn decode_def(
&self,
pattern_images: &Vector<Vector<Mat>>,
disparity_map: &mut impl ToOutputArray
) -> Result<bool>
fn decode_def( &self, pattern_images: &Vector<Vector<Mat>>, disparity_map: &mut impl ToOutputArray ) -> Result<bool>
impl Send for GrayCodePattern
Auto Trait Implementations§
impl Freeze for GrayCodePattern
impl RefUnwindSafe for GrayCodePattern
impl !Sync for GrayCodePattern
impl Unpin for GrayCodePattern
impl UnwindSafe for GrayCodePattern
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
source§unsafe fn modify_inplace<Res>(
&mut self,
f: impl FnOnce(&Mat, &mut Mat) -> Res
) -> Res
unsafe fn modify_inplace<Res>( &mut self, f: impl FnOnce(&Mat, &mut Mat) -> Res ) -> Res
Mat
or another similar object. By passing
a mutable reference to the Mat
to this function your closure will get called with the read reference and a write references
to the same Mat
. This is of course unsafe as it breaks the Rust aliasing rules, but it might be useful for some performance
sensitive operations. One example of an OpenCV function that allows such in-place modification is imgproc::threshold
. Read more