A.R.G.U.S 2.1.0
Adaptive Real-Time Guardian for Unsafe Situations
Loading...
Searching...
No Matches
VisionConfig.hpp
Go to the documentation of this file.
1
16#pragma once
17
18#include <opencv2/objdetect/aruco_detector.hpp>
19
36
37 // Marker Identification
38
47
48 // Speed Threshold
49
58 float maxSpeed = 200.0f;
59
60 // Safe Zone (pixels, full camera frame coordinates)
61 //
62 // Defines a rectangular region within which the marker centroid must
63 // remain for the system to report SAFE. Any centroid outside this
64 // rectangle triggers SafetyState::OUTSIDE_ALLOWED_ZONE.
65
71 int safeZoneXMin = 100;
72
78 int safeZoneXMax = 500;
79
85 int safeZoneYMin = 100;
86
92 int safeZoneYMax = 400;
93
94 // Orientation Limits (degrees, image plane)
95 //
96 // Defines the permitted angular range of the marker in the image plane.
97 // Angles are computed from the marker corner positions using atan2.
98 // Any angle outside [orientationMin, orientationMax] triggers
99 // SafetyState::INVALID_ORIENTATION.
100
107 float orientationMin = -45.0f;
108
115 float orientationMax = 45.0f;
116
117 // ArUco Dictionary
118
126 int dictionaryId = cv::aruco::DICT_6X6_250;
127
128 // Depth layer colour detection
129 //
130 // The forbidden layer is a specific playdough colour (pink/magenta) placed
131 // beneath the permitted cutting layers. When this colour becomes visible
132 // inside the ROI the tool has exceeded its permitted depth and the robot
133 // must freeze and retract immediately.
134 //
135 // Changed from green to pink (RGB ~200-230 / 20-30 / 130-140) because
136 // green detection was unreliable near windows—varying daylight made green
137 // appear as black, blue, or white. Pink is more distinctive and stable
138 // under mixed fluorescent + daylight conditions.
139 //
140 // HSV is used in preference to BGR because it separates colour (hue)
141 // from brightness (value), making detection robust under variable
142 // lighting conditions — critical for a physical hardware demo under
143 // lab fluorescent lighting.
144 //
145 // OpenCV HSV channel ranges:
146 // H (hue): 0 – 179 (half of the 360° colour wheel)
147 // S (saturation): 0 – 255
148 // V (value): 0 – 255
149 //
150 // Pink does not wrap around the HSV wheel, so only range 1 is needed.
151 // Range 2 remains disabled by setting depthHueLower2 > depthHueUpper2,
152 // which causes cv::inRange to produce an empty mask2 so the
153 // bitwise_or in Stage 8 reduces to mask1 alone.
154
155 int depthHueLower1 = 155;
156 int depthHueUpper1 = 165;
157
158 int depthHueLower2 = 255;
160
161 int depthSatMin = 220;
163
164 int depthSatMax = 255;
165
166 int depthValMin = 200;
168
169 int depthValMax = 255;
170
183
195 bool depthCheckEnabled = true;
196};
All tunable safety thresholds and zone boundaries for VisionProcessor.
int dictionaryId
ArUco dictionary used for marker detection.
float maxSpeed
Maximum permitted marker centroid displacement in pixels/second.
int safeZoneXMax
Right boundary of the safe zone in pixels.
int depthValMax
Maximum value threshold.
int depthHueLower1
Lower hue bound for pink/magenta.
int safeZoneYMax
Bottom boundary of the safe zone in pixels.
int depthPixelThreshold
Minimum number of HSV-matching pixels required to confirm the forbidden layer is exposed.
int depthHueUpper2
Disabled - see depthHueLower2 above.
int expectedMarkerId
The ArUco marker ID the system expects to detect.
int safeZoneYMin
Top boundary of the safe zone in pixels.
int depthHueLower2
Disabled - lower > upper produces empty mask2.
float orientationMin
Minimum permitted marker orientation angle in degrees.
int safeZoneXMin
Left boundary of the safe zone in pixels.
int depthSatMax
Maximum saturation threshold.
int depthHueUpper1
Upper hue bound for pink/magenta.
bool depthCheckEnabled
Runtime enable/disable flag for Stage 8 colour detection.
float orientationMax
Maximum permitted marker orientation angle in degrees.