You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there any way to set RS2_OPTION_HISTOGRAM_EQUALIZATION_ENABLED or RS2_OPTION_MIN_DISTANCE in C++?
I would like to get a fixed scale of the depth visualisation from the depth frame. I have loaded a preset json file I created in Realsense Viewer and are trying to set the options in the code but it throws a wrong_api_call_sequence_error.
When looking at the settable options querying the sensor it displays the following:
32: Histogram Equalization Enabled is not supported
33: Min Distance is not supported
34: Max Distance is not supported
I can alter other options that are supported like RS2_OPTION_EMITTER_ENABLED for instance.
Below is some code
//Contruct a pipeline which abstracts the device
rs2::pipeline pipe;
//Create a configuration for configuring the pipeline with a non default profile
rs2::config cfg;
//Add desired streams to configuration
cfg.enable_stream(RS2_STREAM_COLOR, 640, 480, RS2_FORMAT_BGR8, 6);
cfg.enable_stream(RS2_STREAM_INFRARED, 640, 480, RS2_FORMAT_Y8, 6);
cfg.enable_stream(RS2_STREAM_DEPTH, 640, 480, RS2_FORMAT_Z16, 6);
rs2::context cxt;
auto device = cxt.query_devices().back();
auto advanced_mode_dev = device.as<rs400::advanced_mode>();
if (device.is<rs400::advanced_mode>())
if (!advanced_mode_dev.is_enabled())
advanced_mode_dev.toggle_advanced_mode(true);
std::ifstream t("D:\\preset.json");
std::string preset_json((std::istreambuf_iterator<char>(t)),
std::istreambuf_iterator<char>());
advanced_mode_dev.load_json(preset_json);
rs2::pipeline_profile pipe_profile = cfg.resolve(pipe);
std::vector<rs2::sensor> sensors = device.query_sensors();
for (rs2::sensor element : sensors) {
std::string module_name = element.get_info(RS2_CAMERA_INFO_NAME);
if ("Stereo Module" == module_name) {
element.set_option(rs2_option::RS2_OPTION_HISTOGRAM_EQUALIZATION_ENABLED, 0.f);
}
get_sensor_option(element);
}
rs2::pipeline_profile profile = pipe.start(cfg);
What I would like to accomplish is a fixed color on the depth map for background subtraction in OpenCV. Maybe there is a better way? When I use the colorizer the intensity of the color scheme changes when a object gets closer to the camera.
The text was updated successfully, but these errors were encountered:
Hi @stekla79
Histogram equalization options are not really part of the sensor, it is all done in software by the colorizer class. As a result, these options are configurable on the colorizer object itself:
At the moment, the viewer is not saving post-processing settings to JSON (since originally the file format was designed to capture only hardware settings). We are planning to extend the Viewer to include these.
Is there any way to set RS2_OPTION_HISTOGRAM_EQUALIZATION_ENABLED or RS2_OPTION_MIN_DISTANCE in C++?
I would like to get a fixed scale of the depth visualisation from the depth frame. I have loaded a preset json file I created in Realsense Viewer and are trying to set the options in the code but it throws a wrong_api_call_sequence_error.
When looking at the settable options querying the sensor it displays the following:
32: Histogram Equalization Enabled is not supported
33: Min Distance is not supported
34: Max Distance is not supported
I can alter other options that are supported like RS2_OPTION_EMITTER_ENABLED for instance.
Below is some code
What I would like to accomplish is a fixed color on the depth map for background subtraction in OpenCV. Maybe there is a better way? When I use the colorizer the intensity of the color scheme changes when a object gets closer to the camera.
The text was updated successfully, but these errors were encountered: