15 #ifndef VISIONTRANSFER_DEVICEPARAMETERS_H 16 #define VISIONTRANSFER_DEVICEPARAMETERS_H 18 #include "visiontransfer/common.h" 19 #include "visiontransfer/deviceinfo.h" 20 #include "visiontransfer/parameterinfo.h" 21 #if VISIONTRANSFER_CPLUSPLUS_VERSION >= 201103L 22 #include "visiontransfer/parameter.h" 23 #include "visiontransfer/parameterset.h" 103 return static_cast<OperationMode>(readIntParameter(
"operation_mode"));
113 writeIntParameter(
"operation_mode", static_cast<int>(mode));
120 return readIntParameter(
"disparity_offset");
129 writeIntParameter(
"disparity_offset", offset);
138 return readIntParameter(
"sgm_p1_edge");
147 writeIntParameter(
"sgm_p1_edge", p1);
154 return readIntParameter(
"sgm_p1_no_edge");
163 writeIntParameter(
"sgm_p1_no_edge", p1);
170 return readIntParameter(
"sgm_p2_edge");
179 writeIntParameter(
"sgm_p2_edge", p2);
186 return readIntParameter(
"sgm_p2_no_edge");
195 writeIntParameter(
"sgm_p2_no_edge", p2);
202 return readIntParameter(
"sgm_edge_sensitivity");
211 writeIntParameter(
"sgm_edge_sensitivity", sensitivity);
219 return readBoolParameter(
"mask_border_pixels_enabled");
227 writeBoolParameter(
"mask_border_pixels_enabled", enabled);
234 return readBoolParameter(
"consistency_check_enabled");
241 writeBoolParameter(
"consistency_check_enabled", enabled);
248 return readIntParameter(
"consistency_check_sensitivity");
257 writeIntParameter(
"consistency_check_sensitivity", sensitivity);
264 return readBoolParameter(
"uniqueness_check_enabled");
271 writeBoolParameter(
"uniqueness_check_enabled", enabled);
278 return readIntParameter(
"uniqueness_check_sensitivity");
287 writeIntParameter(
"uniqueness_check_sensitivity", sensitivity);
294 return readBoolParameter(
"texture_filter_enabled");
301 writeBoolParameter(
"texture_filter_enabled", enabled);
308 return readIntParameter(
"texture_filter_sensitivity");
317 writeIntParameter(
"texture_filter_sensitivity", sensitivity);
324 return readBoolParameter(
"gap_interpolation_enabled");
331 writeBoolParameter(
"gap_interpolation_enabled", enabled);
338 return readBoolParameter(
"noise_reduction_enabled");
345 writeBoolParameter(
"noise_reduction_enabled", enabled);
352 return readIntParameter(
"speckle_filter_iterations");
359 writeIntParameter(
"speckle_filter_iterations", iter);
369 AUTO_EXPOSURE_AND_GAIN = 0,
372 AUTO_EXPOSURE_MANUAL_GAIN = 1,
375 MANUAL_EXPOSORE_AUTO_GAIN = 2,
378 MANUAL_EXPOSURE_MANUAL_GAIN = 3
386 return static_cast<AutoMode>(readIntParameter(
"auto_exposure_mode"));
394 writeIntParameter(
"auto_exposure_mode", static_cast<int>(mode));
405 return readDoubleParameter(
"auto_target_intensity");
416 writeDoubleParameter(
"auto_target_intensity", intensity);
427 return readDoubleParameter(
"auto_intensity_delta");
438 writeDoubleParameter(
"auto_intensity_delta", delta);
461 return static_cast<TargetFrame>(readIntParameter(
"auto_target_frame"));
469 writeIntParameter(
"auto_target_frame", static_cast<int>(target));
480 return readIntParameter(
"auto_skipped_frames");
491 writeIntParameter(
"auto_skipped_frames", skipped);
499 return readDoubleParameter(
"auto_maximum_exposure_time");
507 writeDoubleParameter(
"auto_maximum_exposure_time", time);
515 return readDoubleParameter(
"auto_maximum_gain");
523 writeDoubleParameter(
"auto_maximum_gain", gain);
536 return readDoubleParameter(
"manual_exposure_time");
549 writeDoubleParameter(
"manual_exposure_time", time);
562 return readDoubleParameter(
"manual_gain");
575 writeDoubleParameter(
"manual_gain", gain);
582 return readBoolParameter(
"auto_exposure_roi_enabled");
589 writeBoolParameter(
"auto_exposure_roi_enabled", enabled);
606 x = readIntParameter(
"auto_exposure_roi_x");
607 y = readIntParameter(
"auto_exposure_roi_y");
608 width = readIntParameter(
"auto_exposure_roi_width");
609 height = readIntParameter(
"auto_exposure_roi_height");
626 writeIntParameter(
"auto_exposure_roi_x", x);
627 writeIntParameter(
"auto_exposure_roi_y", y);
628 writeIntParameter(
"auto_exposure_roi_width", width);
629 writeIntParameter(
"auto_exposure_roi_height", height);
641 return readIntParameter(
"max_frame_time_difference_ms");
651 writeIntParameter(
"max_frame_time_difference_ms", diffMs);
659 return readDoubleParameter(
"trigger_frequency");
667 writeDoubleParameter(
"trigger_frequency", freq);
674 return readBoolParameter(
"trigger_0_enabled");
681 writeBoolParameter(
"trigger_0_enabled", enabled);
688 return readBoolParameter(
"trigger_0_constant");
695 writeBoolParameter(
"trigger_0_constant", on);
703 return readBoolParameter(
"trigger_0_polarity");
711 writeBoolParameter(
"trigger_0_polarity", invert);
718 return readBoolParameter(
"trigger_1_enabled");
725 writeBoolParameter(
"trigger_1_enabled", enabled);
732 return readBoolParameter(
"trigger_1_constant");
739 writeBoolParameter(
"trigger_1_constant", on);
747 return readBoolParameter(
"trigger_1_polarity");
755 writeBoolParameter(
"trigger_1_polarity", invert);
767 case 0:
return readDoubleParameter(
"trigger_0_pulse_width");
768 case 1:
return readDoubleParameter(
"trigger_0b_pulse_width");
769 case 2:
return readDoubleParameter(
"trigger_0c_pulse_width");
770 case 3:
return readDoubleParameter(
"trigger_0d_pulse_width");
771 case 4:
return readDoubleParameter(
"trigger_0e_pulse_width");
772 case 5:
return readDoubleParameter(
"trigger_0f_pulse_width");
773 case 6:
return readDoubleParameter(
"trigger_0g_pulse_width");
774 case 7:
return readDoubleParameter(
"trigger_0h_pulse_width");
788 case 0: writeDoubleParameter(
"trigger_0_pulse_width", width);
break;
789 case 1: writeDoubleParameter(
"trigger_0b_pulse_width", width);
break;
790 case 2: writeDoubleParameter(
"trigger_0c_pulse_width", width);
break;
791 case 3: writeDoubleParameter(
"trigger_0d_pulse_width", width);
break;
792 case 4: writeDoubleParameter(
"trigger_0e_pulse_width", width);
break;
793 case 5: writeDoubleParameter(
"trigger_0f_pulse_width", width);
break;
794 case 6: writeDoubleParameter(
"trigger_0g_pulse_width", width);
break;
795 case 7: writeDoubleParameter(
"trigger_0h_pulse_width", width);
break;
809 case 0:
return readDoubleParameter(
"trigger_1_pulse_width");
810 case 1:
return readDoubleParameter(
"trigger_1b_pulse_width");
811 case 2:
return readDoubleParameter(
"trigger_1c_pulse_width");
812 case 3:
return readDoubleParameter(
"trigger_1d_pulse_width");
813 case 4:
return readDoubleParameter(
"trigger_1e_pulse_width");
814 case 5:
return readDoubleParameter(
"trigger_1f_pulse_width");
815 case 6:
return readDoubleParameter(
"trigger_1g_pulse_width");
816 case 7:
return readDoubleParameter(
"trigger_1h_pulse_width");
830 case 0: writeDoubleParameter(
"trigger_1_pulse_width", width);
break;
831 case 1: writeDoubleParameter(
"trigger_1b_pulse_width", width);
break;
832 case 2: writeDoubleParameter(
"trigger_1c_pulse_width", width);
break;
833 case 3: writeDoubleParameter(
"trigger_1d_pulse_width", width);
break;
834 case 4: writeDoubleParameter(
"trigger_1e_pulse_width", width);
break;
835 case 5: writeDoubleParameter(
"trigger_1f_pulse_width", width);
break;
836 case 6: writeDoubleParameter(
"trigger_1g_pulse_width", width);
break;
837 case 7: writeDoubleParameter(
"trigger_1h_pulse_width", width);
break;
847 return readDoubleParameter(
"trigger_1_offset");
855 writeDoubleParameter(
"trigger_1_offset", offset);
887 writeIntParameter(
"trigger_input", static_cast<int>(mode));
896 return readBoolParameter(
"auto_recalibration_enabled");
903 writeBoolParameter(
"auto_recalibration_enabled", enabled);
910 return readBoolParameter(
"auto_recalibration_permanent");
917 writeBoolParameter(
"auto_recalibration_permanent", save);
925 return readBoolParameter(
"subpixel_optimization_roi_enabled");
933 writeBoolParameter(
"subpixel_optimization_roi_enabled", enabled);
950 x = readIntParameter(
"subpixel_optimization_roi_x");
951 y = readIntParameter(
"subpixel_optimization_roi_y");
952 width = readIntParameter(
"subpixel_optimization_roi_width");
953 height = readIntParameter(
"subpixel_optimization_roi_height");
970 writeIntParameter(
"subpixel_optimization_roi_x", x);
971 writeIntParameter(
"subpixel_optimization_roi_y", y);
972 writeIntParameter(
"subpixel_optimization_roi_width", width);
973 writeIntParameter(
"subpixel_optimization_roi_height", height);
980 writeBoolParameterUnguarded(
"reboot",
true);
987 writeBoolParameterUnguarded(
"trigger_now",
true);
998 DEPRECATED(
"Use getParameterSet() instead")
999 std::map<std::string, ParameterInfo> getAllParameters();
1007 template<
typename T>
1008 DEPRECATED(
"Use setParameter() instead")
1009 void setNamedParameter(
const std::string& name, T value);
1014 template<
typename T>
1015 void setParameter(
const std::string& name, T value);
1023 template<
typename T>
1024 DEPRECATED(
"Use getParameter() instead")
1025 T getNamedParameter(
const std::string& name);
1027 #if VISIONTRANSFER_CPLUSPLUS_VERSION >= 201103L 1032 bool hasParameter(
const std::string& name)
const;
1068 void setParameterUpdateCallback(std::function<
void(
const std::string& uid)> callback);
1079 class VT_EXPORT TransactionLock {
1083 TransactionLock(Pimpl* pimpl);
1086 friend class TransactionLock;
1089 std::unique_ptr<TransactionLock> transactionLock();
1099 int readIntParameter(
const char*
id);
1100 double readDoubleParameter(
const char*
id);
1101 bool readBoolParameter(
const char*
id);
1104 void writeIntParameter(
const char*
id,
int value);
1105 void writeDoubleParameter(
const char*
id,
double value);
1106 void writeBoolParameter(
const char*
id,
bool value);
1108 void writeBoolParameterUnguarded(
const char*
id,
bool value);
1112 #ifndef DOXYGEN_SHOULD_SKIP_THIS 1114 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.
TriggerInputMode getTriggerInputMode()
Returns the current trigger input configuration.
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 setTriggerInputMode(TriggerInputMode mode)
Requests to change the trigger input configuration.
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.
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 triggerNow()
Emit a software trigger event to perform a single acquisition. This only has effect when the External...
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.
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.
TriggerInputMode
Trigger input modes supported by Nerian stereo devices.
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.