Ver código fonte

Z991239-6004 #comment 脸部跟踪实体日志精简

80274480 7 meses atrás
pai
commit
4ec93448e9

+ 3 - 17
Module/mod_counterconnector/ConnectorFSM.cpp

@@ -498,7 +498,7 @@ int ACMCallFSM::ParseDefaultServer(const char* strServer)
 	int index = 0;
 	while(index < icount && result[index]){
 		m_voipserver.push_back(result[index]);
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("result[%d] = [%s].", index, result[index]);
+		//DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("result[%d] = [%s].", index, result[index]);
 		index++;
 	}
 
@@ -669,7 +669,7 @@ ErrorCodeEnum ACMCallFSM::SetCallState(int state)
 		strCallState = sts[state];
 	}
 
-	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("set call state to [%s].", strCallState);
+	//DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("set call state to [%s].", strCallState);
 	return GetEntityBase()->GetFunction()->SetSysVar("CallState", strCallState);
 }
 
@@ -757,8 +757,6 @@ unsigned int ACMCallFSM::s0_on_event(FSMEvent* event)
 #ifdef RVC_OS_WIN
 		StopVideo();
 		SetCallingType(NORMAL_CALLTYPE);
-#else
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("%s:%d, stop show local and remote video.", __FUNCTION__, __LINE__);
 #endif
 	}
 	return 0;
@@ -778,7 +776,6 @@ unsigned int ACMCallFSM::s7_on_event(FSMEvent* event)
 {
 	if (event->iEvt == USER_EVT_STOPLOCALVIDEO) 
 	{
-		//DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("stop show local video");
 		StopVideo();
 	}
 	else if (event->iEvt == USER_EVT_SIPPHONE_IDEL)
@@ -793,10 +790,7 @@ unsigned int ACMCallFSM::s7_on_event(FSMEvent* event)
 void ACMCallFSM::s8_on_entry() 
 {
 	//get call route,采用直接总行方式
-	if (0 == GetCallRouteList()) {
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("get call route list success.");
-	}
-	else {
+	if (0 != GetCallRouteList()) {
 		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("get call route list failed.");
 	}
 
@@ -886,7 +880,6 @@ void ACMCallFSM::s11_on_entry()
 		get_format_uuid(callid_str, 64);
 
 		if (node != NULL){
-			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Begin Head Office Make Call!");
 			m_LastSipError = MakeCall(node->strcallurl, CSimpleStringA::Format("sip:%s@%s;transport=UDP", node->strnewcallernum, ipstr), 
 					callid_str, m_CallingParam);
 			m_iChanProxyPort[0] = node->uassistport;
@@ -1013,7 +1006,6 @@ unsigned int ACMCallFSM::s11_on_event(FSMEvent* event)
 		else{
 			LogWarn(Severity_Low, Error_Unexpect, LOG_WARN_COUNTERCONNECT_SIPCONNECT_TIMEOUT,"sipphone connect timeout, error server");
 		}
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("sip call timeout,release call");
 		m_nSipErrorNum++;
 		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR0402304C2").setResultCode("RTA3435")("sip connect failed for timeout");
 	}
@@ -1315,13 +1307,11 @@ unsigned int ACMCallFSM::s21_on_event(FSMEvent* event)
 	{
 		if(event->param1 == 21)
 		{
-			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("hangupcall timeout,release call");
 			ScheduleTimer(210,RELEASEING_SIP_TIMEOUT);
 			ReleaseCall(0);
 		}
 		else if (event->param1 == 210)
 		{
-			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("release call timeout,restart sipphone");
 			PostEventFIFO(new FSMEvent(USER_EVT_JMP_FAIL));
 			//RealSipErrorCheck();
 			LogEvent(Severity_Middle, EVENT_MOD_RELEASESIP_TIMEOUT,"restart sipphone");
@@ -1607,12 +1597,10 @@ unsigned int ACMCallFSM::s52_on_event(FSMEvent* event)
 		if (event->param1 == 52)
 		{
 			ScheduleTimer(520,RELEASEING_SIP_TIMEOUT);
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("sip finished timeout,release call");
 			ReleaseCall(0);
 		}
 		else if (event->param1 == 520)
 		{
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("release call timeout,restart sipphone");
 			PostEventFIFO(new FSMEvent(USER_EVT_JMP_FAIL));
 			LogEvent(Severity_Middle, EVENT_MOD_RELEASESIP_TIMEOUT,"restart sipphone ");
 			LogWarn(Severity_Middle, Error_Unexpect, LOG_WARN_COUNTERCONNECT_RESTART_SIPPHONE,"restart sipphone ");
@@ -1747,12 +1735,10 @@ unsigned int ACMCallFSM::s62_on_event(FSMEvent* event)
 		if (event->param1 == 62)
 		{
 			ScheduleTimer(620,RELEASEING_SIP_TIMEOUT);
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("sip hangup timeout,release call");
 			ReleaseCall(0);
 		}
 		else if (event->param1 == 620)
 		{
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("release call timeout,restart sipphone");
 			PostEventFIFO(new FSMEvent(USER_EVT_JMP_FAIL));
 			LogEvent(Severity_Middle, EVENT_MOD_RELEASESIP_TIMEOUT,"restart sipphone ");
 			LogWarn(Severity_Middle, Error_Unexpect, LOG_WARN_COUNTERCONNECT_RESTART_SIPPHONE,"restart sipphone ");

+ 1 - 1
Module/mod_customeraware/CustomerHandleFSM.cpp

@@ -124,7 +124,7 @@ ErrorCodeEnum CCustomerHandleFSM::OnInit()
 {
 	AddStateHooker(this);
 	nOldstate = 0;
-	m_bIsSalesRecord = FALSE;
+	m_bIsSalesRecord = false;
 	return Error_Succeed;
 }
 

+ 2 - 19
Module/mod_facetracking/mod_facetracking.cpp

@@ -305,7 +305,8 @@ public:
 					spFunction->SetSysVar(SYSVAR_ACTIVETRACKINGCAMERA, ACTIVETRACKINGCAMERA_OPT); // from Environment -> Operation
 				}
 			}			
-		} else 
+		} 
+		else 
 		{
 			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("GetMainCustomerStatus failed!");
 		}
@@ -355,24 +356,6 @@ public:
 		CSmartPointer<IEntityFunction> spFunction = GetFunction();
 		CSmartPointer<IConfigInfo> spConfig;
 		ErrorCodeEnum Error(Error_Succeed);
-		if (false && (Error = spFunction->OpenConfig(Config_CenterSetting, spConfig)) == Error_Succeed) {
-			SpIniMappingTable table;
-			table.AddEntryInt("general", "PrimCamera", config.nPrimCamera, 0);
-			table.AddEntryInt("general", "ContourMinAera", config.nContourMinAera, 0);
-			table.AddEntryInt("general", "UpCameraEdgeLimit", config.nUpCameraEdgeLimit, 0);
-			table.AddEntryInt("general", "DownCameraEdgeLimit", config.nDownCameraEdgeLimit, 0);
-			table.AddEntryFloat("general", "OperateFaceSize", config.fOperateFaceSize, 0.0f);
-			table.AddEntryFloat("general", "CloseFaceSize", config.fCloseFaceSize, 0.0f);
-			table.AddEntryFloat("general", "FarFaceSize", config.fFarFaceSize, 0.0f);
-			table.AddEntryFloat("general", "SearchFaceSize", config.fSearchFaceSize, 0.0f);
-			table.AddEntryFloat("general", "DetectFaceSize", config.fDetectFaceSize, 0.0f);
-			table.AddEntryInt("general", "FaceSizeOffset", config.nFaceSizeOffset, 0);
-			table.AddEntryInt("general", "SleepLong", config.nSleepLong, 0);
-			table.AddEntryInt("general", "SleepMiddle", config.nSleepMiddle, 0);
-			table.AddEntryInt("general", "SleepShort", config.nSleepShort, 0);
-			table.AddEntryInt("general", "ThresholdNum", config.nThresholdNum, 0);
-			Error = table.Load(spConfig);
-		}
 
 		/*
 		PrimCamera=1

+ 4 - 7
Module/mod_recorder/mod_recorder.cpp

@@ -410,8 +410,10 @@ ErrorCodeEnum CRecorderEntity::LoadEntityConfig()
 		m_bEncFlag = false;
 	}
 
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("m_bEncFlag is %s.", m_bEncFlag ? "true":"false");
-
+	if (!m_bEncFlag) {
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("m_bEncFlag is %s.", m_bEncFlag ? "true" : "false");
+	}
+	
 	return Error;
 }
 
@@ -611,11 +613,9 @@ void CRecorderEntity::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUID nLogID,
 		break;
 
 	case LOG_EVT_MEDIACONTROLLER_CAMERA_STARTED:
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("recv LOG_EVT_MEDIACONTROLLER_CAMERA_STARTED event");
 		break;
 
 	case LOG_EVT_MEDIACONTROLLER_CAMERA_STOPPED:
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("recv LOG_EVT_MEDIACONTROLLER_CAMERA_STOPPED event");
 		break;
 
 	case LOG_EVT_UI_RETURNMENU:
@@ -624,7 +624,6 @@ void CRecorderEntity::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUID nLogID,
 
 	case LOG_EVT_UI_STARTCAMERACAPTURE:
 		{
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("recv LOG_EVT_UI_STARTCAMERACAPTURE event");
 	#ifdef RVC_OS_WIN
 
 	#else
@@ -646,7 +645,6 @@ void CRecorderEntity::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUID nLogID,
 		break;
 
 	case LOG_EVT_UI_STOPCAMERACAPTURE:
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("recv LOG_EVT_UI_STOPCAMERACAPTURE event");
 		StopRecord();
 		break;
 
@@ -880,7 +878,6 @@ int CRecorderEntity::HandleEncryptVideoRecord(const char* videofilename)
 	}
 	else{
 		if (rvcMoveFile(strOutFile, videofilename)){
-			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("after encryption rename %s to %s Success!",strOutFile, videofilename);
 			iRet = 0;
 		}
 		else{

+ 0 - 2
Module/mod_snapshot/CMakeLists.txt

@@ -9,8 +9,6 @@ set(MOD_VERSION_STRING "0.0.1-dev1")
 add_module_libraries(${MODULE_PREFIX} ${MODULE_NAME} ${MOD_VERSION_STRING})
 
 
-
-
 target_include_directories(${MODULE_NAME} PRIVATE
 	${RVC_FRAMEWORK_INCLUDES_DIR}
     ${MODULE_BASE_DIR}

+ 24 - 23
Other/unix/libfacecapture/libfacecapture.cpp

@@ -204,7 +204,7 @@ public:
 		m_pMhImg = NULL;
 		m_pMhBuf = NULL;
 		m_bLightChange = FALSE;
-		m_nCameraStae = 0;
+		m_nCameraState = 0;
 		m_nLastBuf = 0;
 		m_nCapFaceNum = 0;
 		m_bCapFaceCompleted = FALSE;
@@ -369,7 +369,7 @@ public:
 
 public:
 	BOOL m_bLightChange;
-	int m_nCameraStae;//0:无故障1:env故障,2:opt故障,3:全部故障
+	int m_nCameraState;//0:无故障1:env故障,2:opt故障,3:全部故障
 
 private:
 #ifdef RVC_OS_WIN
@@ -434,39 +434,39 @@ private:
 	char m_optqueuename[MAX_PATH];
 
 	//初始化
-	BOOL InitFaceCapture(const char *base_dir)
+	bool InitFaceCapture(const char *base_dir)
 	{
-		char dir[MAX_PATH];
+		char dir[MAX_PATH] = {0};
 		FIGetDir(CASCADE_FACE,base_dir, dir);
 		m_pFaceCascade=(CvHaarClassifierCascade*)cvLoad(dir,NULL,NULL,NULL);
-		if (!m_pFaceCascade)
-		{
+		if (!m_pFaceCascade){
 			m_pHostApi->Debug("加载脸部分类器失败!");
-			return FALSE;
+			return false;
 		}
+
 		FIGetDir(CASCADE_EYE,base_dir,dir);
 		m_pEyeCascade=(CvHaarClassifierCascade*)cvLoad(dir,NULL,NULL,NULL);
-		if (!m_pEyeCascade)
-		{
+		if (!m_pEyeCascade){
 			m_pHostApi->Debug("加载眼睛分类器失败!");
-			return FALSE;
+			return false;
 		}
+
 		FIGetDir(CASCADE_MOUTH,base_dir,dir);
 		m_pMouthCascade=(CvHaarClassifierCascade*)cvLoad(dir,NULL,NULL,NULL);
-		if (!m_pMouthCascade)
-		{
+		if (!m_pMouthCascade){
 			m_pHostApi->Debug("加载嘴巴分类器失败!");
-			return FALSE;
+			return false;
 		}
+
 		FIGetDir(CASCADE_NOSE,base_dir,dir);
 		m_pNoseCascade=(CvHaarClassifierCascade*)cvLoad(dir,NULL,NULL,NULL);
-		if (!m_pMouthCascade)
-		{
+		if (!m_pMouthCascade){
 			m_pHostApi->Debug("加载鼻子分类器失败!");
-			return FALSE;
+			return false;
 		}
-		return TRUE;
+		return true;
 	}
+
 	//获取分类器路径
 	void FIGetDir(const char*CascadeType,const char *base_dir,char*dir)
 	{
@@ -474,6 +474,7 @@ private:
 		strcat(dir, SPLIT_SLASH_STR);
 		strcat(dir,CascadeType);
 	}
+
 	//写人脸检测数据
 	BOOL WriteAllFaceInfo(CAllFaceInfo faceInfo)
 	{
@@ -2025,15 +2026,15 @@ private:
 		}
 		else
 		{
-			if((m_nCameraStae == 0)||(m_nCameraStae ==2))
+			if((m_nCameraState == 0)||(m_nCameraState ==2))
 			{
 				m_eCamera = EnvironCamera;
 			}
-			else if (m_nCameraStae == 1)
+			else if (m_nCameraState == 1)
 			{
 				m_eCamera = OperatorCamera;
 			}
-			else if (m_nCameraStae == 3)
+			else if (m_nCameraState == 3)
 			{
 				m_eCamera = ErrorCamera;
 			}
@@ -2044,7 +2045,7 @@ private:
 			try 
 			{
 				//如果摄像头没启动或故障,停止扫描,休眠5s
-				if (m_nCameraStae == 3)
+				if (m_nCameraState == 3)
 				{
 					FSleep(2000);
 					m_pHostApi->Debug("camera stop or all camera error!");
@@ -2078,7 +2079,7 @@ private:
 					//}
 					//else
 					//{
-					//	if (!m_bLightChange&&(m_nCameraStae != 3))
+					//	if (!m_bLightChange&&(m_nCameraState != 3))
 					//	{
 					//		m_pHostEvent->GenerateAppearEvent();	//产生有人出现事件
 					//		m_pHostApi->Debug("运动跟踪,有人出现!");
@@ -2799,7 +2800,7 @@ void Clibfacecapture::SetLightChange()
 //相机状态
 void Clibfacecapture::SetCameraState(int nState)
 {
-	m_pImpl->m_nCameraStae = nState;
+	m_pImpl->m_nCameraState = nState;
 }
 
 bool Clibfacecapture::StartFaceCapture()

+ 164 - 155
Other/win/libfacecapture/libfacecapture.cpp

@@ -10,7 +10,6 @@
 #include "highgui.h"
 #include "libvideoqueue.h"
 #include "libsharememory.h"
-#include "logfile.h"
 
 //#define SHAREMEM
 #ifndef SPBASE_API
@@ -119,21 +118,21 @@ public:
 		pfaceSeq = NULL;	
 		m_pProcessImg	= NULL;
 		m_hVieoMonitorThread = NULL;
-		m_bStopVieoMonitor = FALSE;
+		m_bStopVieoMonitor = false;
 		m_pEnvironMinVideoQueue = NULL;
 		m_pEnvironMaxVideoQueue =NULL;
 		m_pOperatorVideoQueue =NULL;
 		m_nVieoMonitorExitCode = 0;
 		m_nVieoMonitorThreadId = 0;
-		m_nImgWidth		= 0;
-		m_nImgHeight		= 0;
+		m_nImgWidth	= 0;
+		m_nImgHeight = 0;
 		m_pMhImg = NULL;
 		m_pMhBuf = NULL;
-		m_bLightChange = FALSE;
-		m_nCameraStae = 0;
+		m_bLightChange = false;
+		m_nCameraState = 0;
 		m_nLastBuf = 0;
 		m_nCapFaceNum = 0;
-		m_bCapFaceCompleted = FALSE;
+		m_bCapFaceCompleted = false;
 		m_eMonitorState = NoBody;
 
 		memset(m_envminqueuename, 0, MAX_PATH);
@@ -155,9 +154,8 @@ public:
 		InitializeCriticalSection(&CS);
 
 		m_hStopEventWait= ::CreateEventA(NULL, TRUE, 0, 0);
-		if (!m_hStopEventWait) 
-		{
-			*pResult = FALSE;
+		if (!m_hStopEventWait) {
+			*pResult = false;
 			pHostAPI->Debug("create hEventWait failed!");
 			return;
 		}
@@ -167,11 +165,11 @@ public:
 
 		//读取配置文件
 		*pResult = pHostAPI->LoadConfig(m_stFaceConfig);
-		if (!*pResult)
-		{
+		if (!*pResult){
 			pHostAPI->Debug("Load Configuration failed!");
 			return;
 		}
+
 		*pResult = InitFaceCapture(m_stFaceConfig.strFaceDataDirPath);
 		if (!*pResult){
 			return;
@@ -291,8 +289,8 @@ public:
 	}
 
 public:
-	BOOL m_bLightChange;
-	int m_nCameraStae;//0:无故障1:env故障,2:opt故障,3:全部故障
+	bool m_bLightChange;
+	int m_nCameraState;		//0:无故障1:env故障,2:opt故障,3:全部故障
 
 private:
 	HANDLE m_hStopEventWait; // CreateEvent
@@ -324,14 +322,14 @@ private:
 	HANDLE m_hVieoMonitorThread;
 	DWORD m_nVieoMonitorExitCode;
 	DWORD m_nVieoMonitorThreadId;
-	BOOL m_bStopVieoMonitor;
+	bool m_bStopVieoMonitor;
 	Clibvideoqueue*m_pEnvironMinVideoQueue;		//环境摄像头小分辨率视频队列
 	Clibvideoqueue*m_pEnvironMaxVideoQueue;		//环境摄像头大分辨率视频队列
 	Clibvideoqueue*m_pOperatorVideoQueue;		//操作摄像头视频队列
 
 	CLocalFaceInfo m_stCapFace[3];
 	int m_nCapFaceNum;
-	BOOL m_bCapFaceCompleted;
+	bool m_bCapFaceCompleted;
 	char m_SaveImgName[MAX_PATH];
 	CAllFaceInfo m_stAllFaceInfo;
 	CAllFaceInfo m_stFaceRstStorage;
@@ -346,39 +344,40 @@ private:
 	char m_optqueuename[MAX_PATH];
 
 	//初始化
-	BOOL InitFaceCapture(const char *base_dir)
+	bool InitFaceCapture(const char *base_dir)
 	{
-		char dir[MAX_PATH];
-		FIGetDir(CASCADE_FACE,base_dir, dir);
+		char dir[MAX_PATH] = {0};
+		FIGetDir(CASCADE_FACE, base_dir, dir);
 		m_pFaceCascade=(CvHaarClassifierCascade*)cvLoad(dir,NULL,NULL,NULL);
-		if (!m_pFaceCascade)
-		{
+		if (!m_pFaceCascade){
 			m_pHostApi->Debug("加载脸部分类器失败!");
-			return FALSE;
+			return false;
 		}
+
 		FIGetDir(CASCADE_EYE,base_dir,dir);
 		m_pEyeCascade=(CvHaarClassifierCascade*)cvLoad(dir,NULL,NULL,NULL);
-		if (!m_pEyeCascade)
-		{
+		if (!m_pEyeCascade){
 			m_pHostApi->Debug("加载眼睛分类器失败!");
-			return FALSE;
+			return false;
 		}
+
 		FIGetDir(CASCADE_MOUTH,base_dir,dir);
 		m_pMouthCascade=(CvHaarClassifierCascade*)cvLoad(dir,NULL,NULL,NULL);
-		if (!m_pMouthCascade)
-		{
+		if (!m_pMouthCascade){
 			m_pHostApi->Debug("加载嘴巴分类器失败!");
-			return FALSE;
+			return false;
 		}
+
 		FIGetDir(CASCADE_NOSE,base_dir,dir);
 		m_pNoseCascade=(CvHaarClassifierCascade*)cvLoad(dir,NULL,NULL,NULL);
 		if (!m_pMouthCascade)
 		{
 			m_pHostApi->Debug("加载鼻子分类器失败!");
-			return FALSE;
+			return false;
 		}
-		return TRUE;
+		return true;
 	}
+
 	//获取分类器路径
 	void FIGetDir(const char*CascadeType,const char *base_dir,char*dir)
 	{
@@ -386,14 +385,16 @@ private:
 		strcat(dir,"\\");
 		strcat(dir,CascadeType);
 	}
+
 	//写人脸检测数据
-	BOOL WriteAllFaceInfo(CAllFaceInfo faceInfo)
+	bool WriteAllFaceInfo(CAllFaceInfo faceInfo)
 	{
 		EnterCriticalSection(&CS);
 		m_stFaceRstStorage = faceInfo;
 		LeaveCriticalSection(&CS);
-		return TRUE;
+		return true;
 	}
+
 	//计算人脸所处的区域
 	FaceRegionEnum CalcFaceRegion(CvRect FaceRect,int nImgWidth,int nImgHeight)
 	{
@@ -448,6 +449,7 @@ private:
 		} 
 		return FaceError;
 	}
+
 	//计算人脸到机具的距离
 	DistanceEnum CalcFaceDistance(CvRect FaceRect)
 	{
@@ -464,8 +466,9 @@ private:
 			return FarDistance;		//远端2.5m
 		}
 	}
+
 	//从共享队列获取图像
-	BOOL GetCurImg(Clibvideoqueue*videoqueue)
+	bool GetCurImg(Clibvideoqueue*videoqueue)
 	{
 		if (videoqueue->GetVideoLens()<=0)
 		{
@@ -477,7 +480,7 @@ private:
 			{
 				//m_pHostApi->Debug("获取操作相机图像队列长度错误!");
 			}
-			return FALSE;
+			return false;
 		}
 		int size = videoqueue->GetFrameSize(m_nImgWidth,m_nImgHeight);
 		videoq_frame*videoframe = new videoq_frame;
@@ -495,55 +498,56 @@ private:
 			} 
 		}
 		videoframe->data = (unsigned char*)m_pProcessImg->imageData;
-		BOOL bGetvideo = videoqueue->GetVideo(videoframe,0);
+		bool bGetvideo = videoqueue->GetVideo(videoframe,0);
 		if (!bGetvideo)
 		{
 			delete videoframe;
 			m_pHostApi->Debug("从队列获取图像错误!");
-			return FALSE;
+			return false;
 		}
 		m_nImgWidth = videoframe->width;
 		m_nImgHeight = videoframe->height;
 		delete videoframe;
-		return TRUE;
+		return true;
 	}
-	BOOL GetImage(CameraEnum eCamera)
+
+	bool GetImage(CameraEnum eCamera)
 	{
 		if (eCamera == EnvironCamera)
 		{
 			if (m_pEnvironMinVideoQueue == NULL)
 			{
-				return FALSE;
+				return false;
 			}
-			BOOL bRslt = GetCurImg(m_pEnvironMinVideoQueue);
+			bool bRslt = GetCurImg(m_pEnvironMinVideoQueue);
 			if (!bRslt)
 			{
-				return FALSE;
+				return false;
 			}
 		}
 		else if(eCamera == OperatorCamera)
 		{
 			if (m_pOperatorVideoQueue == NULL)
 			{
-				return FALSE;
+				return false;
 			}
-			BOOL bRslt = GetCurImg(m_pOperatorVideoQueue);
+			bool bRslt = GetCurImg(m_pOperatorVideoQueue);
 			if (!bRslt)
 			{
-				return FALSE;
+				return false;
 			}
 		}
-		return TRUE;
+		return true;
 	}
 	//清空上次检测结果
 	void ClearInspectResult()
 	{
 		//清除上一次的记录
 		m_stAllFaceInfo.nTatolFaceNum = 0;
-		m_stAllFaceInfo.astFaceInfo[0].stCustomerCover.bClearFace = FALSE;
-		m_stAllFaceInfo.astFaceInfo[0].stCustomerCover.bShowEyes = FALSE;
-		m_stAllFaceInfo.astFaceInfo[0].stCustomerCover.bShowMouth = FALSE;
-		m_stAllFaceInfo.astFaceInfo[0].stCustomerCover.bShowNose = FALSE;
+		m_stAllFaceInfo.astFaceInfo[0].stCustomerCover.bClearFace = false;
+		m_stAllFaceInfo.astFaceInfo[0].stCustomerCover.bShowEyes = false;
+		m_stAllFaceInfo.astFaceInfo[0].stCustomerCover.bShowMouth = false;
+		m_stAllFaceInfo.astFaceInfo[0].stCustomerCover.bShowNose = false;
 		m_stAllFaceInfo.astFaceInfo[0].eDistance  = UncertainDistance;
 		m_stAllFaceInfo.astFaceInfo[0].eHeight = UncertainHeight;
 		m_stAllFaceInfo.astFaceInfo[0].ePose = UncertainPose;
@@ -553,11 +557,11 @@ private:
 		//memset(&m_stBrightAdjParam,0,sizeof(CBrightAdjParam));
 		for (int i=1;i<MAX_FACE_NUM;i++)
 		{
-			memset(&m_stAllFaceInfo.astFaceInfo[i],0,sizeof(CCustomerInfo));
+			memset(&m_stAllFaceInfo.astFaceInfo[i], 0, sizeof(CCustomerInfo));
 		}
 	}
 	//特征检测,检测眼睛,鼻子,嘴巴
-	BOOL FeatureDetect(CvHaarClassifierCascade *pCascade, CvRect *pFaceRect,CvMemStorage* pFaceStorage)
+	bool FeatureDetect(CvHaarClassifierCascade *pCascade, CvRect *pFaceRect,CvMemStorage* pFaceStorage)
 	{
 		//搜索区域图像
 		CvRect RegionRect;
@@ -607,11 +611,11 @@ private:
 		}
 		if (pEyesSeq?pEyesSeq->total:0)
 		{
-			return TRUE;
+			return true;
 		}
 		else
 		{
-			return FALSE; 
+			return false; 
 		}	
 	}
 	//计算两个人脸数据的距离
@@ -711,8 +715,9 @@ private:
 			return VeryLow;
 		}
 	}
+
 	//计算人脸亮度调节参数
-	BOOL CalcBrightAdjParam(IplImage*img,CvRect* FaceRect)
+	bool CalcBrightAdjParam(IplImage*img,CvRect* FaceRect)
 	{
 		cvResetImageROI(img);
 		cvSetImageROI(img,*FaceRect);
@@ -781,15 +786,15 @@ private:
 			m_stBrightAdjParam.fGamma	= 1;
 		}
 		cvReleaseImage(&FaceImg);
-		return TRUE;
+		return true;
 	}
 	//人脸检测,直接对load进来的图像进行全局检测
-	BOOL FaceDetect(CameraEnum eCamera)
+	bool FaceDetect(CameraEnum eCamera)
 	{
 		if (!GetImage(eCamera))
 		{
 			RecordError("获取图像失败");
-			return FALSE;
+			return false;
 		}
 		CCustomerInfo UserFaceTemp;
 		int nFaceSerial = 1;
@@ -811,7 +816,7 @@ private:
 		if (m_pFaceCascade == NULL)
 		{
 			ClearInspectResult();
-			return FALSE;
+			return false;
 		}
 		int size = (int)m_nImgHeight/m_stFaceConfig.fDetectFaceSize;
 		pfaceSeq = cvHaarDetectObjects(m_pProcessImg,m_pFaceCascade,m_pFaceStorage,1.1,3,CV_HAAR_DO_CANNY_PRUNING,cvSize(size,size));
@@ -820,7 +825,7 @@ private:
 			cvReleaseMemStorage(&pfaceSeq->storage);
 			pfaceSeq = NULL;	
 			ClearInspectResult();
-			return FALSE;
+			return false;
 		}
 		else
 		{
@@ -851,22 +856,22 @@ private:
 			else
 			{
 				//找眼睛
-				m_stAllFaceInfo.astFaceInfo[nFaceSerial].stCustomerCover.bShowEyes = FALSE;
+				m_stAllFaceInfo.astFaceInfo[nFaceSerial].stCustomerCover.bShowEyes = false;
 				//找鼻子
-				m_stAllFaceInfo.astFaceInfo[nFaceSerial].stCustomerCover.bShowNose = FALSE;
+				m_stAllFaceInfo.astFaceInfo[nFaceSerial].stCustomerCover.bShowNose = false;
 				//找嘴巴
-				m_stAllFaceInfo.astFaceInfo[nFaceSerial].stCustomerCover.bShowMouth = FALSE;
+				m_stAllFaceInfo.astFaceInfo[nFaceSerial].stCustomerCover.bShowMouth = false;
 			}
 
 			if(!(m_stAllFaceInfo.astFaceInfo[nFaceSerial].stCustomerCover.bShowEyes||
 				m_stAllFaceInfo.astFaceInfo[nFaceSerial].stCustomerCover.bShowNose||
 				m_stAllFaceInfo.astFaceInfo[nFaceSerial].stCustomerCover.bShowMouth))
 			{
-				m_stAllFaceInfo.astFaceInfo[nFaceSerial].stCustomerCover.bClearFace = FALSE;
+				m_stAllFaceInfo.astFaceInfo[nFaceSerial].stCustomerCover.bClearFace = false;
 			}
 			else
 			{
-				m_stAllFaceInfo.astFaceInfo[nFaceSerial].stCustomerCover.bClearFace = TRUE;
+				m_stAllFaceInfo.astFaceInfo[nFaceSerial].stCustomerCover.bClearFace = true;
 			}
 			//计算当前人脸位置,如果当前人脸位置与上次人脸位置小于偏移量则取上次人脸位置,防止人脸图像跳变
 			for (int num=0; num<nPreFaceNum; num++)
@@ -961,19 +966,19 @@ private:
 		if(m_stAllFaceInfo.nTatolFaceNum == 0)
 		{
 			ClearInspectResult();
-			return FALSE;
+			return false;
 		} 
 		else
 		{
-			return TRUE;
+			return true;
 		}
 	}
 	//人脸检测,对上次检测到的人脸区域进行搜索
-	BOOL FaceDetect(CameraEnum eCamera,CvRect rect)
+	bool FaceDetect(CameraEnum eCamera,CvRect rect)
 	{
 			if (!GetImage(eCamera))
 			{
-				return FALSE;
+				return false;
 			}
 			CvMemStorage*pFaceStorage = NULL;
 			if (eCamera == EnvironCamera)
@@ -1004,7 +1009,7 @@ private:
 			//人脸搜索
 			if (m_pFaceCascade == NULL)
 			{
-				return FALSE;
+				return false;
 			}
 			int size = (int)m_nImgHeight/m_stFaceConfig.fDetectFaceSize;
 				pfaceSeq = cvHaarDetectObjects(m_pProcessImg,m_pFaceCascade,pFaceStorage,1.2,3,CV_HAAR_DO_CANNY_PRUNING,cvSize(size,size));
@@ -1012,7 +1017,7 @@ private:
 			{
 				cvReleaseMemStorage(&pfaceSeq->storage);
 				pfaceSeq = NULL;
-				return FALSE;
+				return false;
 			}
 			for(int i=0;i<(pfaceSeq?pfaceSeq->total:0)&&(i<MAX_FACE_NUM);i++)
 			{
@@ -1031,20 +1036,20 @@ private:
 				else
 				{
 					//找眼睛
-					astFaceTemp.stCustomerCover.bShowEyes = FALSE;
+					astFaceTemp.stCustomerCover.bShowEyes = false;
 					//找鼻子
-					astFaceTemp.stCustomerCover.bShowNose = FALSE;
+					astFaceTemp.stCustomerCover.bShowNose = false;
 					//找嘴巴
-					astFaceTemp.stCustomerCover.bShowMouth = FALSE;
+					astFaceTemp.stCustomerCover.bShowMouth = false;
 				}
 
 				if(!(astFaceTemp.stCustomerCover.bShowEyes||astFaceTemp.stCustomerCover.bShowNose||astFaceTemp.stCustomerCover.bShowMouth))
 				{
-					astFaceTemp.stCustomerCover.bClearFace = FALSE;
+					astFaceTemp.stCustomerCover.bClearFace = false;
 				}
 				else
 				{
-					astFaceTemp.stCustomerCover.bClearFace = TRUE;
+					astFaceTemp.stCustomerCover.bClearFace = true;
 				}
 				//计算当前人脸位置如果当前人脸位置与上次人脸位置小于偏移量则取上次人脸位置,防止人脸图像跳变
 				//坐标变换
@@ -1117,7 +1122,7 @@ private:
 				pfaceSeq = NULL;
 			}
 			cvResetImageROI(m_pProcessImg);
-			return TRUE;
+			return true;
 	}
 
 	//人脸卡图
@@ -1132,7 +1137,7 @@ private:
 			}
 			else if (m_bCapFaceCompleted)
 			{
-				m_bCapFaceCompleted = FALSE;
+				m_bCapFaceCompleted = false;
 				m_nCapFaceNum = 0;
 			}
 			m_pHostApi->GetFaceImgName(m_SaveImgName, MAX_PATH);
@@ -1145,7 +1150,7 @@ private:
 
 		if (m_stAllFaceInfo.nTatolFaceNum >0)
 		{
-			BOOL bRst = GetImage(m_stAllFaceInfo.astFaceInfo[0].eCamera);
+			bool bRst = GetImage(m_stAllFaceInfo.astFaceInfo[0].eCamera);
 			if (!bRst)
 			{
 				return;
@@ -1219,7 +1224,7 @@ private:
 							else
 							{
 								SaveOperatorFace(m_SaveImgName);
-								m_bCapFaceCompleted = TRUE;
+								m_bCapFaceCompleted = true;
 								m_nCapFaceNum = 0;
 							}
 					//}
@@ -1232,7 +1237,7 @@ private:
 		}
 	}
 	//保存人脸图像
-	BOOL SaveOperatorFace(char*filename)
+	bool SaveOperatorFace(char*filename)
 	{
 		//for(int i=0;i<3;i++)
 		//{
@@ -1253,16 +1258,16 @@ private:
 			}
 		}
 		m_nCapFaceNum = 0;
-		return TRUE;
+		return true;
 	}
 	//调整图像亮度
-	BOOL AdjustImgBrightness(char* src,int width,int height,CBrightAdjParam stAdjParam,int ImgColorType = RGB_IMG)
+	bool AdjustImgBrightness(char* src,int width,int height,CBrightAdjParam stAdjParam,int ImgColorType = RGB_IMG)
 	{
 		if(stAdjParam.fLow<0&&stAdjParam.fLow>1&&stAdjParam.fHigh<0&&stAdjParam.fHigh>1
 			&&stAdjParam.fBottom<0&&stAdjParam.fBottom>1&&stAdjParam.fTop<0&&stAdjParam.fTop>1&& stAdjParam.fLow>stAdjParam.fHigh)
-			return FALSE;
+			return false;
 		if (((stAdjParam.fHigh-0.0)<0.001)&&((stAdjParam.fTop-0.0)<0.001))
-			return FALSE;
+			return false;
 		double low2 = stAdjParam.fLow*255;
 		double high2 = stAdjParam.fHigh*255;
 		double bottom2 = stAdjParam.fBottom*255;
@@ -1294,7 +1299,7 @@ private:
 				((uchar*)(src + width*nChannels*y))[x] = (uchar) val;
 			}
 		}
-		return TRUE;
+		return true;
 	}
 
 	//形态学结构元素的映射
@@ -1361,13 +1366,13 @@ private:
 		}
 	}
 	//在运动跟踪后根据运动跟踪结果检测是否有人靠近
-	BOOL FaceSearch(CMotionTrackRslt stObjTrackRslt,UINT nFaceLimit)
+	bool FaceSearch(CMotionTrackRslt stObjTrackRslt, uint32_t nFaceLimit)
 	{
 		int nFaceNum = 0;
 		//人脸搜索
 		if (m_pFaceCascade == NULL)
 		{
-			return FALSE;
+			return false;
 		}
 		for(int i=0;i<m_stObjTrackRslt.nObjNum;i++)
 		{
@@ -1450,25 +1455,25 @@ private:
 		{
 			//发现有人
 			m_stAllFaceInfo.nTatolFaceNum = nFaceNum;
-			return TRUE;
+			return true;
 		}
 		else
 		{
 			m_eMonitorState = NoBody;
 			m_stAllFaceInfo.nTatolFaceNum = 0;
-			return FALSE;
+			return false;
 		}
 	}
 
 	//对图像进行全局搜索
-	BOOL FaceSearch(UINT nFaceLimit)
+	bool FaceSearch(uint32_t nFaceLimit)
 	{
 		int nFaceNum = 0;
 		int nCurafaceSerial = 0;
 		//人脸搜索
 		if (m_pFaceCascade == NULL)
 		{
-			return FALSE;
+			return false;
 		}
 		cvResetImageROI(m_pProcessImg);
 		CvRect* pFaceRect = NULL;		//人脸矩形
@@ -1542,22 +1547,22 @@ private:
 		{
 			//发现有人
 			m_stAllFaceInfo.nTatolFaceNum = nFaceNum;
-			return TRUE;
+			return true;
 		}
 		else
 		{
 			m_eMonitorState = NoBody;
-			return FALSE;
+			return false;
 		}
 	}
 
 	//运动检测
-	BOOL MotionTrack(CameraEnum eCamera,int diff_threshold = 10)
+	bool MotionTrack(CameraEnum eCamera,int diff_threshold = 10)
 	{
 		if (!GetImage(eCamera))
 		{
 			//RecordError("运动跟踪获取图像失败");
-			return FALSE;
+			return false;
 		}
 		cvResetImageROI(m_pProcessImg);
 		memset(&m_stObjTrackRslt,0,sizeof(CMotionTrackRslt));
@@ -1654,11 +1659,11 @@ private:
 		cvResetImageROI(m_pProcessImg);
 		if (m_stObjTrackRslt.nObjNum >0)
 		{
-			return TRUE;
+			return true;
 		} 
 		else
 		{
-			return FALSE;
+			return false;
 		}
 	}
 
@@ -1739,11 +1744,11 @@ private:
 	}
 
 	// 计算当前人脸是否进入另外一个相机的最佳视野中
-	BOOL IsFacePosOverStep(CameraEnum eCamera,CvRect FaceRect)
+	bool IsFacePosOverStep(CameraEnum eCamera,CvRect FaceRect)
 	{
 		if(m_pOperatorVideoQueue == NULL)
 		{
-			return FALSE;
+			return false;
 		}
 
 		if(EnvironCamera == eCamera)
@@ -1751,27 +1756,27 @@ private:
 			if(((FaceRect.x > (m_nImgWidth/2-m_nImgHeight/2+m_nImgHeight/m_stFaceConfig.fDetectFaceSize/2))|| (FaceRect.x < (m_nImgWidth/2+m_nImgHeight/2-m_nImgHeight/m_stFaceConfig.fDetectFaceSize/2)))&&
 			   (FaceRect.y > (m_nImgHeight-m_nImgHeight/m_stFaceConfig.fDetectFaceSize*4/m_stFaceConfig.nUpCameraEdgeLimit)))
 			{
-				return TRUE;
+				return true;
 			}
 			else
 			{
-				return FALSE;
+				return false;
 			}
 		} 
 		else if(OperatorCamera == eCamera)
 		{
 			if(FaceRect.y < ((m_nImgHeight/m_stFaceConfig.fDetectFaceSize)*1/m_stFaceConfig.nDownCameraEdgeLimit))
 			{
-				return TRUE;
+				return true;
 			}
 			else
 			{
-				return FALSE;
+				return false;
 			}
 		}
 		else
 		{
-			return FALSE;
+			return false;
 		}
 	}
 
@@ -1900,38 +1905,41 @@ private:
 
 	int VideoMonitor()
 	{
-		BOOL bRst = FALSE;
-		UINT nSearchFailNum = 0;   //搜索人脸失败次数
-		UINT nDetectFailNum = 0;   //检测人脸失败的次数
-		UINT nBreakDownNum = 0;
-		UINT nMotionTrackNum = 0;
+		bool bRst = false;
+		uint32_t nSearchFailNum = 0;   //搜索人脸失败次数
+		uint32_t nDetectFailNum = 0;   //检测人脸失败的次数
+		uint32_t nBreakDownNum = 0;
+		uint32_t nMotionTrackNum = 0;
 		//select camera
 		if (m_pOperatorVideoQueue != NULL)
 		{
+			m_pHostApi->Debug("m_pOperatorVideoQueue != NULL.");
 			m_eCamera = (CameraEnum)m_stFaceConfig.nPrimCamera;
 		}
 		else
 		{
-			if((m_nCameraStae == 0)||(m_nCameraStae ==2))
+			if((m_nCameraState == 0)||(m_nCameraState ==2))
 			{
 				m_eCamera = EnvironCamera;
 			}
-			else if (m_nCameraStae == 1)
+			else if (m_nCameraState == 1)
 			{
 				m_eCamera = OperatorCamera;
 			}
-			else if (m_nCameraStae == 3)
+			else if (m_nCameraState == 3)
 			{
 				m_eCamera = ErrorCamera;
 			}
-			
 		}
+
+		m_pHostApi->Debug("m_eCamera = %d, m_nCameraState = %d.", m_eCamera, m_nCameraState);
+
 		while (!m_bStopVieoMonitor)
 		{
 			try 
 			{
 				//如果摄像头没启动或故障,停止扫描,休眠5s
-				if (m_nCameraStae == 3)
+				if (m_nCameraState == 3)
 				{
 					FSleep(2000);
 					m_pHostApi->Debug("camera stop or all camera error!");
@@ -1942,11 +1950,12 @@ private:
 				{
 					ReleaseMotionTrackRst();
 					nMotionTrackNum=0;
-					m_bLightChange = FALSE;
+					m_bLightChange = false;
 				}
 				//if no people,start motion tracker
 				if(NoBody == m_eMonitorState)
 				{
+					m_pHostApi->Debug("NoBody");
 					////if no people,start motion tracker
 					//bRst =  MotionTrack(m_eCamera,m_stFaceConfig.nThresholdNum);	
 					//if (!bRst)
@@ -1965,7 +1974,7 @@ private:
 					//}
 					//else
 					//{
-					//	if (!m_bLightChange&&(m_nCameraStae != 3))
+					//	if (!m_bLightChange&&(m_nCameraState != 3))
 					//	{
 					//		m_pHostEvent->GenerateAppearEvent();	//产生有人出现事件
 					//		m_pHostApi->Debug("运动跟踪,有人出现!");
@@ -2334,35 +2343,34 @@ private:
 		return 0;
 	}
 
-	static unsigned int __stdcall VideoMonitorThread(LPVOID n)
+	static unsigned int __stdcall VideoMonitorThread(void* pParam)
 	{
-	   	Clibfacecapture_impl*VideoFaceMonitor = (Clibfacecapture_impl*)n;
+	   	Clibfacecapture_impl* VideoFaceMonitor = (Clibfacecapture_impl*)pParam;
 		return VideoFaceMonitor->VideoMonitor();
 	}
+
 public:
 	//开始视频监控,pHost:事件,nMonitorFreq:监控频率,单位ms,MonitorType:监控类型,有三种模式可供选择
-	BOOL StartVideoMonitor(CHostApi *pHostAPI,CVideoMonitorEvent*pHost,MonitorEnum eMonitorType)
+	bool StartVideoMonitor(CHostApi *pHostAPI, CVideoMonitorEvent*pHost, MonitorEnum eMonitorType)
 	{
-
-		if (m_hVieoMonitorThread == NULL)
-		{
+		if (m_hVieoMonitorThread == NULL){
 			m_pHostApi->Debug("create video monitor thread.");
-			m_hVieoMonitorThread = (HANDLE)_beginthreadex(NULL, 0, VideoMonitorThread, (LPVOID)this, 0, (unsigned int*)& m_nVieoMonitorThreadId);
+			m_hVieoMonitorThread = (HANDLE)_beginthreadex(NULL, 0, VideoMonitorThread, this, 0, (unsigned int*)&m_nVieoMonitorThreadId);
 		}
-		return TRUE;
+		return true;
 	}
 	//停止视频监控
-	BOOL StopVideoMonitor()
+	bool StopVideoMonitor()
 	{
-		m_bStopVieoMonitor = TRUE;
+		m_bStopVieoMonitor = true;
 		SetEvent(m_hStopEventWait);
 		WaitForSingleObject(m_hVieoMonitorThread, INFINITE);
 		CloseHandle(m_hVieoMonitorThread);
 		m_hVieoMonitorThread = NULL;
-		return TRUE;
+		return true;
 	}
 	//快照
-	BOOL SnapShot(CImageFrame&img)
+	bool SnapShot(CImageFrame&img)
 	{
 		//if((m_stAllFaceInfo.astFaceInfo[0].eCamera == EnvironCamera)||(m_stAllFaceInfo.astFaceInfo[0].eCamera == 0) )
 		//{
@@ -2476,18 +2484,18 @@ public:
 		//	delete videoframe;
 		//	AdjustImgBrightness((char*)img.data,img.width,img.height,m_stBrightAdjParam,NULL);
 		//}
-		return TRUE;
+		return true;
 	}
 	//有多少其他用户
-	BOOL GetCustomerNum(UINT&num)
+	bool GetCustomerNum(uint32_t& num)
 	{
 		EnterCriticalSection(&CS);
 		num = m_stFaceRstStorage.nTatolFaceNum;
 		LeaveCriticalSection(&CS);
-		return TRUE;
+		return true;
 	}
 	//获取主用户的常规属性
-	BOOL GetMainCustomerStatus(CUUID&FaceID,CCustomerStatus &Property)
+	bool GetMainCustomerStatus(CUUID&FaceID, CCustomerStatus &Property)
 	{
 		EnterCriticalSection(&CS);
 		//Property.eBrightness				= m_stFaceRstStorage.astFaceInfo[0].eBrightness;
@@ -2501,15 +2509,15 @@ public:
 		Property.stCustomerPos.stRange.sH	= (short)m_stFaceRstStorage.astFaceInfo[0].stRegion.stUpperBodyRect.height/2;
 		FaceID	= m_stFaceRstStorage.astFaceInfo[0].FaceID;
 		LeaveCriticalSection(&CS);
-		return TRUE;
+		return true;
 	}
 
 	//获取用户的常规属性
-	BOOL GetCustomerStatus(CUUID FaceID,CCustomerStatus &Property)
+	bool GetCustomerStatus(CUUID FaceID, CCustomerStatus &Property)
 	{
 		EnterCriticalSection(&CS);
-		BOOL bSearch = FALSE;
-		for (int i =0;i<m_stFaceRstStorage.nTatolFaceNum&&!bSearch;i++)
+		bool bSearch = false;
+		for (int i =0; i<m_stFaceRstStorage.nTatolFaceNum&&!bSearch; i++)
 		{
 			if(m_stFaceRstStorage.astFaceInfo[i].FaceID == FaceID)
 			{
@@ -2524,15 +2532,15 @@ public:
 				Property.stCustomerPos.stRange.sY	= m_stFaceRstStorage.astFaceInfo[i].stRegion.stUpperBodyRect.y
 					+(short)m_stFaceRstStorage.astFaceInfo[i].stRegion.stUpperBodyRect.height/2-(short)m_nImgHeight/2;
 				Property.stCustomerPos.stRange.sH	= (short)m_stFaceRstStorage.astFaceInfo[i].stRegion.stUpperBodyRect.height/2;
-				bSearch = TRUE;
+				bSearch = true;
 			}
 		}
 		LeaveCriticalSection(&CS);
-		return TRUE;
+		return true;
 	}
 
 	//获取所有用户FACEID
-	BOOL GetTrackFace(CUUID *arrFaceIDs, int *size)
+	bool GetTrackFace(CUUID *arrFaceIDs, int *size)
 	{
 		EnterCriticalSection(&CS);
 		for (int i = 0;i<m_stFaceRstStorage.nTatolFaceNum && i < *size;i++)
@@ -2540,13 +2548,14 @@ public:
 			arrFaceIDs[i] = m_stFaceRstStorage.astFaceInfo[i].FaceID;
 		}
 		LeaveCriticalSection(&CS);
-		return TRUE;
+		return true;
 	}
+
 	//获取用户的交互属性
-	BOOL GetCustomerAppearance(CUUID FaceID,CCustomerAppearance &Property)
+	bool GetCustomerAppearance(CUUID FaceID,CCustomerAppearance &Property)
 	{
 		EnterCriticalSection(&CS);
-		BOOL bSearch = FALSE;
+		bool bSearch = false;
 		for (int i =0;i<m_stFaceRstStorage.nTatolFaceNum&&!bSearch;i++)
 		{
 			if(m_stFaceRstStorage.astFaceInfo[i].FaceID == FaceID)
@@ -2554,11 +2563,11 @@ public:
 				Property.eHeight	=m_stFaceRstStorage.astFaceInfo[i].eHeight;
 				Property.eSex		= m_stFaceRstStorage.astFaceInfo[i].eSex;
 				Property.eYoungOld	= m_stFaceRstStorage.astFaceInfo[i].eYoungOld;
-				bSearch = TRUE;
+				bSearch = true;
 			}
 		}
 		LeaveCriticalSection(&CS);
-		return TRUE;
+		return true;
 	}
 };
 
@@ -2574,32 +2583,32 @@ Clibfacecapture::~Clibfacecapture(void)
 	delete m_pImpl;
 }
 //快照
-BOOL Clibfacecapture::SnapShot(CImageFrame&img)
+bool Clibfacecapture::SnapShot(CImageFrame&img)
 {
 	return m_pImpl->SnapShot(img);	
 }
 //有多少其他用户
-BOOL Clibfacecapture::GetCustomerNum(UINT&num)
+bool Clibfacecapture::GetCustomerNum(uint32_t& num)
 {
 	return m_pImpl->GetCustomerNum(num);
 }
 //获取主用户的常规属性
-BOOL Clibfacecapture::GetMainCustomerStatus(CUUID&FaceID,CCustomerStatus &Property)
+bool Clibfacecapture::GetMainCustomerStatus(CUUID&FaceID,CCustomerStatus &Property)
 {
 	return m_pImpl->GetMainCustomerStatus(FaceID,Property); 
 }
 //获取其他用户的常规属性
-BOOL Clibfacecapture::GetCustomerStatus (CUUID FaceID,CCustomerStatus &Property)
+bool Clibfacecapture::GetCustomerStatus (CUUID FaceID,CCustomerStatus &Property)
 {
 	return m_pImpl->GetCustomerStatus(FaceID,Property);	 
 }
 //获取主用户的交互属性
-BOOL Clibfacecapture::GetCustomerAppearance(CUUID FaceID,CCustomerAppearance &Property)
+bool Clibfacecapture::GetCustomerAppearance(CUUID FaceID,CCustomerAppearance &Property)
 {
 	return m_pImpl->GetCustomerAppearance(FaceID,Property);
 }
 //获取所有用户FACEID
-BOOL Clibfacecapture::GetTrackFace(CUUID *arrFaceIDs, int *size)
+bool Clibfacecapture::GetTrackFace(CUUID *arrFaceIDs, int *size)
 {
 	return m_pImpl->GetTrackFace(arrFaceIDs, size);
 }
@@ -2607,13 +2616,13 @@ BOOL Clibfacecapture::GetTrackFace(CUUID *arrFaceIDs, int *size)
 //灯光变化
 void Clibfacecapture::SetLightChange()
 {
-	 m_pImpl->m_bLightChange = TRUE;
+	 m_pImpl->m_bLightChange = true;
 }
 
 //相机状态
 void Clibfacecapture::SetCameraState(int nState)
 {
-	m_pImpl->m_nCameraStae = nState;
+	m_pImpl->m_nCameraState = nState;
 }
 
 bool Clibfacecapture::StartFaceCapture()
@@ -2626,11 +2635,11 @@ bool Clibfacecapture::StopFaceCapture()
 	return m_pImpl->StopFaceCapture();
 }
 
-BOOL SnapShot(CImageFrame*img)
+bool SnapShot(CImageFrame*img)
 {
 	if(img == NULL)
 	{
-		return FALSE;
+		return false;
 	}
 	IplImage*cvimgtmp = cvCreateImage(cvSize(img->width,img->height),8,3);
 	IplImage*cvimg = cvCreateImage(cvSize(img->width,img->height),8,3);
@@ -2647,5 +2656,5 @@ BOOL SnapShot(CImageFrame*img)
 	memcpy(img->data,cvimgtmp->imageData,img->framesize);
 	cvReleaseImage(&cvimg);
 	cvReleaseImage(&cvimgtmp);
-	return TRUE;
+	return true;
 }

+ 16 - 16
Other/win/libfacecapture/libfacecapture.h

@@ -85,10 +85,10 @@ struct CCustomerPosition
 //脸部覆盖物
 struct  CCover
 {
-	BOOL	bClearFace;		//脸部是否可见
-	BOOL	bShowEyes;		//眼睛是否可见
-	BOOL	bShowNose;		//鼻子是否可见
-	BOOL	bShowMouth;		//嘴巴是否可见
+	bool	bClearFace;		//脸部是否可见
+	bool	bShowEyes;		//眼睛是否可见
+	bool	bShowNose;		//鼻子是否可见
+	bool	bShowMouth;		//嘴巴是否可见
 };
 
 //人脸亮度
@@ -112,8 +112,8 @@ struct CCustomerStatus
 enum SexEnum
 {
 	UncertainSex = 0,	//不知道
-	Women,				//女
-	Man					// 
+	Women,				//女
+	Man					//男
 };
 
 enum YoungOldEnum
@@ -135,9 +135,9 @@ enum HeightEnunm
 //客户交互属性
 struct CCustomerAppearance
 {
-	SexEnum eSex;			// 0不知道,1女,2男
-	YoungOldEnum eYoungOld;	//0不知道,1小孩,2年轻人,3中年人,4老人
-	HeightEnunm eHeight;		//0不知道,1矮,2中等,3高
+	SexEnum eSex;				// 0不知道,1女,2男
+	YoungOldEnum eYoungOld;		// 0不知道,1小孩,2年轻人,3中年人,4老人
+	HeightEnunm eHeight;		// 0不知道,1矮,2中等,3高
 };
 
 //监控模式
@@ -200,24 +200,24 @@ public:
 	bool StopFaceCapture();
 
 	//快照
-	BOOL SnapShot(CImageFrame&img);
+	bool SnapShot(CImageFrame&img);
 	//有多少其他用户
-	BOOL GetCustomerNum(UINT&num);
+	bool GetCustomerNum(uint32_t &num);
 	//获取所有用户FACEID
-	BOOL GetTrackFace(__int64 *arrFaceIDs, int *size);
+	bool GetTrackFace(__int64 *arrFaceIDs, int *size);
 	//获取主用户的常规属性
-	BOOL GetMainCustomerStatus(__int64 &FaceID,CCustomerStatus &Property);
+	bool GetMainCustomerStatus(__int64 &FaceID,CCustomerStatus &Property);
 	//获取其他用户的常规属性
-	BOOL GetCustomerStatus(__int64 FaceID,CCustomerStatus &Property);
+	bool GetCustomerStatus(__int64 FaceID,CCustomerStatus &Property);
 	//获取主用户的交互属性
-	BOOL GetCustomerAppearance(__int64 FaceID,CCustomerAppearance &Property);
+	bool GetCustomerAppearance(__int64 FaceID,CCustomerAppearance &Property);
 	void SetLightChange();//灯光变化,此时算法要做处理防止误判
 	void SetCameraState(int nState);
 private:
 	Clibfacecapture_impl*m_pImpl;  
 };
 
-BOOL LIBFACECAPTURE_API  SnapShot(CImageFrame*img);
+bool LIBFACECAPTURE_API  SnapShot(CImageFrame*img);
 
 #endif	
 

+ 0 - 252
Other/win/libfacecapture/logfile.cpp

@@ -1,252 +0,0 @@
-#include "stdafx.h"
-#include <strstream>
-#include "logfile.h"
-
-CLogFile::CLogFile()
-{
-/*
-** Open File
-*/
-	m_cOutFile = new ofstream("D:\\avirecordfile\\log.log", ios_base::out);	
-    if (!m_cOutFile->is_open())
-    {
-		MessageBox(NULL,"Unable to create log file","´íÎó", MB_OK|MB_ICONSTOP);        
-        delete m_cOutFile;
-        m_cOutFile = NULL;
-    }
-}
-
-CLogFile::CLogFile(char* tszFileName)
-{
-	m_cOutFile = new ofstream(tszFileName, ios_base::out);	
-    if (!m_cOutFile->is_open())
-    { 
-		MessageBox(NULL,"Unable to create log file","´íÎó", MB_OK|MB_ICONSTOP); 
-        delete m_cOutFile;
-        m_cOutFile = NULL;
-    }
-}
-
-CLogFile::~CLogFile()
-{
-/*
-** Close the file and do clean up
-*/
-    m_cOutFile->close();
-    delete m_cOutFile;
-    m_cOutFile = NULL;
-}
-
-void CLogFile::Output(const TCHAR *data)
-{
-	m_cOutFile->write(data,strlen(data));
-}
-
-void CLogFile::PrintCurTime()
-{
-    TCHAR dateString[52];
-    SYSTEMTIME cur;
-    GetSystemTime(&cur);
-
-    sprintf(dateString,"[%d-%d-%d,%d:%d:%d]  ", cur.wYear, cur.wMonth, 
-            cur.wDay, cur.wHour, cur.wMinute, cur.wSecond);
-
-    Output(dateString);
-}
-
-CLogFile& CLogFile::operator <<(unsigned int unVal)
-{
-    strstream tmp;
-    tmp << unVal;
-    tmp << '\0';
-
-    TCHAR* output = tmp.str();
-
-    Output(output);
-
-    tmp.freeze(false);
-	return *this;
-}
-
-CLogFile& CLogFile::operator <<(long lVal)
-{
-    strstream tmp;
-    tmp << lVal;
-    tmp << '\0';
-
-    TCHAR* output = tmp.str();
-
-    Output(output);
-
-    tmp.freeze(false);
-
-	return *this;
-}
-
-CLogFile& CLogFile::operator <<(const TCHAR* str)
-{
-    Output(str);
-	return *this;
-}
-
-CLogFile& CLogFile::operator <<(TCHAR	tch)
-{
-    TCHAR szCh[2];
-    szCh[0] = tch;
-    szCh[1] = '\0';
-    Output(szCh);
-    return *this;
-}
-
-CLogFile& CLogFile::operator <<(int nVal)
-{
-    strstream tmp;
-    tmp << nVal;
-    tmp << '\0';
-
-    TCHAR* output = tmp.str();
-
-    Output(output);
-
-    tmp.freeze(false);
-    return *this;
-}
-
-CLogFile& CLogFile::operator <<(unsigned long ulVal)
-{
-    strstream tmp;
-    tmp << ulVal;
-    tmp << '\0';
-
-    TCHAR* output = tmp.str();
-    Output(output);
-    tmp.freeze(false);
-	return *this;
-}
-
-CLogFile& CLogFile::operator <<(double dVal)
-{
-    strstream tmp;
-    tmp << dVal;
-    tmp << '\0';
-
-    TCHAR* output = tmp.str();
-    Output(output);
-    tmp.freeze(false);
-	return *this;
-}
-
-CLogFile& CLogFile::operator <<(unsigned __int64	unllVal)
-{
-	strstream tmp;
-	tmp << unllVal;
-	tmp << '\0';
-
-	TCHAR* output = tmp.str();
-	Output(output);
-	tmp.freeze(false);
-	return *this;
-}
-
-void CLogFile::LOGERROR(TCHAR* formatString, ...)
-{
-
-	/*
-	** Insert the current time..
-	*/
-	PrintCurTime();
-	/*
-	** Parse the format string and write to the file
-	*/
-	if ( formatString == NULL)
-	{
-        /*
-		** No point in continuiing
-		*/
-		return;
-	}
-		
-	va_list argList;
-	/*
-	** Set va_list to the beginning of optional arguments
-	*/
-	va_start(argList, formatString);
-	TCHAR* ptr = formatString;
-
-	while(*ptr != '\0')
-	{
-		TCHAR* str			= NULL;
-		int nInteger		= 0;
-		unsigned int unInt	= 0;
-		long lLong			= 0;
-		unsigned long ulLong= 0;
-		double	dDoub		= 0;
-		unsigned __int64 ullLong = 0;
-		if(*ptr == '%')
-		{
-			switch(*(ptr+1))
-			{
-			case 's':
-				str = va_arg(argList, TCHAR*);
-
-				if( NULL == str)
-					break;
-				*this << str;
-				ptr++;
-				break;
-
-			case 'd':
-				nInteger = va_arg(argList, int);
-				*this << nInteger;
-				ptr++;
-				break;
-
-			case 'u':
-				unInt = va_arg(argList, unsigned int);
-				*this << unInt;
-				ptr++;
-				break;
-				
-			case 'l':
-				ptr++;
-				if(*(ptr+1) == 'd')
-				{
-					lLong = va_arg(argList, long);
-					*this << lLong;
-					ptr++;
-				}
-				else if(*(ptr+1) == 'u')
-				{
-					ulLong = va_arg(argList, unsigned long);
-					*this << ulLong;
-					ptr++;
-				}
-				else if(*(ptr+1) == 'q')
-				{
-					ullLong = va_arg(argList, unsigned __int64);
-					*this << ullLong;
-					ptr++;
-				}
-				break;
-			case 'f':
-				dDoub = va_arg(argList, double);
-				*this << dDoub;
-				ptr++;
-				break;
-			default:
-				*this << *ptr;
-			}
-		} //  if(*ptr == '%')
-		else
-		{
-			*this << *ptr;
-		}
-		/*
-		** Increment pointer..
-		*/
-		ptr++;
-	}
-
-	*this << '\n';
-
-}

+ 0 - 43
Other/win/libfacecapture/logfile.h

@@ -1,43 +0,0 @@
-
-#ifndef __LOGFILE__H__
-#define __LOGFILE__H__
-
-
-/*
-** Include fstream header
-*/
-#ifndef _FSTREAM_
-
-#include <fstream>
-using namespace std;
-
-#endif
-
-
-
-class CLogFile  
-{
-public:
-	void PrintCurTime();
-	CLogFile();
-	CLogFile(char* tszFileName);
-	~CLogFile();
-	CLogFile& operator <<(long				lVal);
-	CLogFile& operator <<(const		TCHAR*	str);
-	CLogFile& operator <<(TCHAR				tch);
-	CLogFile& operator <<(int				nVal);
-	CLogFile& operator <<(unsigned	long	ulVal);
-	CLogFile& operator <<(double			dVal);
-	CLogFile& operator <<(unsigned	int		unVal);
-	CLogFile& operator <<(unsigned	__int64	unllVal);
-	void	  LOGERROR(TCHAR* formatString, ...);
-
-
-private:
-	ofstream	*m_cOutFile;
-	void		Output( const TCHAR* data);
-
-
-};
-
-#endif	// __LOGFILE__H__