pyrs_advanced_mode.cpp
Go to the documentation of this file.
1 /* License: Apache 2.0. See LICENSE file in root directory.
2 Copyright(c) 2017 Intel Corporation. All Rights Reserved. */
3 
4 #include "python.hpp"
5 #include "../include/librealsense2/rs_advanced_mode.hpp"
6 #include "../include/librealsense2/hpp/rs_serializable_device.hpp"
7 
8 void init_advanced_mode(py::module &m) {
10  py::class_<STDepthControlGroup> _STDepthControlGroup(m, "STDepthControlGroup");
11  _STDepthControlGroup.def(py::init<>())
12  .def_readwrite("plusIncrement", &STDepthControlGroup::plusIncrement)
13  .def_readwrite("minusDecrement", &STDepthControlGroup::minusDecrement)
14  .def_readwrite("deepSeaMedianThreshold", &STDepthControlGroup::deepSeaMedianThreshold)
15  .def_readwrite("scoreThreshA", &STDepthControlGroup::scoreThreshA)
16  .def_readwrite("scoreThreshB", &STDepthControlGroup::scoreThreshB)
17  .def_readwrite("textureDifferenceThreshold", &STDepthControlGroup::textureDifferenceThreshold)
18  .def_readwrite("textureCountThreshold", &STDepthControlGroup::textureCountThreshold)
19  .def_readwrite("deepSeaSecondPeakThreshold", &STDepthControlGroup::deepSeaSecondPeakThreshold)
20  .def_readwrite("deepSeaNeighborThreshold", &STDepthControlGroup::deepSeaNeighborThreshold)
21  .def_readwrite("lrAgreeThreshold", &STDepthControlGroup::lrAgreeThreshold)
22  .def("__repr__", [](const STDepthControlGroup &e) {
23  std::stringstream ss;
24  ss << "minusDecrement: " << e.minusDecrement << ", ";
25  ss << "deepSeaMedianThreshold: " << e.deepSeaMedianThreshold << ", ";
26  ss << "scoreThreshA: " << e.scoreThreshA << ", ";
27  ss << "scoreThreshB: " << e.scoreThreshB << ", ";
28  ss << "textureDifferenceThreshold: " << e.textureDifferenceThreshold << ", ";
29  ss << "textureCountThreshold: " << e.textureCountThreshold << ", ";
30  ss << "deepSeaSecondPeakThreshold: " << e.deepSeaSecondPeakThreshold << ", ";
31  ss << "deepSeaNeighborThreshold: " << e.deepSeaNeighborThreshold << ", ";
32  ss << "lrAgreeThreshold: " << e.lrAgreeThreshold;
33  return ss.str();
34  });
35 
36  py::class_<STRsm> _STRsm(m, "STRsm");
37  _STRsm.def(py::init<>())
38  .def_readwrite("rsmBypass", &STRsm::rsmBypass)
39  .def_readwrite("diffThresh", &STRsm::diffThresh)
40  .def_readwrite("sloRauDiffThresh", &STRsm::sloRauDiffThresh)
41  .def_readwrite("removeThresh", &STRsm::removeThresh)
42  .def("__repr__", [](const STRsm &e) {
43  std::stringstream ss;
44  ss << "rsmBypass: " << e.rsmBypass << ", ";
45  ss << "diffThresh: " << e.diffThresh << ", ";
46  ss << "sloRauDiffThresh: " << e.sloRauDiffThresh << ", ";
47  ss << "removeThresh: " << e.removeThresh;
48  return ss.str();
49  });
50 
51  py::class_<STRauSupportVectorControl> _STRauSupportVectorControl(m, "STRauSupportVectorControl");
52  _STRauSupportVectorControl.def(py::init<>())
53  .def_readwrite("minWest", &STRauSupportVectorControl::minWest)
54  .def_readwrite("minEast", &STRauSupportVectorControl::minEast)
55  .def_readwrite("minWEsum", &STRauSupportVectorControl::minWEsum)
56  .def_readwrite("minNorth", &STRauSupportVectorControl::minNorth)
57  .def_readwrite("minSouth", &STRauSupportVectorControl::minSouth)
58  .def_readwrite("minNSsum", &STRauSupportVectorControl::minNSsum)
59  .def_readwrite("uShrink", &STRauSupportVectorControl::uShrink)
60  .def_readwrite("vShrink", &STRauSupportVectorControl::vShrink)
61  .def("__repr__", [](const STRauSupportVectorControl &e) {
62  std::stringstream ss;
63  ss << "minWest: " << e.minWest << ", ";
64  ss << "minEast: " << e.minEast << ", ";
65  ss << "minWEsum: " << e.minWEsum << ", ";
66  ss << "minNorth: " << e.minNorth << ", ";
67  ss << "minSouth: " << e.minSouth << ", ";
68  ss << "minNSsum: " << e.minNSsum << ", ";
69  ss << "uShrink: " << e.uShrink << ", ";
70  ss << "vShrink: " << e.vShrink;
71  return ss.str();
72  });
73 
74  py::class_<STColorControl> _STColorControl(m, "STColorControl");
75  _STColorControl.def(py::init<>())
76  .def_readwrite("disableSADColor", &STColorControl::disableSADColor)
77  .def_readwrite("disableRAUColor", &STColorControl::disableRAUColor)
78  .def_readwrite("disableSLORightColor", &STColorControl::disableSLORightColor)
79  .def_readwrite("disableSLOLeftColor", &STColorControl::disableSLOLeftColor)
80  .def_readwrite("disableSADNormalize", &STColorControl::disableSADNormalize)
81  .def("__repr__", [](const STColorControl &e) {
82  std::stringstream ss;
83  ss << "disableSADColor: " << e.disableSADColor << ", ";
84  ss << "disableRAUColor: " << e.disableRAUColor << ", ";
85  ss << "disableSLORightColor: " << e.disableSLORightColor << ", ";
86  ss << "disableSLOLeftColor: " << e.disableSLOLeftColor << ", ";
87  ss << "disableSADNormalize: " << e.disableSADNormalize;
88  return ss.str();
89  });
90 
91  py::class_<STRauColorThresholdsControl> _STRauColorThresholdsControl(m, "STRauColorThresholdsControl");
92  _STRauColorThresholdsControl.def(py::init<>())
93  .def_readwrite("rauDiffThresholdRed", &STRauColorThresholdsControl::rauDiffThresholdRed)
94  .def_readwrite("rauDiffThresholdGreen", &STRauColorThresholdsControl::rauDiffThresholdGreen)
95  .def_readwrite("rauDiffThresholdBlue", &STRauColorThresholdsControl::rauDiffThresholdBlue)
96  .def("__repr__", [](const STRauColorThresholdsControl &e) {
97  std::stringstream ss;
98  ss << "rauDiffThresholdRed: " << e.rauDiffThresholdRed << ", ";
99  ss << "rauDiffThresholdGreen: " << e.rauDiffThresholdGreen << ", ";
100  ss << "rauDiffThresholdBlue: " << e.rauDiffThresholdBlue;
101  return ss.str();
102  });
103 
104  py::class_<STSloColorThresholdsControl> _STSloColorThresholdsControl(m, "STSloColorThresholdsControl");
105  _STSloColorThresholdsControl.def(py::init<>())
106  .def_readwrite("diffThresholdRed", &STSloColorThresholdsControl::diffThresholdRed)
107  .def_readwrite("diffThresholdGreen", &STSloColorThresholdsControl::diffThresholdGreen)
108  .def_readwrite("diffThresholdBlue", &STSloColorThresholdsControl::diffThresholdBlue)
109  .def("__repr__", [](const STSloColorThresholdsControl &e) {
110  std::stringstream ss;
111  ss << "diffThresholdRed: " << e.diffThresholdRed << ", ";
112  ss << "diffThresholdGreen: " << e.diffThresholdGreen << ", ";
113  ss << "diffThresholdBlue: " << e.diffThresholdBlue;
114  return ss.str();
115  });
116  py::class_<STSloPenaltyControl> _STSloPenaltyControl(m, "STSloPenaltyControl");
117  _STSloPenaltyControl.def(py::init<>())
118  .def_readwrite("sloK1Penalty", &STSloPenaltyControl::sloK1Penalty)
119  .def_readwrite("sloK2Penalty", &STSloPenaltyControl::sloK2Penalty)
120  .def_readwrite("sloK1PenaltyMod1", &STSloPenaltyControl::sloK1PenaltyMod1)
121  .def_readwrite("sloK2PenaltyMod1", &STSloPenaltyControl::sloK2PenaltyMod1)
122  .def_readwrite("sloK1PenaltyMod2", &STSloPenaltyControl::sloK1PenaltyMod2)
123  .def_readwrite("sloK2PenaltyMod2", &STSloPenaltyControl::sloK2PenaltyMod2)
124  .def("__repr__", [](const STSloPenaltyControl &e) {
125  std::stringstream ss;
126  ss << "sloK1Penalty: " << e.sloK1Penalty << ", ";
127  ss << "sloK2Penalty: " << e.sloK2Penalty << ", ";
128  ss << "sloK1PenaltyMod1: " << e.sloK1PenaltyMod1 << ", ";
129  ss << "sloK2PenaltyMod1: " << e.sloK2PenaltyMod1 << ", ";
130  ss << "sloK1PenaltyMod2: " << e.sloK1PenaltyMod2 << ", ";
131  ss << "sloK2PenaltyMod2: " << e.sloK2PenaltyMod2;
132  return ss.str();
133  });
134  py::class_<STHdad> _STHdad(m, "STHdad");
135  _STHdad.def(py::init<>())
136  .def_readwrite("lambdaCensus", &STHdad::lambdaCensus)
137  .def_readwrite("lambdaAD", &STHdad::lambdaAD)
138  .def_readwrite("ignoreSAD", &STHdad::ignoreSAD)
139  .def("__repr__", [](const STHdad &e) {
140  std::stringstream ss;
141  ss << "lambdaCensus: " << e.lambdaCensus << ", ";
142  ss << "lambdaAD: " << e.lambdaAD << ", ";
143  ss << "ignoreSAD: " << e.ignoreSAD;
144  return ss.str();
145  });
146 
147  py::class_<STColorCorrection> _STColorCorrection(m, "STColorCorrection");
148  _STColorCorrection.def(py::init<>())
149  .def_readwrite("colorCorrection1", &STColorCorrection::colorCorrection1)
150  .def_readwrite("colorCorrection2", &STColorCorrection::colorCorrection2)
151  .def_readwrite("colorCorrection3", &STColorCorrection::colorCorrection3)
152  .def_readwrite("colorCorrection4", &STColorCorrection::colorCorrection4)
153  .def_readwrite("colorCorrection5", &STColorCorrection::colorCorrection5)
154  .def_readwrite("colorCorrection6", &STColorCorrection::colorCorrection6)
155  .def_readwrite("colorCorrection7", &STColorCorrection::colorCorrection7)
156  .def_readwrite("colorCorrection8", &STColorCorrection::colorCorrection8)
157  .def_readwrite("colorCorrection9", &STColorCorrection::colorCorrection9)
158  .def_readwrite("colorCorrection10", &STColorCorrection::colorCorrection10)
159  .def_readwrite("colorCorrection11", &STColorCorrection::colorCorrection11)
160  .def_readwrite("colorCorrection12", &STColorCorrection::colorCorrection12)
161  .def("__repr__", [](const STColorCorrection &e) {
162  std::stringstream ss;
163  ss << "colorCorrection1: " << e.colorCorrection1 << ", ";
164  ss << "colorCorrection2: " << e.colorCorrection2 << ", ";
165  ss << "colorCorrection3: " << e.colorCorrection3 << ", ";
166  ss << "colorCorrection4: " << e.colorCorrection4 << ", ";
167  ss << "colorCorrection5: " << e.colorCorrection5 << ", ";
168  ss << "colorCorrection6: " << e.colorCorrection6 << ", ";
169  ss << "colorCorrection7: " << e.colorCorrection7 << ", ";
170  ss << "colorCorrection8: " << e.colorCorrection8 << ", ";
171  ss << "colorCorrection9: " << e.colorCorrection9 << ", ";
172  ss << "colorCorrection10: " << e.colorCorrection10 << ", ";
173  ss << "colorCorrection11: " << e.colorCorrection11 << ", ";
174  ss << "colorCorrection12: " << e.colorCorrection12;
175  return ss.str();
176  });
177 
178  py::class_<STAEControl> _STAEControl(m, "STAEControl");
179  _STAEControl.def(py::init<>())
180  .def_readwrite("meanIntensitySetPoint", &STAEControl::meanIntensitySetPoint)
181  .def("__repr__", [](const STAEControl &e) {
182  std::stringstream ss;
183  ss << "Mean Intensity Set Point: " << e.meanIntensitySetPoint;
184  return ss.str();
185  });
186 
187  py::class_<STDepthTableControl> _STDepthTableControl(m, "STDepthTableControl");
188  _STDepthTableControl.def(py::init<>())
189  .def_readwrite("depthUnits", &STDepthTableControl::depthUnits)
190  .def_readwrite("depthClampMin", &STDepthTableControl::depthClampMin)
191  .def_readwrite("depthClampMax", &STDepthTableControl::depthClampMax)
192  .def_readwrite("disparityMode", &STDepthTableControl::disparityMode)
193  .def_readwrite("disparityShift", &STDepthTableControl::disparityShift)
194  .def("__repr__", [](const STDepthTableControl &e) {
195  std::stringstream ss;
196  ss << "depthUnits: " << e.depthUnits << ", ";
197  ss << "depthClampMin: " << e.depthClampMin << ", ";
198  ss << "depthClampMax: " << e.depthClampMax << ", ";
199  ss << "disparityMode: " << e.disparityMode << ", ";
200  ss << "disparityShift: " << e.disparityShift;
201  return ss.str();
202  });
203 
204  py::class_<STCensusRadius> _STCensusRadius(m, "STCensusRadius");
205  _STCensusRadius.def(py::init<>())
206  .def_readwrite("uDiameter", &STCensusRadius::uDiameter)
207  .def_readwrite("vDiameter", &STCensusRadius::vDiameter)
208  .def("__repr__", [](const STCensusRadius &e) {
209  std::stringstream ss;
210  ss << "uDiameter: " << e.uDiameter << ", ";
211  ss << "vDiameter: " << e.vDiameter;
212  return ss.str();
213  });
214 
215  py::class_<STAFactor> _STAFactor(m, "STAFactor");
216  _STAFactor.def(py::init<>())
217  .def_readwrite("a_factor", &STAFactor::amplitude)
218  .def("__repr__", [](const STAFactor &e) {
219  std::stringstream ss;
220  ss << "a_factor: " << e.amplitude;
221  return ss.str();
222  });
223 
224  py::class_<rs400::advanced_mode> rs400_advanced_mode(m, "rs400_advanced_mode");
225  rs400_advanced_mode.def(py::init<rs2::device>(), "device"_a)
226  .def("toggle_advanced_mode", &rs400::advanced_mode::toggle_advanced_mode, "enable"_a)
227  .def("is_enabled", &rs400::advanced_mode::is_enabled)
228  .def("set_depth_control", &rs400::advanced_mode::set_depth_control, "group"_a) //STDepthControlGroup
229  .def("get_depth_control", &rs400::advanced_mode::get_depth_control, "mode"_a = 0)
230  .def("set_rsm", &rs400::advanced_mode::set_rsm, "group") //STRsm
231  .def("get_rsm", &rs400::advanced_mode::get_rsm, "mode"_a = 0)
232  .def("set_rau_support_vector_control", &rs400::advanced_mode::set_rau_support_vector_control, "group"_a)//STRauSupportVectorControl
233  .def("get_rau_support_vector_control", &rs400::advanced_mode::get_rau_support_vector_control, "mode"_a = 0)
234  .def("set_color_control", &rs400::advanced_mode::set_color_control, "group"_a) //STColorControl
235  .def("get_color_control", &rs400::advanced_mode::get_color_control, "mode"_a = 0)//STColorControl
236  .def("set_rau_thresholds_control", &rs400::advanced_mode::set_rau_thresholds_control, "group"_a)//STRauColorThresholdsControl
237  .def("get_rau_thresholds_control", &rs400::advanced_mode::get_rau_thresholds_control, "mode"_a = 0)
238  .def("set_slo_color_thresholds_control", &rs400::advanced_mode::set_slo_color_thresholds_control, "group"_a)//STSloColorThresholdsControl
239  .def("get_slo_color_thresholds_control", &rs400::advanced_mode::get_slo_color_thresholds_control, "mode"_a = 0)//STSloColorThresholdsControl
240  .def("set_slo_penalty_control", &rs400::advanced_mode::set_slo_penalty_control, "group"_a) //STSloPenaltyControl
241  .def("get_slo_penalty_control", &rs400::advanced_mode::get_slo_penalty_control, "mode"_a = 0)//STSloPenaltyControl
242  .def("set_hdad", &rs400::advanced_mode::set_hdad, "group"_a) //STHdad
243  .def("get_hdad", &rs400::advanced_mode::get_hdad, "mode"_a = 0)
244  .def("set_color_correction", &rs400::advanced_mode::set_color_correction, "group"_a)
245  .def("get_color_correction", &rs400::advanced_mode::get_color_correction, "mode"_a = 0) //STColorCorrection
246  .def("set_depth_table", &rs400::advanced_mode::set_depth_table, "group"_a)
247  .def("get_depth_table", &rs400::advanced_mode::get_depth_table, "mode"_a = 0) //STDepthTableControl
248  .def("set_ae_control", &rs400::advanced_mode::set_ae_control, "group"_a)
249  .def("get_ae_control", &rs400::advanced_mode::get_ae_control, "mode"_a = 0) //STAEControl
250  .def("set_census", &rs400::advanced_mode::set_census, "group"_a) //STCensusRadius
251  .def("get_census", &rs400::advanced_mode::get_census, "mode"_a = 0) //STCensusRadius
252  .def("set_amp_factor", &rs400::advanced_mode::set_amp_factor, "group"_a) //STAFactor
253  .def("get_amp_factor", &rs400::advanced_mode::get_amp_factor, "mode"_a = 0) //STAFactor
254  .def("serialize_json", &rs400::advanced_mode::serialize_json)
255  .def("load_json", &rs400::advanced_mode::load_json, "json_content"_a);
256 }
257 
258 void init_serializable_device(py::module& m) {
259  py::class_<rs2::serializable_device> serializable_device(m, "serializable_device");
260  serializable_device.def(py::init<rs2::device>(), "device"_a)
261  .def("serialize_json", &rs2::serializable_device::serialize_json)
262  .def("load_json", &rs2::serializable_device::load_json, "json_content"_a);
263 }
void set_color_control(const STColorControl &group)
void set_slo_color_thresholds_control(const STSloColorThresholdsControl &group)
const GLfloat * m
Definition: glext.h:6814
void set_slo_penalty_control(const STSloPenaltyControl &group)
STAEControl get_ae_control(int mode=0) const
void set_ae_control(const STAEControl &group)
void set_census(const STCensusRadius &group)
STColorControl get_color_control(int mode=0) const
e
Definition: rmse.py:177
void init_serializable_device(py::module &m)
void set_depth_control(const STDepthControlGroup &group)
void set_depth_table(const STDepthTableControl &group)
STDepthControlGroup get_depth_control(int mode=0) const
void load_json(const std::string &json_content) const
STCensusRadius get_census(int mode=0) const
void set_rau_thresholds_control(const STRauColorThresholdsControl &group)
uint32_t removeThresh
void toggle_advanced_mode(bool enable)
STHdad get_hdad(int mode=0) const
void set_hdad(const STHdad &group)
STAFactor get_amp_factor(int mode=0) const
STSloColorThresholdsControl get_slo_color_thresholds_control(int mode=0) const
STColorCorrection get_color_correction(int mode=0) const
STRauColorThresholdsControl get_rau_thresholds_control(int mode=0) const
void set_rau_support_vector_control(const STRauSupportVectorControl &group)
void set_color_correction(const STColorCorrection &group)
void set_rsm(const STRsm &group)
uint32_t rsmBypass
STSloPenaltyControl get_slo_penalty_control(int mode=0) const
std::string serialize_json() const
void init_advanced_mode(py::module &m)
void set_amp_factor(const STAFactor &group)
STDepthTableControl get_depth_table(int mode=0) const
STRsm get_rsm(int mode=0) const
STRauSupportVectorControl get_rau_support_vector_control(int mode=0) const


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:47:39