15#include <opencv2/imgproc.hpp>
33 dictionary_(cv::aruco::getPredefinedDictionary(
34 static_cast<cv::aruco::PredefinedDictionaryType>(config.dictionaryId))),
35 detector_(dictionary_, detectorParams_)
77 std::chrono::steady_clock::time_point captureTimestamp)
79 (void)captureTimestamp;
82 const auto startTime = std::chrono::steady_clock::now();
89 const auto now = std::chrono::steady_clock::now();
93 std::chrono::duration_cast<std::chrono::microseconds>(now - startTime)
129 const int roiX = std::max(0,
static_cast<int>(config_.
safeZoneXMin));
130 const int roiY = std::max(0,
static_cast<int>(config_.
safeZoneYMin));
131 const int roiW = std::min(
134 const int roiH = std::min(
142 if (roiW > 0 && roiH > 0) {
146 const cv::Mat roi = frame(cv::Rect(roiX, roiY, roiW, roiH));
156 cv::cvtColor(roi, hsvRoi, cv::COLOR_BGR2HSV);
170 cv::Mat mask1, mask2, combinedMask;
194 cv::bitwise_or(mask1, mask2, combinedMask);
203 const int matchingPixels = cv::countNonZero(combinedMask);
SafetyState
Outcome of a single vision safety evaluation.
Vision safety evaluator for the ARGUS pipeline.
SafetyResult process(const cv::Mat &frame, std::chrono::steady_clock::time_point captureTimestamp)
Processes a single camera frame and evaluates tool safety.
void updateConfig(const VisionConfig &newConfig)
Updates the safety configuration at runtime.
VisionProcessor(const VisionConfig &config)
Constructs a VisionProcessor with the given safety configuration.
Output of VisionProcessor::process() for each camera frame.
All tunable safety thresholds and zone boundaries for VisionProcessor.
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 safeZoneYMin
Top boundary of the safe zone in pixels.
int depthHueLower2
Disabled - lower > upper produces empty mask2.
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.