Skip to content

Commit

Permalink
visual preset from 435 depth and 455 color
Browse files Browse the repository at this point in the history
  • Loading branch information
remibettan committed Jan 2, 2025
1 parent 2d561a0 commit 23e1326
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 53 deletions.
4 changes: 3 additions & 1 deletion src/ds/advanced_mode/advanced_mode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,11 @@ namespace librealsense
case ds::RS430I_PID:
case ds::RS435_RGB_PID:
case ds::RS435I_PID:
case ds::RS436I_PID:
default_430(p);
break;
case ds::RS436I_PID:
default_436(p);
break;
case ds::RS455_PID:
case ds::RS457_PID:
case ds::D555_PID:
Expand Down
130 changes: 78 additions & 52 deletions src/ds/advanced_mode/presets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,41 @@ namespace librealsense
p.depth_gain.gain = 16.f;
}

void default_430(preset& p)
void default_430_color_only(preset& p)
{
p.color_control.disableRAUColor = 0;
p.color_control.disableSADColor = 0;
p.color_control.disableSADNormalize = 0;
p.color_control.disableSLOLeftColor = 0;
p.color_control.disableSLORightColor = 0;
p.cc.colorCorrection1 = 0.298828f;
p.cc.colorCorrection2 = 0.293945f;
p.cc.colorCorrection3 = 0.293945f;
p.cc.colorCorrection4 = 0.114258f;
p.cc.colorCorrection5 = 0.f;
p.cc.colorCorrection6 = 0.f;
p.cc.colorCorrection7 = 0.f;
p.cc.colorCorrection8 = 0.f;
p.cc.colorCorrection9 = 0.f;
p.cc.colorCorrection10 = 0.f;
p.cc.colorCorrection11 = 0.f;
p.cc.colorCorrection12 = 0.f;
p.color_auto_exposure.auto_exposure = 1;
p.color_exposure.exposure = 156;
p.color_backlight_compensation.backlight_compensation = 0;
p.color_brightness.brightness = 0;
p.color_contrast.contrast = 50;
p.color_gain.gain = 64;
p.color_gamma.gamma = 300;
p.color_hue.hue = 0;
p.color_power_line_frequency.power_line_frequency = 3;
p.color_saturation.saturation = 64;
p.color_sharpness.sharpness = 50;
p.color_auto_white_balance.auto_white_balance = 1;
p.color_white_balance.white_balance = 4600;
}

void default_430_except_color(preset& p)
{
p.depth_controls.deepSeaMedianThreshold = 500;
p.depth_controls.deepSeaNeighborThreshold = 7;
Expand All @@ -385,11 +419,6 @@ namespace librealsense
p.rsvc.minWEsum = 3;
p.rsvc.uShrink = 3;
p.rsvc.vShrink = 1;
p.color_control.disableRAUColor = 0;
p.color_control.disableSADColor = 0;
p.color_control.disableSADNormalize = 0;
p.color_control.disableSLOLeftColor = 0;
p.color_control.disableSLORightColor = 0;
p.rctc.rauDiffThresholdBlue = 51;
p.rctc.rauDiffThresholdGreen = 51;
p.rctc.rauDiffThresholdRed = 51;
Expand All @@ -404,18 +433,6 @@ namespace librealsense
p.spc.sloK2PenaltyMod2 = 130;
p.hdad.lambdaAD = 800.f;
p.hdad.lambdaCensus = 26.f;
p.cc.colorCorrection1 = 0.298828f;
p.cc.colorCorrection2 = 0.293945f;
p.cc.colorCorrection3 = 0.293945f;
p.cc.colorCorrection4 = 0.114258f;
p.cc.colorCorrection5 = 0.f;
p.cc.colorCorrection6 = 0.f;
p.cc.colorCorrection7 = 0.f;
p.cc.colorCorrection8 = 0.f;
p.cc.colorCorrection9 = 0.f;
p.cc.colorCorrection10 = 0.f;
p.cc.colorCorrection11 = 0.f;
p.cc.colorCorrection12 = 0.f;
p.depth_table.depthClampMax = 65536;
p.depth_table.depthClampMin = 0;
p.depth_table.depthUnits = 1000;
Expand All @@ -427,31 +444,23 @@ namespace librealsense
p.laser_power.laser_power = 150.f;
p.depth_exposure.exposure = 8500.f;
p.depth_auto_exposure.auto_exposure = 1;
p.color_auto_exposure.auto_exposure = 1;
p.color_exposure.exposure = 156;
p.color_backlight_compensation.backlight_compensation = 0;
p.color_brightness.brightness = 0;
p.color_contrast.contrast = 50;
p.color_gain.gain = 64;
p.color_gamma.gamma = 300;
p.color_hue.hue = 0;
p.color_power_line_frequency.power_line_frequency = 3;
p.color_saturation.saturation = 64;
p.color_sharpness.sharpness = 50;
p.color_auto_white_balance.auto_white_balance = 1;
p.color_white_balance.white_balance = 4600;
p.depth_gain.gain = 16.f;
p.hdad.ignoreSAD = 0;
p.amplitude_factor.amplitude = 0.f;
}

void default_430(preset& p)
{
default_430_except_color(p);
default_430_color_only(p);
}
// the only different between high res to mid & low is the amplitude_factor value
void default_450_high_res(preset& p)
{
p.amplitude_factor.amplitude = 0.f;
}

//used as base preset for the D450
void default_450_mid_low_res(preset& p)
void default_450_mid_low_res_except_color(preset& p)
{
p.depth_controls.deepSeaMedianThreshold = 500;
p.depth_controls.deepSeaNeighborThreshold = 7;
Expand All @@ -475,11 +484,6 @@ namespace librealsense
p.rsvc.minWEsum = 3;
p.rsvc.uShrink = 3;
p.rsvc.vShrink = 1;
p.color_control.disableRAUColor = 0;
p.color_control.disableSADColor = 0;
p.color_control.disableSADNormalize = 0;
p.color_control.disableSLOLeftColor = 0;
p.color_control.disableSLORightColor = 0;
p.rctc.rauDiffThresholdBlue = 51;
p.rctc.rauDiffThresholdGreen = 51;
p.rctc.rauDiffThresholdRed = 51;
Expand All @@ -494,6 +498,29 @@ namespace librealsense
p.spc.sloK2PenaltyMod2 = 130;
p.hdad.lambdaAD = 800.f;
p.hdad.lambdaCensus = 26.f;
p.depth_table.depthClampMax = 65536;
p.depth_table.depthClampMin = 0;
p.depth_table.depthUnits = 1000;
p.depth_table.disparityShift = 0;
p.ae.meanIntensitySetPoint = 1000;
p.census.uDiameter = 9;
p.census.vDiameter = 9;
p.laser_state.laser_state = 1;
p.laser_power.laser_power = 150.f;
p.depth_exposure.exposure = 8500.f;
p.depth_auto_exposure.auto_exposure = 1;
p.depth_gain.gain = 16.f;
p.hdad.ignoreSAD = 0;
p.amplitude_factor.amplitude = 0.08f;
}

void default_450_mid_low_res_color_only(preset& p)
{
p.color_control.disableRAUColor = 0;
p.color_control.disableSADColor = 0;
p.color_control.disableSADNormalize = 0;
p.color_control.disableSLOLeftColor = 0;
p.color_control.disableSLORightColor = 0;
p.cc.colorCorrection1 = -0.493164f;
p.cc.colorCorrection2 = 0.831055f;
p.cc.colorCorrection3 = 0.831055f;
Expand All @@ -506,17 +533,6 @@ namespace librealsense
p.cc.colorCorrection10 = -0.272461f;
p.cc.colorCorrection11 = -0.272461f;
p.cc.colorCorrection12 = -0.355469f;
p.depth_table.depthClampMax = 65536;
p.depth_table.depthClampMin = 0;
p.depth_table.depthUnits = 1000;
p.depth_table.disparityShift = 0;
p.ae.meanIntensitySetPoint = 1000;
p.census.uDiameter = 9;
p.census.vDiameter = 9;
p.laser_state.laser_state = 1;
p.laser_power.laser_power = 150.f;
p.depth_exposure.exposure = 8500.f;
p.depth_auto_exposure.auto_exposure = 1;
p.color_auto_exposure.auto_exposure = 1;
p.color_exposure.exposure = 156;
p.color_backlight_compensation.backlight_compensation = 0;
Expand All @@ -530,10 +546,20 @@ namespace librealsense
p.color_sharpness.sharpness = 50;
p.color_auto_white_balance.auto_white_balance = 1;
p.color_white_balance.white_balance = 4600;
p.depth_gain.gain = 16.f;
p.hdad.ignoreSAD = 0;
p.amplitude_factor.amplitude = 0.08f;
}

//used as base preset for the D450
void default_450_mid_low_res(preset& p)
{
default_450_mid_low_res_except_color(p);
default_450_mid_low_res_color_only(p);
}

// D436i has same depth as D435 and same color as D455
void default_436(preset& p)
{
default_430_except_color(p);
default_450_mid_low_res_color_only(p);
}

void high_accuracy(preset& p)
Expand Down
1 change: 1 addition & 0 deletions src/ds/advanced_mode/presets.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ namespace librealsense
void default_410( preset & p );
void default_420( preset & p );
void default_430( preset & p );
void default_436( preset & p );
void default_450_high_res( preset & p );
void default_450_mid_low_res( preset & p );
void high_accuracy( preset & p );
Expand Down

0 comments on commit 23e1326

Please sign in to comment.