From 2bef72df0afa4f123365fb01fa961f9feabf0e45 Mon Sep 17 00:00:00 2001
From: xuxiuxi <554325746@qq.com>
Date: 星期三, 06 三月 2019 11:49:38 +0800
Subject: [PATCH] Merge branch 'yw.1.2.fixbug' of http://192.168.1.226:10010/r/development/c++ into yw.1.2.fixbug
---
QiaoJiaSystem/FaceDetectServer/FaceDetectServerI.cpp | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/QiaoJiaSystem/FaceDetectServer/FaceDetectServerI.cpp b/QiaoJiaSystem/FaceDetectServer/FaceDetectServerI.cpp
index 7e2236d..b9206a9 100644
--- a/QiaoJiaSystem/FaceDetectServer/FaceDetectServerI.cpp
+++ b/QiaoJiaSystem/FaceDetectServer/FaceDetectServerI.cpp
@@ -32,6 +32,8 @@
delete[] param;
}
THFP_Create(threadMax);
+ m_ampleSize =
+ appPref.getIntData("FaceDetectionSampleSize") > 0 ? appPref.getIntData("FaceDetectionSampleSize") : 640;
}
FaceDetectServerI::~FaceDetectServerI() {
@@ -42,13 +44,14 @@
FaceDetect::Faces FaceDetectServerI::faceDetect(Ice::Int width, Ice::Int height, const std::string &shareMemoryName,
const Ice::Current &) {
ClockTimer ct("FaceDetectServerI::faceDetect");
+ INFO("Face Detect");
FaceDetect::Faces faces;
QSharedMemory shareMemory(QString(shareMemoryName.c_str()));
if (shareMemory.attach()) {
auto data = shareMemory.constData();
THFI_FacePos facesPos[30];
int channel = detectResourcesManager.getAvilableChannel(shareMemoryName);
- int faceNum = THFI_DetectFace(channel, (BYTE *) data, 24, width, height, facesPos, 30);
+ int faceNum = THFI_DetectFace(channel, (BYTE *) data, 24, width, height, facesPos, 30, m_ampleSize);
if (faceNum > 0) {
for (int i = 0; i < faceNum; i++) {
FaceDetect::FacePos face;
@@ -70,6 +73,7 @@
FaceDetect::ThftResult FaceDetectServerI::faceProperty(Ice::Int width, Ice::Int height, const FaceDetect::FacePos &pos,
const std::string &shareMemoryName, const Ice::Current &) {
+ INFO("faceProperty");
QSharedMemory shareMemory(QString(shareMemoryName.c_str()));
if (shareMemory.attach()) {
FaceDetect::ThftResult thftResult;
@@ -86,6 +90,7 @@
}
return thftResult;
} else {
- throw std::runtime_error("shareMemory attach faild");
+ ERR("shareMemory error " << shareMemoryName);
+// throw std::runtime_error("shareMemory attach faild");
}
}
--
Gitblit v1.8.0