15 #ifndef VISIONTRANSFER_DEVICEPARAMETERS_H 16 #define VISIONTRANSFER_DEVICEPARAMETERS_H 18 #include "visiontransfer/common.h" 19 #include "visiontransfer/deviceinfo.h" 20 #include "visiontransfer/standardparameterids.h" 21 #include "visiontransfer/parameterinfo.h" 22 #if __cplusplus >= 201103L 23 #include "visiontransfer/parameter.h" 24 #include "visiontransfer/parameterset.h" 97 return static_cast<OperationMode>(readIntParameter(
"operation_mode"));
107 writeIntParameter(
"operation_mode", static_cast<int>(mode));
114 return readIntParameter(
"disparity_offset");
123 writeIntParameter(
"disparity_offset", offset);
132 return readIntParameter(
"sgm_p1_edge");
141 writeIntParameter(
"sgm_p1_edge", p1);
148 return readIntParameter(
"sgm_p1_no_edge");
157 writeIntParameter(
"sgm_p1_no_edge", p1);
164 return readIntParameter(
"sgm_p2_edge");
173 writeIntParameter(
"sgm_p2_edge", p2);
180 return readIntParameter(
"sgm_p2_no_edge");
189 writeIntParameter(
"sgm_p2_no_edge", p2);
196 return readIntParameter(
"sgm_edge_sensitivity");
205 writeIntParameter(
"sgm_edge_sensitivity", sensitivity);
213 return readBoolParameter(
"mask_border_pixels_enabled");
221 writeBoolParameter(
"mask_border_pixels_enabled", enabled);
228 return readBoolParameter(
"consistency_check_enabled");
235 writeBoolParameter(
"consistency_check_enabled", enabled);
242 return readIntParameter(
"consistency_check_sensitivity");
251 writeIntParameter(
"consistency_check_sensitivity", sensitivity);
258 return readBoolParameter(
"uniqueness_check_enabled");
265 writeBoolParameter(
"uniqueness_check_enabled", enabled);
272 return readIntParameter(
"uniqueness_check_sensitivity");
281 writeIntParameter(
"uniqueness_check_sensitivity", sensitivity);
288 return readBoolParameter(
"texture_filter_enabled");
295 writeBoolParameter(
"texture_filter_enabled", enabled);
302 return readIntParameter(
"texture_filter_sensitivity");
311 writeIntParameter(
"texture_filter_sensitivity", sensitivity);
318 return readBoolParameter(
"gap_interpolation_enabled");
325 writeBoolParameter(
"gap_interpolation_enabled", enabled);
332 return readBoolParameter(
"noise_reduction_enabled");
339 writeBoolParameter(
"noise_reduction_enabled", enabled);
346 return readIntParameter(
"speckle_filter_iterations");
353 writeIntParameter(
"speckle_filter_iterations", iter);
363 AUTO_EXPOSURE_AND_GAIN = 0,
366 AUTO_EXPOSURE_MANUAL_GAIN = 1,
369 MANUAL_EXPOSORE_AUTO_GAIN = 2,
372 MANUAL_EXPOSURE_MANUAL_GAIN = 3
380 return static_cast<AutoMode>(readIntParameter(
"auto_exposure_mode"));
388 writeIntParameter(
"auto_exposure_mode", static_cast<int>(mode));
399 return readDoubleParameter(
"auto_target_intensity");
410 writeDoubleParameter(
"auto_target_intensity", intensity);
421 return readDoubleParameter(
"auto_intensity_delta");
432 writeDoubleParameter(
"auto_intensity_delta", delta);
455 return static_cast<TargetFrame>(readIntParameter(
"auto_target_frame"));
463 writeIntParameter(
"auto_target_frame", static_cast<int>(target));
474 return readIntParameter(
"auto_skipped_frames");
485 writeIntParameter(
"auto_skipped_frames", skipped);
493 return readDoubleParameter(
"auto_maximum_exposure_time");
501 writeDoubleParameter(
"auto_maximum_exposure_time", time);
509 return readDoubleParameter(
"auto_maximum_gain");
517 writeDoubleParameter(
"auto_maximum_gain", gain);
530 return readDoubleParameter(
"manual_exposure_time");
543 writeDoubleParameter(
"manual_exposure_time", time);
556 return readDoubleParameter(
"manual_gain");
569 writeDoubleParameter(
"manual_gain", gain);
576 return readBoolParameter(
"auto_exposure_roi_enabled");
583 writeBoolParameter(
"auto_exposure_roi_enabled", enabled);
600 x = readIntParameter(
"auto_exposure_roi_x");
601 y = readIntParameter(
"auto_exposure_roi_y");
602 width = readIntParameter(
"auto_exposure_roi_width");
603 height = readIntParameter(
"auto_exposure_roi_height");
620 writeIntParameter(
"auto_exposure_roi_x", x);
621 writeIntParameter(
"auto_exposure_roi_y", y);
622 writeIntParameter(
"auto_exposure_roi_width", width);
623 writeIntParameter(
"auto_exposure_roi_height", height);
635 return readIntParameter(
"max_frame_time_difference_ms");
645 writeIntParameter(
"max_frame_time_difference_ms", diffMs);
653 return readDoubleParameter(
"trigger_frequency");
661 writeDoubleParameter(
"trigger_frequency", freq);
668 return readBoolParameter(
"trigger_0_enabled");
675 writeBoolParameter(
"trigger_0_enabled", enabled);
682 return readBoolParameter(
"trigger_0_constant");
689 writeBoolParameter(
"trigger_0_constant", on);
697 return readBoolParameter(
"trigger_0_polarity");
705 writeBoolParameter(
"trigger_0_polarity", invert);
712 return readBoolParameter(
"trigger_1_enabled");
719 writeBoolParameter(
"trigger_1_enabled", enabled);
726 return readBoolParameter(
"trigger_1_constant");
733 writeBoolParameter(
"trigger_1_constant", on);
741 return readBoolParameter(
"trigger_1_polarity");
749 writeBoolParameter(
"trigger_1_polarity", invert);
761 case 0:
return readDoubleParameter(
"trigger_0_pulse_width");
762 case 1:
return readDoubleParameter(
"trigger_0b_pulse_width");
763 case 2:
return readDoubleParameter(
"trigger_0c_pulse_width");
764 case 3:
return readDoubleParameter(
"trigger_0d_pulse_width");
765 case 4:
return readDoubleParameter(
"trigger_0e_pulse_width");
766 case 5:
return readDoubleParameter(
"trigger_0f_pulse_width");
767 case 6:
return readDoubleParameter(
"trigger_0g_pulse_width");
768 case 7:
return readDoubleParameter(
"trigger_0h_pulse_width");
782 case 0: writeDoubleParameter(
"trigger_0_pulse_width", width);
break;
783 case 1: writeDoubleParameter(
"trigger_0b_pulse_width", width);
break;
784 case 2: writeDoubleParameter(
"trigger_0c_pulse_width", width);
break;
785 case 3: writeDoubleParameter(
"trigger_0d_pulse_width", width);
break;
786 case 4: writeDoubleParameter(
"trigger_0e_pulse_width", width);
break;
787 case 5: writeDoubleParameter(
"trigger_0f_pulse_width", width);
break;
788 case 6: writeDoubleParameter(
"trigger_0g_pulse_width", width);
break;
789 case 7: writeDoubleParameter(
"trigger_0h_pulse_width", width);
break;
803 case 0:
return readDoubleParameter(
"trigger_1_pulse_width");
804 case 1:
return readDoubleParameter(
"trigger_1b_pulse_width");
805 case 2:
return readDoubleParameter(
"trigger_1c_pulse_width");
806 case 3:
return readDoubleParameter(
"trigger_1d_pulse_width");
807 case 4:
return readDoubleParameter(
"trigger_1e_pulse_width");
808 case 5:
return readDoubleParameter(
"trigger_1f_pulse_width");
809 case 6:
return readDoubleParameter(
"trigger_1g_pulse_width");
810 case 7:
return readDoubleParameter(
"trigger_1h_pulse_width");
824 case 0: writeDoubleParameter(
"trigger_1_pulse_width", width);
break;
825 case 1: writeDoubleParameter(
"trigger_1b_pulse_width", width);
break;
826 case 2: writeDoubleParameter(
"trigger_1c_pulse_width", width);
break;
827 case 3: writeDoubleParameter(
"trigger_1d_pulse_width", width);
break;
828 case 4: writeDoubleParameter(
"trigger_1e_pulse_width", width);
break;
829 case 5: writeDoubleParameter(
"trigger_1f_pulse_width", width);
break;
830 case 6: writeDoubleParameter(
"trigger_1g_pulse_width", width);
break;
831 case 7: writeDoubleParameter(
"trigger_1h_pulse_width", width);
break;
841 return readDoubleParameter(
"trigger_1_offset");
849 writeDoubleParameter(
"trigger_1_offset", offset);
856 return readBoolParameter(
"trigger_input");
863 writeBoolParameter(
"trigger_input", enabled);
873 return readBoolParameter(
"auto_recalibration_enabled");
880 writeBoolParameter(
"auto_recalibration_enabled", enabled);
887 return readBoolParameter(
"auto_recalibration_permanent");
894 writeBoolParameter(
"auto_recalibration_permanent", save);
902 return readBoolParameter(
"subpixel_optimization_roi_enabled");
910 writeBoolParameter(
"subpixel_optimization_roi_enabled", enabled);
927 x = readIntParameter(
"subpixel_optimization_roi_x");
928 y = readIntParameter(
"subpixel_optimization_roi_y");
929 width = readIntParameter(
"subpixel_optimization_roi_width");
930 height = readIntParameter(
"subpixel_optimization_roi_height");
947 writeIntParameter(
"subpixel_optimization_roi_x", x);
948 writeIntParameter(
"subpixel_optimization_roi_y", y);
949 writeIntParameter(
"subpixel_optimization_roi_width", width);
950 writeIntParameter(
"subpixel_optimization_roi_height", height);
957 writeBoolParameter(
"reboot",
true);
968 DEPRECATED(
"Use getParameterSet() instead")
969 std::map<std::string, ParameterInfo> getAllParameters();
978 DEPRECATED(
"Use setParameter() instead")
979 void setNamedParameter(
const std::string& name, T value);
985 void setParameter(
const std::string& name, T value);
994 DEPRECATED(
"Use getParameter() instead")
995 T getNamedParameter(
const std::string& name);
997 #if __cplusplus >= 201103L 1032 int readIntParameter(
const char*
id);
1033 double readDoubleParameter(
const char*
id);
1034 bool readBoolParameter(
const char*
id);
1037 void writeIntParameter(
const char*
id,
int value);
1038 void writeDoubleParameter(
const char*
id,
double value);
1039 void writeBoolParameter(
const char*
id,
bool value);
1043 #ifndef DOXYGEN_SHOULD_SKIP_THIS 1045 DEPRECATED(
"Use DeviceParameters instead.")
void setTrigger0Constant(bool on)
Sets the constant value that is output when trigger 0 is disabled.
void setTrigger1Enabled(bool enabled)
Enables or disables trigger signal 1.
int getAutoSkippedFrames()
Gets the current interval at which the automatic exposure and gain control is run.
bool getTextureFilterEnabled()
Returns true if the texture filter is enabled.
double getTrigger1PulseWidth(int pulse=0)
Gets the pulse width of trigger signal 1.
void setAutoTargetFrame(TargetFrame target)
Selects the target frame for automatic exposure and gain control.
void setMaskBorderPixelsEnabled(bool enabled)
Enables or disables the removal of border pixels from the computed disparity map. ...
void setAutoROI(int x, int y, int width, int height)
Sets the configured ROI for automatic exposure and gain control.
bool getTrigger1Polarity()
Returns false if trigger1 polarity is active-high (non-inverted) and false if polarity is active-low ...
int getConsistencyCheckSensitivity()
Gets the current sensitivity value for the consistency check.
bool getTrigger1Enabled()
Returns true if trigger signal 1 is enabled.
void setAutoMaxExposureTime(double time)
Sets the maximum exposure time that can be selected automatically.
TargetFrame
Possible options for the target frame selection of the automatic exposure and gain control...
double getAutoIntensityDelta()
Gets the minimum intensity change that is required for adjusting the camera settings.
TargetFrame getAutoTargetFrame()
Gets the selected target frame for automatic exposure and gain control.
int getStereoMatchingP2NoEdge()
Gets the SGM penalty P2 for large disparity changes at image edges.
bool getMaskBorderPixelsEnabled()
Returns true if border pixels are removed from the computed disparity map.
int getSpeckleFilterIterations()
Returns true if the speckle filter is enabled.
void setAutoTargetIntensity(double intensity)
Sets the target image intensity of the automatic exposure and gain control.
void setAutoIntensityDelta(double delta)
Sets the minimum intensity change that is required for adjusting the camera settings.
void setAutoROIEnabled(bool enabled)
Enables or disables an ROI for automatic exposure and gain control.
void setDisparityOffset(int offset)
Sets the offset of the evaluated disparity range.
void setTrigger0Polarity(bool invert)
Sets the polarity for trigger0. If invert is false, the polarity is active-high (non-inverted). Otherwise the polarity is active-low (inverted).
double getAutoMaxGain()
Gets the maximum gain that can be selected automatically.
void setTrigger1Polarity(bool invert)
Sets the polarity for trigger1. If invert is false, the polarity is active-high (non-inverted). Otherwise the polarity is active-low (inverted).
OperationMode getOperationMode()
Gets the current operation mode.
void reboot()
Remotely triggers a reboot of the device.
void setConsistencyCheckEnabled(bool enabled)
Enables or disables the consistency check.
void setAutoRecalibrationEnabled(bool enabled)
Enables or disables auto-recalibration.
void setOperationMode(OperationMode mode)
Configures the device to a new operation mode.
void setStereoMatchingEdgeSensitivity(int sensitivity)
Sets the edge sensitivity of the SGM algorithm.
double getTrigger0PulseWidth(int pulse=0)
Gets the pulse width of trigger signal 0.
void setTrigger1Constant(bool on)
Sets the constant value that is output when trigger 1 is disabled.
void setTrigger0Enabled(bool enabled)
Enables or disables trigger signal 0.
void setTrigger0PulseWidth(double width, int pulse=0)
Sets the pulse width of trigger signal 0.
bool getTrigger0Polarity()
Returns false if trigger0 polarity is active-high (non-inverted) and false if polarity is active-low ...
void setSubpixelOptimizationROIEnabled(bool enabled)
Enables or disables an ROI for the subpixel optimization algorithm. (if disabled, complete frames are...
void setGapInterpolationEnabled(bool enabled)
Enables or disables the gap interpolation.
int getStereoMatchingEdgeSensitivity()
Gets the edge sensitivity of the SGM algorithm.
double getAutoMaxExposureTime()
Gets the maximum exposure time that can be selected automatically.
double getTriggerFrequency()
Gets the frequency of the trigger signal.
void getAutoROI(int &x, int &y, int &width, int &height)
Gets the configured ROI for automatic exposure and gain control.
bool getSubpixelOptimizationROIEnabled()
Returns true if an ROI for the subpixel optimization algorithm is enabled (otherwise complete frames ...
bool getAutoROIEnabled()
Returns true if an ROI for automatic exposure and gain control is enabled.
void setConsistencyCheckSensitivity(int sensitivity)
Sets a new sensitivity value for the consistency check.
double getTrigger1Offset()
Gets the time offset between trigger signal 1 and signal 0.
bool getUniquenessCheckEnabled()
Returns true if the consistency check is enabled.
bool getInput()
Returns true if the extgernal trigger input is enabled.
void setTriggerFrequency(double freq)
Sets the frequency of the trigger signal.
double getManualGain()
Gets the manually selected gain.
void setSpeckleFilterIterations(int iter)
Enables or disables the speckle filter.
void setSubpixelOptimizationROI(int x, int y, int width, int height)
Sets the configured ROI for the subpixel optimization algorithm.
void setStereoMatchingP1Edge(int p1)
Sets the SGM penalty P1 for small disparity changes at image edges.
void getSubpixelOptimizationROI(int &x, int &y, int &width, int &height)
Gets the configured ROI for the subpixel optimization algorithm.
double getAutoTargetIntensity()
Gets the target image intensity of the automatic exposure and gain control.
void setStereoMatchingP2Edge(int p2)
Sets the SGM penalty P2 for large disparity changes at image edges.
int getMaxFrameTimeDifference()
Gets the maximum allowed time difference between two corresponding frames.
void setTextureFilterSensitivity(int sensitivity)
Sets a new sensitivity value for the texture filter.
int getUniquenessCheckSensitivity()
Gets the current sensitivity value for the uniqueness check.
bool getTrigger0Constant()
Returns the constant value that is output when trigger 0 is disabled.
void setNoiseReductionEnabled(bool enabled)
Enables or disables the noise reduction filter.
Aggregates information about a discovered device.
Allows for configuration of the parameters of a Nerian stereo device through a network connection...
int getTextureFilterSensitivity()
Gets the current sensitivity value for the texture filter.
void setStereoMatchingP2NoEdge(int p2)
Sets the SGM penalty P2 for large disparity changes at image edges.
void setTrigger1PulseWidth(double width, int pulse=0)
Sets the pulse width of trigger signal 1.
void setTrigger1Offset(bool enabled)
Enables or disables the external trigger input.
bool getAutoRecalibrationEnabled()
Returns true if auto re-calibration is enabled.
void setAutoSkippedFrames(int skipped)
Sets the current interval at which the automatic exposure and gain control is run.
void setSaveAutoRecalibration(bool save)
Enables or disables persistent storage of auto re-calibration results.
int getStereoMatchingP1NoEdge()
Gets the SGM penalty P1 for small disparity changes outside image edges.
void setManualExposureTime(double time)
Sets the manually selected exposure time.
int getStereoMatchingP2Edge()
Gets the SGM penalty P2 for large disparity changes at image edges.
int getStereoMatchingP1Edge()
Gets the SGM penalty P1 for small disparity changes at image edges.
void setUniquenessCheckEnabled(bool enabled)
Enables or disables the uniqueness check.
int getDisparityOffset()
Gets the current offset of the evaluated disparity range.
void setUniquenessCheckSensitivity(int sensitivity)
Sets a new sensitivity value for the uniqueness check.
AutoMode getAutoMode()
Gets the current mode of the automatic exposure and gain control.
void setTrigger1Offset(double offset)
Sets the time offset between trigger signal 1 and signal 0.
bool getSaveAutoRecalibration()
Returns true if persistent storage of auto re-calibration results is enabled.
void setAutoMaxGain(double gain)
Gets the maximum gain that can be selected automatically.
void setTextureFilterEnabled(bool enabled)
Enables or disables the texture filter.
double getManualExposureTime()
Gets the manually selected exposure time.
bool getTrigger1Constant()
Returns the constant value that is output when trigger 1 is disabled.
bool getConsistencyCheckEnabled()
Returns true if the consistency check is enabled.
bool getTrigger0Enabled()
Returns true if trigger signal 0 is enabled.
void setStereoMatchingP1NoEdge(int p1)
Sets the SGM penalty P1 for small disparity changes outside image edges.
AutoMode
Possible modes of the automatic exposure and gain control.
bool getNoiseReductionEnabled()
Returns true if the noise reduction filter is enabled.
void setMaxFrameTimeDifference(int diffMs)
Sets the maximum allowed time difference between two corresponding frames.
bool getGapInterpolationEnabled()
Returns true if the texture gap interpolation is enabled.
void setAutoMode(AutoMode mode)
Sets the current mode of the automatic exposure and gain control.
void setManualGain(double gain)
Sets the manually selected gain.
OperationMode
Operation modes supported by Nerian stereo devices.