## Depth Settings ### Preset Configuration Gemini 330 series 3D cameras have built-in a variety of predefined Presets. For the specific application scenarios of 3D cameras, users can use the Orbbec Viewer tool to select the best Presets. The method of loading the preset is as follows: ```c# Pipeline pipeline = new Pipeline(); Device device = pipeline.GetDevice(); device.LoadPreset("Default"); ``` ### Set Depth AE ```c# Pipeline pipeline = new Pipeline(); Device device = pipeline.GetDevice(); // True open depth AE, False: close depth AE device.SetBoolProperty(PropertyId.OB_PROP_DEPTH_AUTO_EXPOSURE_BOOL, true); ``` ### Set Depth Exposure/Gain ```c# Pipeline pipeline = new Pipeline(); Device device = pipeline.GetDevice(); // Close IR AE device.SetBoolProperty(PropertyId.OB_PROP_DEPTH_AUTO_EXPOSURE_BOOL, false); // set IR exposure device.SetIntProperty(PropertyId.OB_PROP_DEPTH_EXPOSURE_INT, 100); // set IR gain device.SetIntProperty(PropertyId.OB_PROP_DEPTH_GAIN_INT, 64); ``` ### Set Min and Max Depth Set the min and max values of Depth, and all Depth outside this range will be set to 0. * Notes: For the Gemini 330 series, max and min depth values are set through post-processing with the ThresholdFilter, as follows: ```c# // create threshold filter ThresholdFilter filter = new ThresholdFilter(); // set min and max depth,unit: mm filter.SetValueRange(100, 1000); // get depth frame var frames = pipeline.WaitForFrames(100); var depthFrame = frames?.GetDepthFrame(); // call threshold filter var newDepthFrame = filter.Process(depthFrame); ``` ### D2D (Disparity to depth) Disparity to depth is an image processing technique used to convert disparity information into depth information. #### Hardware D2D Hardware D2D refers to disparity-to-depth conversion implemented internally within the device. Devices such as the Gemini 330 series, Gemini 2, Gemini 2 L, Astra 2 support this feature. ```c# Pipeline pipeline = new Pipeline(); Device device = pipeline.GetDevice(); // Parameters: True to turn on hardware D2D, False to turn off hardware D2D device.SetBoolProperty(PropertyId.OB_PROP_DISPARITY_TO_DEPTH_BOOL, true); ``` #### Software D2D Software D2D refers to disparity-to-depth conversion implemented within the SDK. All devices support Software D2D except for TOF devices like Femto Mega and Femto Bolt. ```c# Pipeline pipeline = new Pipeline(); Device device = pipeline.GetDevice(); // Parameters: True to turn on Software D2D, False to turn off Software D2D device.SetBoolProperty(PropertyId.OB_PROP_SDK_DISPARITY_TO_DEPTH_BOOL, true); ``` #### Set the Unit of Depth The precision of depth measurements is determined by the unit of pixel values in the depth data frame. By adjusting the depth unit, the accuracy of depth measurements can be modified. For instance, if the unit is set to 0.2mm, an object at a distance of 1000mm will have a pixel value of 5000 in the output depth data frame (as 5000 multiplied by 0.2mm equals 1000mm). Similarly, if the unit is set to 0.1mm, the pixel value will be 10000. Gemini 2/2L, Astra 2,Gemini 330 series support the setting of Depth units. Gemini 2/2L sets the Depth unit as follows: Among them: DepthPrecisionLevel.OB_PRECISION_1MM: < 1mm DepthPrecisionLevel.OB_PRECISION_0MM8: < 0.8mm DepthPrecisionLevel.OB_PRECISION_0MM4: < 0.4mm DepthPrecisionLevel.OB_PRECISION_0MM1: < 0.1mm DepthPrecisionLevel.OB_PRECISION_0MM2: < 0.2mm DepthPrecisionLevel.OB_PRECISION_0MM5: < 0.5mm DepthPrecisionLevel.OB_PRECISION_0MM05: < 0.05mm ```c# Pipeline pipeline = new Pipeline(); Device device = pipeline.GetDevice(); // Parameters: True to turn on Software D2D, False to turn off Software D2D device.SetIntProperty(PropertyId.OB_PROP_DEPTH_PRECISION_LEVEL_INT, (int)DepthPrecisionLevel.OB_PRECISION_1MM); ``` The Gemini 330 series supports setting the Depth unit as follows: ```c# Pipeline pipeline = new Pipeline(); Device device = pipeline.GetDevice(); // Parameters: True to turn on Software D2D, False to turn off Software D2D device.SetFloatProperty(PropertyId.OB_PROP_DEPTH_UNIT_FLEXIBLE_ADJUSTMENT_FLOAT, 0.1f); ``` * Notes: The Gemini 330 series Depth unit supports setting arbitrary units, with the parameter as a float.