Mech-Eye API 2.3.0
API reference documentation for Mech-Eye Industrial 3D Camera
All Classes Functions Variables Enumerations Enumerator Pages
Scanning2D.h
1/*******************************************************************************
2 * BSD 3-Clause License
3 *
4 * Copyright (c) 2016-2024, Mech-Mind Robotics
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are met:
9 *
10 * 1. Redistributions of source code must retain the above copyright notice, this
11 * list of conditions and the following disclaimer.
12 *
13 * 2. Redistributions in binary form must reproduce the above copyright notice,
14 * this list of conditions and the following disclaimer in the documentation
15 * and/or other materials provided with the distribution.
16 *
17 * 3. Neither the name of the copyright holder nor the names of its
18 * contributors may be used to endorse or promote products derived from
19 * this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 *
32 * Info: https://www.mech-mind.com/
33 *
34 ******************************************************************************/
35
36#pragma once
37#include "Parameter.h"
38
39namespace mmind {
40
41namespace eye {
42
43// parameters affect the quality of the 2D image.
44namespace scanning2d_setting {
45
46// Scanning 2D Exposure Mode
48{
49public:
50 static constexpr const char* name = "Scan2DExposureMode";
51
52 static constexpr const char* description =
53 "Set the exposure mode for capturing the 2D image. Timed: Set a single exposure time. "
54 "Usually used in stable lighting conditions. Auto: The exposure time is automatically "
55 "adjusted. Usually used in varying lighting conditions. HDR: Set multiple exposure times "
56 "and merge the images. Usually used for objects with various colors or textures. Flash: "
57 "Use the projector for supplemental light. Usually used in dark environments.";
58
59 static constexpr Parameter::Type type = Parameter::Type::_Enum;
60
61 enum struct Value {
62 Timed,
63 Auto,
64 HDR,
65 Flash,
66 };
67};
68
69// Scanning 2D Exposure Time
71{
72public:
73 static constexpr const char* name = "Scan2DExposureTime";
74
75 static constexpr const char* description =
76 "Set the exposure time for capturing the 2D image. Usually, long exposure time is used in "
77 "dark environments, and short exposure time is used in bright environments.";
78
79 static constexpr Parameter::Type type = Parameter::Type::_Float;
80
81 static constexpr Range<float> range() { return {0.1, 999}; }
82
83 static constexpr const char* unit = "ms";
84};
85
87{
88public:
89 static constexpr const char* name = "Scan2DSharpenFactor";
90
91 static constexpr const char* description =
92 "Use sharpening algorithm to get sharp edge details, it may cause image noise. The higher "
93 "the setting value, the higher the image sharpness.";
94
95 static constexpr Parameter::Type type = Parameter::Type::_Float;
96
97 static constexpr double defaultValue{0.0};
98
99 static constexpr Range<float> range() { return {0.0, 5.0}; }
100};
101
103{
104public:
105 static constexpr const char* name = "Scan2DExpectedGrayValue";
106
107 static constexpr const char* description =
108 "This parameter affects the brightness of the 2D image. Increase the value if the 2D image "
109 "is too dark and decrease if too bright.";
110
111 static constexpr Parameter::Type type = Parameter::Type::_Int;
112
113 static constexpr Range<int> range() { return {0, 255}; }
114};
115
117{
118public:
119 static constexpr const char* name = "Scan2DToneMappingEnable";
120
121 static constexpr const char* description =
122 "This function can make the image look more natural. If the 2D image appears very "
123 "different from the actual objects, please enable this function.";
124
125 static constexpr Parameter::Type type = Parameter::Type::_Bool;
126};
127
129{
130public:
131 static constexpr const char* name = "Scan2DROI";
132
133 static constexpr const char* description =
134 "If an auto-exposure ROI is set, the exposure time is adjusted based on the lighting, "
135 "object colors, etc., in this region. Please select the area where the target objects are "
136 "located and avoid including irrelevant objects as much as possible.";
137
138 static constexpr Parameter::Type type = Parameter::Type::_Roi;
139};
140
142{
143public:
144 static constexpr const char* name = "Scan2DHDRExposureSequence";
145
146 static constexpr const char* description =
147 "Set multiple exposure times, and the captured images are merged to generate a 2D image "
148 "that retains more details in the highlights and shadows.";
149
150 static constexpr Parameter::Type type = Parameter::Type::_FloatArray;
151
152 static constexpr Range<float> range() { return {0.1, 999}; }
153
154 static constexpr int maxSize() { return 5; }
155
156 static constexpr const char* unit = "ms";
157};
158
159// Depth Source camera Exposure Mode
161{
162public:
163 static constexpr const char* name = "Scan2DPatternRoleExposureMode";
164
165 static constexpr const char* description =
166 "Set the exposure mode for capturing the 2D images (depth source). The images are used in "
167 "hand-eye calibration, checking intrinsic parameters and setting ROI. Timed: Set a single "
168 "fixed exposure time. Usually used in stable lighting conditions. Flash: Use the projector "
169 "for supplemental light. Usually used in dark environments.";
170
171 static constexpr Parameter::Type type = Parameter::Type::_Enum;
172
173 enum struct Value {
174 Timed,
175 Flash,
176 };
177};
178
179// Depth Source camera Exposure Time
181{
182public:
183 static constexpr const char* name = "Scan2DPatternRoleExposureTime";
184
185 static constexpr const char* description =
186 "Set the exposure time for capturing the 2D images (depth source). Usually, long exposure "
187 "time is used in dark environments, and short exposure time is used in bright "
188 "environments.";
189
190 static constexpr Parameter::Type type = Parameter::Type::_Float;
191
192 static constexpr Range<float> range() { return {0.1, 999}; }
193
194 static constexpr const char* unit = "ms";
195};
196
197} // namespace scanning2d_setting
198
199} // namespace eye
200
201} // namespace mmind
Type
Describes the device parameter data types.
Definition Parameter.h:30
@ _Int
Integer type.
Definition Parameter.h:31
@ _Roi
ROI type. See ROI for details.
Definition Parameter.h:35
@ _Enum
Enumeration type.
Definition Parameter.h:34
@ _Float
Double type.
Definition Parameter.h:32
@ _Bool
Boolean type.
Definition Parameter.h:33
@ _FloatArray
Vector of double types.
Definition Parameter.h:37
Describes a value range.
Definition CommonTypes.h:11