瀏覽代碼

Z991239-6192 #comment: 优化脸部跟踪库

80274480 4 月之前
父節點
當前提交
bc980cf3e7
共有 1 個文件被更改,包括 9 次插入7 次删除
  1. 9 7
      Other/libfacecapture/libfacecapture.cpp

+ 9 - 7
Other/libfacecapture/libfacecapture.cpp

@@ -1790,11 +1790,9 @@ private:
 		bool bRst = false;
 		uint32_t nSearchFaceFailNum = 0;   //搜索人脸失败次数
 		uint32_t nDetectFailNum = 0;   //检测人脸失败的次数
-		uint32_t nMotionTrackNum = 0;
 
 		//select camera
 		m_eCamera = GetInitPrimCamera();
-
 		uint32_t iwaittime = m_stFaceConfig.nSleepShort;
 
 		while (!m_bStopVieoMonitor)
@@ -1810,7 +1808,6 @@ private:
 				//灯光变化时,清空历史记录,防止误判
 				if (m_bLightChange){
 					ReleaseMotionTrackRst();
-					nMotionTrackNum = 0;
 					m_bLightChange = false;
 				}
 
@@ -2104,16 +2101,21 @@ public:
 #ifdef _WIN32
 		ResetEvent(m_hStopEventWait);
 		if (NULL == m_hVieoMonitorThread){
-			m_pHostApi->Debug(FACECAP_DEBUG, "create video monitor thread.");
 			m_hVieoMonitorThread = (HANDLE)_beginthreadex(NULL, 0, VideoMonitorThread, this, 0, (unsigned int*)&m_nVieoMonitorThreadId);
-			m_bStopVieoMonitor = false;
-			m_eMonitorState = MonitorStateEnum::NoBody;
+			if (m_hVieoMonitorThread) {
+				m_bStopVieoMonitor = false;
+				m_eMonitorState = MonitorStateEnum::NoBody;
+				m_pHostApi->Debug(FACECAP_DEBUG, "create video monitor thread success.");
+			}
+			else {
+				m_pHostApi->Debug(FACECAP_INFO, "create video monitor thread failed!");
+			}
 		}
 #else
 		if (0 == pthread_create(&m_videomonitorthreadid, NULL, videomonitorfunc, (void*)this)){
-			m_pHostApi->Debug(FACECAP_DEBUG, "create video monitor thread and thread id is %u.", m_videomonitorthreadid);
 			m_bStopVieoMonitor = false;
 			m_eMonitorState = MonitorStateEnum::NoBody;
+			m_pHostApi->Debug(FACECAP_DEBUG, "create video monitor thread success and thread id is %u.", m_videomonitorthreadid);
 		}
 		else {
 			m_pHostApi->Debug(FACECAP_INFO, "create video monitor thread failed.");