DvsenseDriver  1.0.3
The SDK for dvsense products.
Loading...
Searching...
No Matches
Bias Configuration Usage Tutorial

This section introduces how to set the bias parameters of an event camera through API interfaces to adapt to custom scenarios (such as higher speed, darker backgrounds, or higher contrast, etc.).

Introduction to Bias

All biases are represented as positive or negative numbers, serving as relative offsets around the default value. The default bias is always 0.

Bias Name Description Default Value Minimum Value Maximum Value Notes
bias_diff_on The contrast threshold is set by bias_diff_on. To increase the contrast threshold, increase bias_diff_on. 0 -85 140 Warning: Adjusting this parameter will change the number of events, especially lowering the contrast threshold, which can increase the number of events and may lead to system memory accumulation or delays.
bias_diff_off The contrast threshold is set by bias_diff_off. To increase the contrast threshold, increase bias_diff_off. 0 -35 190 Warning: Adjusting this parameter will change the number of events, especially lowering the contrast threshold, which can increase the number of events and may lead to system memory accumulation or delays.
bias_fo Increase bias_fo to widen the bandwidth. 0 -35 55
bias_hpf Decrease bias_hpf to lower the sensor's cutoff frequency, allowing it to detect lower-frequency signals, making the sensor more sensitive to slower light changes. 0 0 120
bias_refr Increase bias_refr to decrease the refractory period after each event, enabling the sensor to recover faster and respond to new events. 0 -20 235

Bias API Sample

Obtaining a Bias Handle

Use the dvsense::DvsCamera::getTool API interface in the DvsCamera class to obtain a configuration object related to bias settings:

#include "DvsenseDriver/camera/DvsCamera.hpp"
std::shared_ptr<dvsense::CameraTool> bias = device_->getTool(dvsense::ToolType::TOOL_BIAS);

After obtaining the bias operation pointer, you can configure the parameters according to the information provided in Introduction to Bias. Here’s an example:

int value;
bool ret = bias->getParam("bias_diff_on", value);
bool ret = bias->setParam("bias_diff_on", 10);

Retrieving Parameter Information

const std::vector<BasicParameterInfo> param_info = bias->getAllParamInfo();

The retrieved parameter information type is dvsense::BasicParameterInfo, which includes basic parameter information such as the parameter name, description, and type.

Defining Specific Parameter Types Based on Basic Parameter Information

Refer to dvsense.ToolParameterType for parameter types. Below is an example for dvsense::ToolParameterType::INT:

if(info.type == dvsense::ToolParameterType::INT)
{
bool ret = bias->getParamInfo(info.name, int_info);
}
The detailed information of the integer parameter.
Definition ToolInfo.h:96

Reading and Setting Parameters

Use dvsense::CameraTool::getParam and dvsense::CameraTool::setParam to read from and set specific parameters:

int value;
bool ret = bias->getParam(int_info.name, value);
bool ret = bias->setParam(int_info.name, value);