Clamp a rectangle to image bounds and ensure a minimal size
| 29 | |
| 30 | // Clamp a rectangle to image bounds and ensure a minimal size |
| 31 | static inline void clampRect(cv::Rect2d &r, int width, int height) |
| 32 | { |
| 33 | r.x = std::clamp(r.x, 0.0, double(width - 1)); |
| 34 | r.y = std::clamp(r.y, 0.0, double(height - 1)); |
| 35 | r.width = std::clamp(r.width, 1.0, double(width - r.x)); |
| 36 | r.height = std::clamp(r.height, 1.0, double(height - r.y)); |
| 37 | } |
| 38 | |
| 39 | // Constructor |
| 40 | CVTracker::CVTracker(std::string processInfoJson, ProcessingController &processingController) |