Mech-Eye API 2.3.3
API reference documentation for Mech-Eye Industrial 3D Camera
Loading...
Searching...
No Matches
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 "\"ExposureTime\" is unavailable when \"ExposureMode\" is not set to \"Timed\".";
79
80 static constexpr Parameter::Type type = Parameter::Type::_Float;
81
82 static constexpr Range<float> range() { return {0.1, 999}; }
83
84 static constexpr const char* unit = "ms";
85};
86
88{
89public:
90 static constexpr const char* name = "Scan2DSharpenFactor";
91
92 static constexpr const char* description =
93 "Use sharpening algorithm to get sharp edge details, it may cause image noise. The higher "
94 "the setting value, the higher the image sharpness.";
95
96 static constexpr Parameter::Type type = Parameter::Type::_Float;
97
98 static constexpr double defaultValue{0.0};
99
100 static constexpr Range<float> range() { return {0.0, 5.0}; }
101};
102
104{
105public:
106 static constexpr const char* name = "Scan2DExpectedGrayValue";
107
108 static constexpr const char* description =
109 "This parameter affects the brightness of the 2D image. Increase the value if the 2D image "
110 "is too dark and decrease if too bright. \"ExpectedGrayValue\" is unavailable when "
111 "\"ExposureMode\" is not set to \"Auto\".";
112
113 static constexpr Parameter::Type type = Parameter::Type::_Int;
114
115 static constexpr Range<int> range() { return {0, 255}; }
116};
117
119{
120public:
121 static constexpr const char* name = "Scan2DToneMappingEnable";
122
123 static constexpr const char* description =
124 "This function can make the image look more natural. If the 2D image appears very "
125 "different from the actual objects, please enable this function. \"ToneMappingEnable\" is "
126 "unavailable when \"ExposureMode\" is not set to \"HDR\".";
127
128 static constexpr Parameter::Type type = Parameter::Type::_Bool;
129};
130
132{
133public:
134 static constexpr const char* name = "Scan2DROI";
135
136 static constexpr const char* description =
137 "If an auto-exposure ROI is set, the exposure time is adjusted based on the lighting, "
138 "object colors, etc., in this region. Please select the area where the target objects are "
139 "located and avoid including irrelevant objects as much as possible. \"AutoExposureROI\" "
140 "is unavailable when \"ExposureMode\" is not set to \"Auto\".";
141
142 static constexpr Parameter::Type type = Parameter::Type::_Roi;
143};
144
146{
147public:
148 static constexpr const char* name = "Scan2DHDRExposureSequence";
149
150 static constexpr const char* description =
151 "Set multiple exposure times, and the captured images are merged to generate a 2D image "
152 "that retains more details in the highlights and shadows. \"HDRExposureSequence\" is "
153 "unavailable when \"ExposureMode\" is not set to \"HDR\".";
154
155 static constexpr Parameter::Type type = Parameter::Type::_FloatArray;
156
157 static constexpr Range<float> range() { return {0.1, 999}; }
158
159 static constexpr int maxSize() { return 5; }
160
161 static constexpr const char* unit = "ms";
162};
163
164// Depth Source camera Exposure Mode
166{
167public:
168 static constexpr const char* name = "Scan2DPatternRoleExposureMode";
169
170 static constexpr const char* description =
171 "Set the exposure mode for capturing the 2D images (depth source). The images are used in "
172 "hand-eye calibration, checking intrinsic parameters and setting ROI. Timed: Set a single "
173 "fixed exposure time. Usually used in stable lighting conditions. Flash: Use the projector "
174 "for supplemental light. Usually used in dark environments.";
175
176 static constexpr Parameter::Type type = Parameter::Type::_Enum;
177
178 enum struct Value {
179 Timed,
180 Flash,
181 };
182};
183
184// Depth Source camera Exposure Time
186{
187public:
188 static constexpr const char* name = "Scan2DPatternRoleExposureTime";
189
190 static constexpr const char* description =
191 "Set the exposure time for capturing the 2D images (depth source). Usually, long exposure "
192 "time is used in dark environments, and short exposure time is used in bright "
193 "environments.";
194
195 static constexpr Parameter::Type type = Parameter::Type::_Float;
196
197 static constexpr Range<float> range() { return {0.1, 999}; }
198
199 static constexpr const char* unit = "ms";
200};
201
202} // namespace scanning2d_setting
203
204} // namespace eye
205
206} // namespace mmind
Represents a 2D container of data.
Definition Array2D.h:17
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