|
@@ -505,19 +505,19 @@ int main(int argc, char* argv[]) {
|
|
|
bool pose_hand_raise = cfg.value("pose_hand_raise", true);
|
|
bool pose_hand_raise = cfg.value("pose_hand_raise", true);
|
|
|
bool pose_crouch = cfg.value("pose_crouch", true);
|
|
bool pose_crouch = cfg.value("pose_crouch", true);
|
|
|
bool pose_recline = cfg.value("pose_recline", true);
|
|
bool pose_recline = cfg.value("pose_recline", true);
|
|
|
- bool pose_smoking = cfg.value("pose_smoking", true);
|
|
|
|
|
- bool pose_yawn = cfg.value("pose_yawn", true);
|
|
|
|
|
|
|
+ bool pose_hand_to_mouth = cfg.value("pose_hand_to_mouth", true);
|
|
|
|
|
+ float pose_min_body_h = cfg.value("pose_min_body_h", 60.0f);
|
|
|
fallAnalyzer.setHandRaiseEnabled(pose_hand_raise);
|
|
fallAnalyzer.setHandRaiseEnabled(pose_hand_raise);
|
|
|
fallAnalyzer.setCrouchEnabled(pose_crouch);
|
|
fallAnalyzer.setCrouchEnabled(pose_crouch);
|
|
|
fallAnalyzer.setReclineEnabled(pose_recline);
|
|
fallAnalyzer.setReclineEnabled(pose_recline);
|
|
|
- fallAnalyzer.setSmokingEnabled(pose_smoking);
|
|
|
|
|
- fallAnalyzer.setYawnEnabled(pose_yawn);
|
|
|
|
|
|
|
+ fallAnalyzer.setHandToMouthEnabled(pose_hand_to_mouth);
|
|
|
|
|
+ fallAnalyzer.setMinBodyHeight(pose_min_body_h);
|
|
|
cout << "[Pose] 动作类型: 跌倒/倒地(固定)"
|
|
cout << "[Pose] 动作类型: 跌倒/倒地(固定)"
|
|
|
<< " 举手呼救=" << (pose_hand_raise ? "开" : "关")
|
|
<< " 举手呼救=" << (pose_hand_raise ? "开" : "关")
|
|
|
<< " 异常蹲坐=" << (pose_crouch ? "开" : "关")
|
|
<< " 异常蹲坐=" << (pose_crouch ? "开" : "关")
|
|
|
<< " 半躺=" << (pose_recline ? "开" : "关")
|
|
<< " 半躺=" << (pose_recline ? "开" : "关")
|
|
|
- << " 抽烟=" << (pose_smoking ? "开" : "关")
|
|
|
|
|
- << " 打哈欠=" << (pose_yawn ? "开" : "关") << endl;
|
|
|
|
|
|
|
+ << " 手近嘴部=" << (pose_hand_to_mouth ? "开" : "关")
|
|
|
|
|
+ << " 距离阈值=" << pose_min_body_h << "px" << endl;
|
|
|
bool pose_ok = false;
|
|
bool pose_ok = false;
|
|
|
if (pose_enabled) {
|
|
if (pose_enabled) {
|
|
|
if (poseDetector.load(pose_model_path, pose_input_size,
|
|
if (poseDetector.load(pose_model_path, pose_input_size,
|
|
@@ -1628,8 +1628,8 @@ int main(int argc, char* argv[]) {
|
|
|
r["pose_hand_raise"] = pose_hand_raise;
|
|
r["pose_hand_raise"] = pose_hand_raise;
|
|
|
r["pose_crouch"] = pose_crouch;
|
|
r["pose_crouch"] = pose_crouch;
|
|
|
r["pose_recline"] = pose_recline;
|
|
r["pose_recline"] = pose_recline;
|
|
|
- r["pose_smoking"] = pose_smoking;
|
|
|
|
|
- r["pose_yawn"] = pose_yawn;
|
|
|
|
|
|
|
+ r["pose_hand_to_mouth"] = pose_hand_to_mouth;
|
|
|
|
|
+ r["pose_min_body_h"] = pose_min_body_h;
|
|
|
json chs = json::array();
|
|
json chs = json::array();
|
|
|
{
|
|
{
|
|
|
lock_guard<mutex> lk(channels_mtx);
|
|
lock_guard<mutex> lk(channels_mtx);
|
|
@@ -1689,17 +1689,19 @@ int main(int argc, char* argv[]) {
|
|
|
fallAnalyzer.setReclineEnabled(v);
|
|
fallAnalyzer.setReclineEnabled(v);
|
|
|
full["pose_recline"] = v;
|
|
full["pose_recline"] = v;
|
|
|
}
|
|
}
|
|
|
- if (j.contains("pose_smoking")) {
|
|
|
|
|
- bool v = j["pose_smoking"].get<bool>();
|
|
|
|
|
- pose_smoking = v;
|
|
|
|
|
- fallAnalyzer.setSmokingEnabled(v);
|
|
|
|
|
- full["pose_smoking"] = v;
|
|
|
|
|
|
|
+ if (j.contains("pose_hand_to_mouth")) {
|
|
|
|
|
+ bool v = j["pose_hand_to_mouth"].get<bool>();
|
|
|
|
|
+ pose_hand_to_mouth = v;
|
|
|
|
|
+ fallAnalyzer.setHandToMouthEnabled(v);
|
|
|
|
|
+ full["pose_hand_to_mouth"] = v;
|
|
|
}
|
|
}
|
|
|
- if (j.contains("pose_yawn")) {
|
|
|
|
|
- bool v = j["pose_yawn"].get<bool>();
|
|
|
|
|
- pose_yawn = v;
|
|
|
|
|
- fallAnalyzer.setYawnEnabled(v);
|
|
|
|
|
- full["pose_yawn"] = v;
|
|
|
|
|
|
|
+ if (j.contains("pose_min_body_h")) {
|
|
|
|
|
+ float v = j["pose_min_body_h"].get<float>();
|
|
|
|
|
+ if (v >= 20.0f && v <= 500.0f) {
|
|
|
|
|
+ pose_min_body_h = v;
|
|
|
|
|
+ fallAnalyzer.setMinBodyHeight(v);
|
|
|
|
|
+ full["pose_min_body_h"] = v;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
if (j.contains("pose_enabled")) {
|
|
if (j.contains("pose_enabled")) {
|
|
|
bool v = j["pose_enabled"].get<bool>();
|
|
bool v = j["pose_enabled"].get<bool>();
|