Public Types | Public Member Functions | Public Attributes | List of all members
dai::RawStereoDepthConfig::CensusTransform Struct Reference

#include <RawStereoDepthConfig.hpp>

Public Types

enum  KernelSize : std::int32_t { KernelSize::AUTO = -1, KernelSize::KERNEL_5x5 = 0, KernelSize::KERNEL_7x7, KernelSize::KERNEL_7x9 }
 

Public Member Functions

 DEPTHAI_SERIALIZE (CensusTransform, kernelSize, kernelMask, enableMeanMode, threshold)
 

Public Attributes

bool enableMeanMode = true
 
uint64_t kernelMask = 0
 
KernelSize kernelSize = KernelSize::AUTO
 
uint32_t threshold = 0
 

Detailed Description

The basic cost function used by the Stereo Accelerator for matching the left and right images is the Census Transform. It works on a block of pixels and computes a bit vector which represents the structure of the image in that block. There are two types of Census Transform based on how the middle pixel is used: Classic Approach and Modified Census. The comparisons that are made between pixels can be or not thresholded. In some cases a mask can be applied to filter out only specific bits from the entire bit stream. All these approaches are: Classic Approach: Uses middle pixel to compare against all its neighbors over a defined window. Each comparison results in a new bit, that is 0 if central pixel is smaller, or 1 if is it bigger than its neighbor. Modified Census Transform: same as classic Census Transform, but instead of comparing central pixel with its neighbors, the window mean will be compared with each pixel over the window. Thresholding Census Transform: same as classic Census Transform, but it is not enough that a neighbor pixel to be bigger than the central pixel, it must be significant bigger (based on a threshold). Census Transform with Mask: same as classic Census Transform, but in this case not all of the pixel from the support window are part of the binary descriptor. We use a ma sk “M” to define which pixels are part of the binary descriptor (1), and which pixels should be skipped (0).

Definition at line 405 of file RawStereoDepthConfig.hpp.

Member Enumeration Documentation

◆ KernelSize

Census transform kernel size possible values.

Enumerator
AUTO 
KERNEL_5x5 
KERNEL_7x7 
KERNEL_7x9 

Definition at line 409 of file RawStereoDepthConfig.hpp.

Member Function Documentation

◆ DEPTHAI_SERIALIZE()

dai::RawStereoDepthConfig::CensusTransform::DEPTHAI_SERIALIZE ( CensusTransform  ,
kernelSize  ,
kernelMask  ,
enableMeanMode  ,
threshold   
)

Member Data Documentation

◆ enableMeanMode

bool dai::RawStereoDepthConfig::CensusTransform::enableMeanMode = true

If enabled, each pixel in the window is compared with the mean window value instead of the central pixel.

Definition at line 430 of file RawStereoDepthConfig.hpp.

◆ kernelMask

uint64_t dai::RawStereoDepthConfig::CensusTransform::kernelMask = 0

Census transform mask, default - auto, mask is set based on resolution and kernel size. Disabled for 400p input resolution. Enabled for 720p. 0XA82415 for 5x5 census transform kernel. 0XAA02A8154055 for 7x7 census transform kernel. 0X2AA00AA805540155 for 7x9 census transform kernel. Empirical values.

Definition at line 425 of file RawStereoDepthConfig.hpp.

◆ kernelSize

KernelSize dai::RawStereoDepthConfig::CensusTransform::kernelSize = KernelSize::AUTO

Census transform kernel size.

Definition at line 414 of file RawStereoDepthConfig.hpp.

◆ threshold

uint32_t dai::RawStereoDepthConfig::CensusTransform::threshold = 0

Census transform comparison threshold value.

Definition at line 435 of file RawStereoDepthConfig.hpp.


The documentation for this struct was generated from the following file:


depthai
Author(s): Martin Peterlin
autogenerated on Sat Mar 22 2025 02:58:20