Integrate CAN-aware CMS risk pipeline and relocatable Orin runtime

This commit is contained in:
zmv
2026-09-23 18:54:11 +08:00
parent 26c5bfb88d
commit 9aadf9cbda
119 changed files with 13940 additions and 152 deletions
-35
View File
@@ -1,35 +0,0 @@
#pragma once
#include <nlohmann/json.hpp>
#include <opencv2/core.hpp>
#include <filesystem>
#include <map>
#include <set>
using Json = nlohmann::ordered_json;
namespace cms {
struct DoorOptions {
std::filesystem::path constant, directory;
std::string format{"auto"};
std::set<std::string> labels{"door", "车门"};
int offset{};
bool require{};
double warning{0.30}, release{0.45};
};
class DoorRisk {
public:
DoorRisk(DoorOptions options, cv::Size size);
void initialize() { load(0); }
Json evaluate(int frame, Json& record);
cv::Mat const& mask() const { return mask_; }
private:
void load(int frame);
cv::Mat rasterize(std::filesystem::path const& path) const;
DoorOptions options_;
cv::Size size_;
std::string format_, status_;
std::filesystem::path loadedPath_;
std::map<int, std::filesystem::path> paths_;
cv::Mat mask_, distance_;
bool cached_{};
};
double rounded(double value, int digits);
}