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

This section introduces how to set the roi parameters of an event camera through API interfaces to adapt to custom scenarios.

Introduction to ROI

ROI Parameter Description Default Value Minimum Value Maximum Value Notes
x The top-left X-coordinate of ROI 0 0 1280 This parameter determines the starting position of the ROI region in the horizontal direction.
y The top-left Y-coordinate of ROI 0 0 720 This parameter determines the starting position of the ROI region in the vertical direction.
width Width of ROI 1280 0 1280 Defines the length of the ROI region in the horizontal direction. You must ensure that (x + width) <= 1280 to stay within the image boundary.
height Height of ROI 720 0 720 Defines the length of the ROI region in the vertical direction. Ensure that (y + height) <= 720 to avoid going out of image range.

iamge_roi

ROI API Sample

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> roi_tool = device_->getTool(dvsense::ToolType::TOOL_ROI);

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

int value;
bool ret = roi_tool->setParam("x", 10);
bool ret = roi_tool->getParam("x", value);
bool ret = roi_tool->setParam("y", 10);
bool ret = roi_tool->getParam("y", value);
bool ret = roi_tool->setParam("width", 100);
bool ret = roi_tool->getParam("width", value);
bool ret = roi_tool->setParam("height", 100);
bool ret = roi_tool->getParam("height", value);