From ef488d9af77b77877d665d64dcab78bae312bc2a Mon Sep 17 00:00:00 2001 From: xkzou Date: Wed, 27 Jan 2021 19:23:23 +0800 Subject: [PATCH] 授权失败修改 --- src/left_over/MSRegionSurveilance.cpp | 2 +- src/left_over/help.cpp | 48 ++++++++++++++++++++++++------------------------ src/left_over/svibe.cpp | 442 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- win/.vs/leftover/v14/.suo | Bin 105984 -> 0 bytes win/leftover.VC.VC.opendb | Bin 46 -> 0 bytes win/leftover.VC.db | Bin 64987136 -> 0 bytes 6 files changed, 246 insertions(+), 246 deletions(-) delete mode 100644 win/leftover.VC.VC.opendb diff --git a/src/left_over/MSRegionSurveilance.cpp b/src/left_over/MSRegionSurveilance.cpp index c212679..3120082 100644 --- a/src/left_over/MSRegionSurveilance.cpp +++ b/src/left_over/MSRegionSurveilance.cpp @@ -10,7 +10,7 @@ IRegionSurveillance *MS_RegionSurveillance::GetMS_RS() //if (!MS_RS) { RegionSurveillance * MS_RS = nullptr; - if (checkTime() == 1 && (MS_RS = new RegionSurveillance())) + if (/*checkTime() == 1 &&*/ (MS_RS = new RegionSurveillance())) return MS_RS; else { diff --git a/src/left_over/help.cpp b/src/left_over/help.cpp index 8ba4dd1..e0b5790 100644 --- a/src/left_over/help.cpp +++ b/src/left_over/help.cpp @@ -1,8 +1,8 @@ /************************************************************* /* name: help.cpp -/* Description: -/* Purposeϲ -/* 1 аС 2 򽻲 3 +/* Description: ������������ +/* Purpose�����������������ϲ������� +/* 1 ����а���С�� 2 �򽻲� 3 ������ /* Update Time: by zl 20160307 **************************************************************/ #include "help.h" @@ -11,7 +11,7 @@ #include #include using namespace std; -// +//���� bool SortByPoint(const CForeground &C1,const CForeground &C2) { bool sign = false; @@ -28,7 +28,7 @@ bool SortByPoint(const CForeground &C1,const CForeground &C2) return false; } -//ӴС +//�Ӵ�С bool SortByArea(const CForeground &C1, const CForeground &C2) { bool sign = false; @@ -38,7 +38,7 @@ bool SortByArea(const CForeground &C1, const CForeground &C2) return false; } -//жxǷڱ߽ +//�ж�x�Ƿ��ڱ߽��� bool InRange(int x, int boundary1, int boundary2) { int max_b = boundary1 >= boundary2 ? boundary1 : boundary2; @@ -49,33 +49,33 @@ bool InRange(int x, int boundary1, int boundary2) return false; } -//ڻ߰ +//���ڻ��߰��� bool NeighbourorSub(CForeground c1, CForeground c2) { - //c2ĵc1ڲ Ҫϲ true + //c2���ĵ���c1�ڲ� ��Ҫ�ϲ� ����true /*if (c2.m_ptCenter.x < c1.m_rtConnect.right && InRange(c2.m_ptCenter.y, c1.m_rtConnect.top, c1.m_rtConnect.bottom)) return true; else */ - //Ϊc2һc1Ҳ ߰ c2µ ϵ ϶һc1ڲ + //��������Ϊc2һ����c1���Ҳ� �����������߰��� c2�����µ� ���� ���ϵ� �϶�������һ����c1���ڲ� if (c2.m_rtConnect.left <= c1.m_rtConnect.right) { - //߽ + //�������߽��� if (InRange(c2.m_rtConnect.bottom, c1.m_rtConnect.top, c1.m_rtConnect.bottom) || InRange(c2.m_rtConnect.top, c1.m_rtConnect.top, c1.m_rtConnect.bottom)) return true; - //Ϸڽ ·ڽ + //�Ϸ��ڽ� ���� �·��ڽ� else if (abs(c1.m_rtConnect.top - c2.m_rtConnect.bottom) < MergeMinDistance || abs(c1.m_rtConnect.bottom - c2.m_rtConnect.top) < MergeMinDistance) return true; } else if (InRange(c2.m_rtConnect.bottom, c1.m_rtConnect.top, c1.m_rtConnect.bottom) || InRange(c2.m_rtConnect.top, c1.m_rtConnect.top, c1.m_rtConnect.bottom)) { - if((abs(c1.m_rtConnect.right - c2.m_rtConnect.left) < MergeMinDistance)) //c2 c1 Ҳ ڽ + if((abs(c1.m_rtConnect.right - c2.m_rtConnect.left) < MergeMinDistance)) //c2 �� c1 �Ҳ� �ڽ� return true; } return false; } -//ϲ +//�ϲ� void MergeNeighborBox(vector &ForegroundArray) { vector::iterator iter1 = ForegroundArray.begin(); @@ -84,23 +84,23 @@ void MergeNeighborBox(vector &ForegroundArray) vector::iterator iter2 = iter1 + 1; for (; iter2 != ForegroundArray.end(); ) { - //if ((x2 <= iter1->m_rtConnect.right && y2 <= iter1->m_rtConnect.bottom && y2 >= iter1->m_rtConnect.top) || //С״ - // (iter2->m_rtConnect.left <= iter1->m_rtConnect.right && iter2->m_rtConnect.bottom <= iter1->m_rtConnect.bottom && iter2->m_rtConnect.bottom >= iter1->m_rtConnect.top) || //򽻲 Ͻڵһ - // (iter2->m_rtConnect.left <= iter1->m_rtConnect.right && iter2->m_rtConnect.top <= iter1->m_rtConnect.bottom && iter2->m_rtConnect.top >= iter1->m_rtConnect.top) ||//򽻲 ½ڵһ - // iter2->m_rtConnect.left <= iter1->m_ptCenter.x && abs(iter2->m_rtConnect.bottom - iter1->m_rtConnect.top) < 10 ||//Ͻ + //if ((x2 <= iter1->m_rtConnect.right && y2 <= iter1->m_rtConnect.bottom && y2 >= iter1->m_rtConnect.top) || //���С��״�� + // (iter2->m_rtConnect.left <= iter1->m_rtConnect.right && iter2->m_rtConnect.bottom <= iter1->m_rtConnect.bottom && iter2->m_rtConnect.bottom >= iter1->m_rtConnect.top) || //�򽻲� ���Ͻ��ڵ�һ������ + // (iter2->m_rtConnect.left <= iter1->m_rtConnect.right && iter2->m_rtConnect.top <= iter1->m_rtConnect.bottom && iter2->m_rtConnect.top >= iter1->m_rtConnect.top) ||//�򽻲� ���½��ڵ�һ������ + // iter2->m_rtConnect.left <= iter1->m_ptCenter.x && abs(iter2->m_rtConnect.bottom - iter1->m_rtConnect.top) < 10 ||//����Ͻ��� // iter2->m_rtConnect.left <= iter1->m_ptCenter.x && abs(iter2->m_rtConnect.top - iter1->m_rtConnect.bottom) < 10 || - // distance < 20 //Ͻ + // distance < 20 //����Ͻ��� // ) if (NeighbourorSub(*iter1, *iter2)) { - //ϲ + //�ϲ� iter1->m_rtConnect.left = min(iter1->m_rtConnect.left, iter2->m_rtConnect.left); iter1->m_rtConnect.bottom = max(iter1->m_rtConnect.bottom, iter2->m_rtConnect.bottom); iter1->m_rtConnect.right = max(iter1->m_rtConnect.right, iter2->m_rtConnect.right); iter1->m_rtConnect.top = min(iter1->m_rtConnect.top, iter2->m_rtConnect.top); iter1->m_ptCenter.x = (iter1->m_rtConnect.right + iter1->m_rtConnect.left) / 2; iter1->m_ptCenter.y = (iter1->m_rtConnect.bottom + iter1->m_rtConnect.top) / 2; - //ɾһ + //ɾ��һ�� iter2 = ForegroundArray.erase(iter2); iter1 = iter2; iter1--; @@ -108,8 +108,8 @@ void MergeNeighborBox(vector &ForegroundArray) else iter2++; //else - // break; //ForegroundArrayx ΪǰԺϲпһҲҪϲ - //ǰϺϲ һҲϣΪ˼ټ + // break; //����ForegroundArray��x�������� ������Ϊ�����ǰ���Ժϲ������п�����һ��Ҳ��Ҫ�ϲ��� + //������ǰ�����Ϻϲ� ����һ��Ҳ������ϣ�Ϊ�˼��ټ�������� } } @@ -125,9 +125,9 @@ int checkTime() nYear = info->tm_year + 1900; nMonth = info->tm_mon + 1; nDay = info->tm_mday; - if (nYear != 2020)//201711հ汾 + if (nYear != 2021)//2017��1��1�հ汾���� { - printf("汾ڣ\n"); + printf("�汾���ڣ�\n"); return -1; } else diff --git a/src/left_over/svibe.cpp b/src/left_over/svibe.cpp index fb6cd84..bd7d833 100644 --- a/src/left_over/svibe.cpp +++ b/src/left_over/svibe.cpp @@ -1,4 +1,4 @@ -// svibe.cpp : ̨Ӧóڵ㡣 +// svibe.cpp : �������̨Ӧ�ó������ڵ㡣 #include #include #include "svibe.h" @@ -13,20 +13,20 @@ #include "help.h" #include "left_over_det.h" /************************************************************************/ -/* : get_ArrowDir() by zl */ -/* : ȡڻƼͷ˵㣻 */ -/* : pROI0&pROI1˵㣻 */ -/* dirȷ򾯱㣻 */ -/* : 1:0: */ +/* ����: get_ArrowDir() by zl */ +/* ����: ��ȡ��������ڻ��Ƽ�ͷ�������˵㣻 */ +/* ����: pROI0&pROI1�����������˵㣻 */ +/* dir��ȷ�����򾯱����������㣻 */ +/* ����: 1:������0:������ */ /************************************************************************/ int RegionSurveillance::get_ArrowDir(CMPoint pROI0, CMPoint pROI1, CMPoint dir) { float distance = (float)abs(pROI0.y - pROI1.y); - //ȡ - float k1, k2; //k1Ϊԭ߶εб + //��ȡ���� + float k1, k2; //k1Ϊԭ�߶ε�б�� - if (pROI0.y > pROI1.y) //ڰ߿ͼ·Ķ˵㴦ͷ + if (pROI0.y > pROI1.y) //�ڰ��߿���ͼ���·��Ķ˵㴦����ͷ { pStart.x = pROI0.x; pStart.y = pROI0.y; @@ -37,18 +37,18 @@ int RegionSurveillance::get_ArrowDir(CMPoint pROI0, CMPoint pROI1, CMPoint dir) pStart.y = pROI1.y; } - if (pROI0.x != pROI1.x) //Ϊһֱ + if (pROI0.x != pROI1.x) //����Ϊһ����ֱ�� { k1 = (float)(pROI0.y - pROI1.y) / (float)(pROI0.x - pROI1.x); - if (k1 != 0) //Ϊһƽ + if (k1 != 0) //����Ϊһ��ƽ���� { k2 = -1 / k1; - float b = pROI1.y - k1 * pROI1.x;//y = kx + b ϵһͼ϶Ϊԭ㣬Ϊx Ϊy + float b = pROI1.y - k1 * pROI1.x;//y = kx + b ����ϵһͼ�����϶���Ϊԭ�㣬����Ϊx������ ����Ϊy������ if ((k1 < 0 && (float)((float)dir.y - k1 * (float)dir.x - b) < 0)||(k1 > 0 && (float)((float)dir.y - k1 * (float)dir.x - b) > 0)) { - if (distance < 30) //yֵСʱ߱Ƚ϶ ȥ20 ܵ¼ͷ̫ + if (distance < 30) //������yֵ�����Сʱ�����߱Ƚ϶� ����ȥ20 ���ܵ��¼�ͷ̫�� { pEnd.x = pStart.x - 2; } @@ -66,7 +66,7 @@ int RegionSurveillance::get_ArrowDir(CMPoint pROI0, CMPoint pROI1, CMPoint dir) } pEnd.y = (int)((pEnd.x - pStart.x) * k2 + pStart.y); } - else //Ϊˮƽ + else //��Ϊˮƽ�� { pEnd.x = pStart.x; if (dir.y > pStart.y) @@ -77,7 +77,7 @@ int RegionSurveillance::get_ArrowDir(CMPoint pROI0, CMPoint pROI1, CMPoint dir) } } - else //Ϊֱ + else //��Ϊ��ֱ�� { pEnd.y = pStart.y; if (dir.x > pStart.x) @@ -85,20 +85,20 @@ int RegionSurveillance::get_ArrowDir(CMPoint pROI0, CMPoint pROI1, CMPoint dir) else pEnd.x = pStart.x - 20; } - //ֹԽ + //��ֹԽ�� pEnd.x = pEnd.x >= 0 ? pEnd.x : 0; pEnd.x = pEnd.x <= GlobelWidth ? pEnd.x : GlobelWidth; pEnd.y = pEnd.y >= 0 ? pEnd.y : 0; pEnd.y = pEnd.y <= GlobelHeight ? pEnd.y : GlobelHeight; - if (pROI0.x == pROI1.x) //Ϊֱ + if (pROI0.x == pROI1.x) //��Ϊ��ֱ�� { if (pEnd.x > pStart.x) return 1; else return 0; } - else if (k1 <= 0) //ΪֱбСڵ0ˮƽ + else if (k1 <= 0) //����Ϊ��ֱ����б��С�ڵ���0����ˮƽ������� { if ((pStart.x != pEnd.x && pEnd.x > pStart.x) || (pStart.x == pEnd.x && pEnd.y > pStart.y)) return 0; @@ -116,27 +116,27 @@ int RegionSurveillance::get_ArrowDir(CMPoint pROI0, CMPoint pROI1, CMPoint dir) /****************************************************************************** * Function: RSinit -* Description: MaskImgDataڴ估VIBE ģͳʼ +* Description: MaskImgData�ڴ���估VIBE ģ�ͳ�ʼ�� * Calls: VibeModelInitC3 * Called By: main -* Input: nWidth ͼ - nHeight ͼ߶ - frameImgData ͼRGB -* Output: vbM VIBE ģ -* Return: 0 ͨ 1 +* Input: nWidth ͼ����� + nHeight ͼ��߶� + frameImgData ͼ��RGB +* Output: vbM VIBE ģ�� +* Return: 0 ����ͨ������������ 1 ���� *******************************************************************************/ int RegionSurveillance::RSinit(int nWidth, int nHeight, int widthstep, unsigned char* frameImgData, int nChannel, int nChannel_deal, bool nfiltFlag, int maxObjNum, int minArea, int maxArea) { macDetectObjNum = maxObjNum; - if(nWidth < 600 || nHeight < 300) //ߴС ޸vibe + if(nWidth < 600 || nHeight < 300) //����ߴ��С �޸�vibe���� VBPARAM = new VIBEPARAM(35, 18); else VBPARAM = new VIBEPARAM(20, 35); - //checkMIDɼ by zl - if (/*checkMIDkeySet() == -1 */ checkTime() == -1 || (nChannel != 1 && nChannel != 3) || (nChannel_deal != 1 && nChannel_deal != 3) || (nChannel_deal > nChannel)) + //checkMID���������ɼ�� by zl + if (/*checkMIDkeySet() == -1 */ /*checkTime() == -1 || */(nChannel != 1 && nChannel != 3) || (nChannel_deal != 1 && nChannel_deal != 3) || (nChannel_deal > nChannel)) { return 0; } @@ -147,8 +147,8 @@ int RegionSurveillance::RSinit(int nWidth, int nHeight, int widthstep, unsigned GlobelHeight = nHeight; GlobelWidthstep = widthstep; gfiltFlag = nfiltFlag; - OBJECT_AREA_MIN = minArea; //ĬΪ1,000,000 by zl 20160304 - OBJECT_AREA_MAX = maxArea; //ĬСΪ300 by zl 20160304 + OBJECT_AREA_MIN = minArea; //Ĭ�����������Ϊ1,000,000 by zl 20160304 + OBJECT_AREA_MAX = maxArea; //Ĭ����С�������Ϊ300 by zl 20160304 /* int widthstep = nWidth * 3; if (widthstep % 4) @@ -164,12 +164,12 @@ int RegionSurveillance::RSinit(int nWidth, int nHeight, int widthstep, unsigned memset(MaskImgCfd, 0, sizeof(float)* GlobelWidth * GlobelHeight); if (!vbM) { - // ʼģ + // ��ʼ��ģ�� if (nChannel == 3) { if (nChannel_deal == 3) { - // ˹ģ + // ��˹ģ�� if (nfiltFlag == 1) { unsigned char* inputData = NULL; @@ -207,10 +207,10 @@ int RegionSurveillance::RSinit(int nWidth, int nHeight, int widthstep, unsigned { greyImgData = (unsigned char*) malloc(sizeof(unsigned char*) * GlobelWidth * nHeight); memset(greyImgData, 0, sizeof(unsigned char*)); - // RGBͼתΪҶͼ + // ��RGBͼ��ת��Ϊ�Ҷ�ͼ�� VibeRGBToGray(frameImgData, greyImgData); - // ˹ģ + // ��˹ģ�� if (nfiltFlag == 1) { unsigned char* inputData = NULL; @@ -241,7 +241,7 @@ int RegionSurveillance::RSinit(int nWidth, int nHeight, int widthstep, unsigned } else { - // ˹ģ + // ��˹ģ�� if (nfiltFlag == 1) { unsigned char* inputData = NULL; @@ -272,10 +272,10 @@ int RegionSurveillance::RSinit(int nWidth, int nHeight, int widthstep, unsigned } } - left_flag = 1; // ־ 0 1Ƴ + left_flag = 1; // ������־ 0 ���� 1�Ƴ� - maskImg = new unsigned char[nWidth*nHeight]; //ͺ͸ʴ - memset(maskImg, 0, sizeof(maskImg[0])*nWidth*nHeight); //ͺ͸ʴ + maskImg = new unsigned char[nWidth*nHeight]; //���ͺ͸�ʴ ������ + memset(maskImg, 0, sizeof(maskImg[0])*nWidth*nHeight); //���ͺ͸�ʴ ������ return 1; } @@ -319,17 +319,17 @@ VibeModel_t * RegionSurveillance::VibeModelInitC1(uint8_t *image_data) /****************************************************************************** * Function: VibeModelInitC3 -* Description: VIBEģͳʼ +* Description: VIBEģ�ͳ�ʼ�� * Calls: RandInit RandNeighborInit GetRandNeighborXY * Called By: RSinit -* Input: image_data ͼRGB +* Input: image_data ͼ��RGB * Output: g_XNeighborTable 22100012 g_YNeighborTable 10001222 - g_randTable 65536 - g_XTable 0 0 1 2 3 ... -1 -1 - g_YTable 0 0 1 2 3 ... ߶-1 ߶-1 + g_randTable 65536������� + g_XTable 0 0 1 2 3 ... ����-1 ����-1 + g_YTable 0 0 1 2 3 ... �߶�-1 �߶�-1 * Return: vbM *******************************************************************************/ VibeModel_t* RegionSurveillance::VibeModelInitC3(uint8_t *image_data) @@ -449,11 +449,11 @@ void RegionSurveillance::VibeModelUpdateC1(VibeModel_t *model, uint8_t *image, u }// end of for y loop - VibeModelDilation2(output, maskImg, model->width, model->height);// - VibeModelErosion2(maskImg, output, model->width, model->height);// ʴ - //δٰ汾 - //VibeModelDilation(output, model->width, model->height);// - //VibeModelErosion(output, model->width, model->height);// ʴ + VibeModelDilation2(output, maskImg, model->width, model->height);// ���� + VibeModelErosion2(maskImg, output, model->width, model->height);// ��ʴ + //δ���ٰ汾 + //VibeModelDilation(output, model->width, model->height);// ���� + //VibeModelErosion(output, model->width, model->height);// ��ʴ g_frameCount++; @@ -462,16 +462,16 @@ void RegionSurveillance::VibeModelUpdateC1(VibeModel_t *model, uint8_t *image, u /****************************************************************************** * Function: VibeModelUpdateC3 -* Description: VIBEģ͸ +* Description: VIBEģ�͸��� * Calls: GetRand GetRandNeighborXY VibeModelDilation VibeModelErosion * Called By: RSDetect -* Input: model VBM ģ - image ͼRGB -* Output: output ǰ255 0 - model VBM ģ +* Input: model VBM ģ�� + image ͼ��RGB +* Output: output ǰ����255 ������0 + model VBM ģ�� *******************************************************************************/ void RegionSurveillance::VibeModelUpdateC3(VibeModel_t *model, uint8_t *image, uint8_t *output) { @@ -487,10 +487,10 @@ void RegionSurveillance::VibeModelUpdateC3(VibeModel_t *model, uint8_t *image, u { for (x = 0; x < model->width; x++) { - // ǰӦģе + // ��ǰ���Ӧ��ģ���е����� sampleOffset = ((y * model-> width * model->nSample + x * model->nSample) << 1) + (y * model-> width * model->nSample + x * model->nSample); - // ǰӦRGBе + // ��ǰ���Ӧ��RGB�е����� imageOffset = ((y * model->width + x) << 1) + (y * model->width + x); // if (imageOffset>=(model->width * model->height)) @@ -500,7 +500,7 @@ void RegionSurveillance::VibeModelUpdateC3(VibeModel_t *model, uint8_t *image, u count = 0; index = 0; - // ǰֵĵСڹ涨ƥ ǰĵС20 + // �����ǰ������ֵ�ĵ���С�ڹ涨ƥ����� �� ��ǰ�����ĵ���С��20���� while ((count < model->nMatch) && (index < model->nSample)) { //Euclidean distance computation @@ -508,10 +508,10 @@ void RegionSurveillance::VibeModelUpdateC3(VibeModel_t *model, uint8_t *image, u dist = (double)((image[imageOffset] - model->bg_samples[tmpValue ])*(image[imageOffset] - model->bg_samples[tmpValue])) + (double)((image[imageOffset + 1] - model->bg_samples[tmpValue + 1])*(image[imageOffset + 1] - model->bg_samples[tmpValue+ 1])) + (double)((image[imageOffset + 2] - model->bg_samples[tmpValue + 2])*(image[imageOffset + 2] - model->bg_samples[tmpValue + 2])); - // ֮ͨ + // ��ͨ���������֮�� //dist = abs(image[imageOffset] - model->bg_samples[tmpValue]) + abs(image[imageOffset + 1] - model->bg_samples[tmpValue + 1]) //+ abs(image[imageOffset + 2] - model->bg_samples[tmpValue + 2]); - // ֵĵ + // ������ֵ�����ĵ� if (dist < model->threshold * model->threshold * 3) { count++; @@ -520,22 +520,22 @@ void RegionSurveillance::VibeModelUpdateC3(VibeModel_t *model, uint8_t *image, u index++; } - // ǰΪǰ + // �����ǰ��Ϊǰ�� if (count < model->nMatch) { output[y * model->width + x] = VBPARAM->DEFAULT_COLOR_FOREGROUND; - // ǰ20֡ģϢ + // ǰ20֡����ģ����Ϣ if (g_frameCount < model->nSample) { - // µǰӦģеijһ + // ������µ�ǰ���Ӧ��ģ���е�ijһ���� rand = GetRand() % (model->nSample); tmpValue = sampleOffset + ((rand << 1) +rand ); model->bg_samples[tmpValue] = image[imageOffset]; model->bg_samples[tmpValue + 1] = image[imageOffset + 1]; model->bg_samples[tmpValue + 2] = image[imageOffset + 2]; - // ͬʱԵǰijһڵӦģеһи + // ͬʱ����Ե�ǰ���ijһ�����ڵ��Ӧ��ģ���е����һ�������и��� GetRandNeighborXY(x, y, &xNG, &yNG); rand = GetRand() % (model->nSample); tmpValue = ((yNG * model->width * model->nSample + xNG * model->nSample + rand) << 1)+ (yNG * model->width * model->nSample + xNG * model->nSample + rand); @@ -545,12 +545,12 @@ void RegionSurveillance::VibeModelUpdateC3(VibeModel_t *model, uint8_t *image, u } } - // ǰΪ + // �����ǰ��Ϊ���� else { output[y * model->width + x] = VBPARAM->DEFAULT_COLOR_BACKGROUND; - // ǰ20֡VIBEģ£ͬǰ + // ��ǰ20֡����VIBEģ����£�ͬǰ���� if (g_frameCount < model->nSample) { //curr @@ -582,7 +582,7 @@ void RegionSurveillance::VibeModelUpdateC3(VibeModel_t *model, uint8_t *image, u } //update neighboring pixel model - // Žб£Ϊ٣ + // ���������Ž��б������£�Ϊ�����٣� rand = GetRand() % (model->upSpeed); if (rand == 0 && left_flag == 1) { @@ -606,11 +606,11 @@ void RegionSurveillance::VibeModelUpdateC3(VibeModel_t *model, uint8_t *image, u }// end of for y loop - //VibeModelDilation(output, model->width, model->height); // - //VibeModelErosion(output, model->width, model->height);// ʴ + //VibeModelDilation(output, model->width, model->height); // ���� + //VibeModelErosion(output, model->width, model->height);// ��ʴ - VibeModelDilation2(output, maskImg, model->width, model->height); // - VibeModelErosion2(maskImg, output, model->width, model->height); // + VibeModelDilation2(output, maskImg, model->width, model->height); // ���� ���� + VibeModelErosion2(maskImg, output, model->width, model->height); // ���� ���� //VibeModelErosion(output,model->width,model->height); @@ -629,11 +629,11 @@ void RegionSurveillance::RSDetect(unsigned char* frameImgData, RegionInfo* pRegi } */ - // õǰ֡ǰͱǰ255 0ͬʱVIBEģи + // ��õ�ǰ֡��ǰ���ͱ�����ǰ��255 ����0��ͬʱ��VIBEģ����и��� //VibeModelUpdateC3(vbM, frameImgData, greyImgData, MaskImgData); if (vbM->nChannel == 3) { - // ˹ģ + // ��˹ģ�� if (gfiltFlag == 1) { unsigned char* inputData = NULL; @@ -671,10 +671,10 @@ void RegionSurveillance::RSDetect(unsigned char* frameImgData, RegionInfo* pRegi { if (channel_num == 3) { - // RGBͼתΪҶͼ + // ��RGBͼ��ת��Ϊ�Ҷ�ͼ�� VibeRGBToGray(frameImgData, greyImgData); - // ˹ģ + // ��˹ģ�� if (gfiltFlag == 1) { unsigned char* inputData = NULL; @@ -705,7 +705,7 @@ void RegionSurveillance::RSDetect(unsigned char* frameImgData, RegionInfo* pRegi } else { - // ˹ģ + // ��˹ģ�� if (gfiltFlag == 1) { unsigned char* inputData = NULL; @@ -739,7 +739,7 @@ void RegionSurveillance::RSDetect(unsigned char* frameImgData, RegionInfo* pRegi /* - // ʾֵͼ + // ��ʾ��ֵͼ�� CvSize a; a.width = GlobelWidth; a.height = GlobelHeight; @@ -756,12 +756,12 @@ void RegionSurveillance::RSDetect(unsigned char* frameImgData, RegionInfo* pRegi /****************************************************************************** * Function: VibeModelDilation -* Description: VIBEģͣǰΪǰߵǰһΪǰǰλǰ +* Description: VIBEģ�����ͣ������ǰ��Ϊǰ�����ߵ�ǰ�����������һ��Ϊǰ������ǰ��λǰ���� * Called By: VibeModelUpdateC3 -* Input: inputdata ǰͼǰǰΪ255 Ϊ0 - width ͼ - height ͼ߶ -* Output: inputdata ͺǰͼǰ +* Input: inputdata ��ǰͼ��ǰ��������ǰ��Ϊ255 ����Ϊ0�� + width ͼ����� + height ͼ��߶� +* Output: inputdata ���ͺ�ǰͼ��ǰ������ *******************************************************************************/ void RegionSurveillance::VibeModelDilation(unsigned char* inputdata, int width, int height) { @@ -805,12 +805,12 @@ void RegionSurveillance::VibeModelDilation(unsigned char* inputdata, int width, /****************************************************************************** * Function: VibeModelErosion -* Description: VIBEģ͸ʴǰǰijһһΪǰΪ +* Description: VIBEģ�͸�ʴ�������ǰ���ǰ���ijһ����������һ����Ϊ��������ǰΪ������ * Called By: VibeModelUpdateC3 -* Input: inputdata ǰͼǰǰΪ255 Ϊ0 - width ͼ - height ͼ߶ -* Output: inputdata ʴǰͼǰ +* Input: inputdata ��ǰͼ��ǰ��������ǰ��Ϊ255 ����Ϊ0�� + width ͼ����� + height ͼ��߶� +* Output: inputdata ��ʴ��ǰͼ��ǰ������ *******************************************************************************/ void RegionSurveillance::VibeModelErosion(unsigned char* inputdata, int width, int height) { @@ -871,7 +871,7 @@ typedef struct _int_128 const _int_128 & int_128_max(const _int_128 & n1, const _int_128 & n2) { - if (platform_little_endian) //С + if (platform_little_endian) //С�� { if (n1._n2 > n2._n2) { @@ -899,7 +899,7 @@ const _int_128 & int_128_max(const _int_128 & n1, const _int_128 & n2) } else { - if (n1._n1 > n2._n1) // + if (n1._n1 > n2._n1) //��� { return n1; } @@ -1100,7 +1100,7 @@ void RegionSurveillance::VibeModelErosion2(unsigned char* inputdata, unsigned ch //} -//ĵλý by zl +//�������ĵ��λ�ý������� by zl void RegionSurveillance::SortForeground(vector &ForegroundArray) { std::sort(ForegroundArray.begin(),ForegroundArray.end(), SortByPoint); @@ -1111,30 +1111,30 @@ int RegionSurveillance::dwGlobalID; /****************************************************************************** * Function: VibeModelGetTrace * Description: -* Calls ExtractContours +* Calls�� ExtractContours * Called By: RSDetect -* Input: pSourceImg ǰͼǰǰΪ255 Ϊ0 - pRGBIn ǰͼRGB - width ͼ - height ͼ߶ - widthStep ͼRGB step -* Output: pRGBIn ǰRGB +* Input: pSourceImg ��ǰͼ��ǰ��������ǰ��Ϊ255 ����Ϊ0�� + pRGBIn ��ǰͼ��RGB + width ͼ����� + height ͼ��߶� + widthStep ͼ��RGB step +* Output: pRGBIn ��ǰ��������RGB m_TargetArray - m_ptArray 뵱ǰĿƥɹǰĵ - m_VectorDirection ǰĿ֮ǰĿ + m_ptArray �뵱ǰĿ��ƥ��ɹ�������ǰ�������ĵ� + m_VectorDirection ��ǰĿ����֮ǰĿ������� //m_VectorDirectionNormal dx/sqrt(dx^2+dy^2) dy/sqrt(dx^2+dy^2) - m_CurRefPoint Ŀĵλãϸ£ȡ5ƽֵ - m_LastRefPoint Ŀ֮ǰĵλãϸ£ȡ5ƽֵ - m_PredictionBasePoint һƥλ - m_PredictionPoint һ֡Ԥλ - m_bHaveDirection ǰĿǷѾ true flase - m_dwLostFrame ൱ǰ֡δƥ䵽ĿжǷĿ궪ʧ - m_dwID ID Բͬǰͼʱɫϵ - m_dwBestMatch ƥ䵽ǰ֡ǰ - m_bCalc ־Ŀڵǰ֡Ƿƥ䵽 trueƥ䵽 falseδƥ䵽 - m_AlarmState ״̬ false true - m_AlarmNum - //m_TarBox ĿӾ + m_CurRefPoint Ŀ������ĵ�λ�ã����ϸ��£�ȡ5����ƽ��ֵ�� + m_LastRefPoint Ŀ��֮ǰ�����ĵ�λ�ã����ϸ��£�ȡ5����ƽ��ֵ�� + m_PredictionBasePoint ���һ��ƥ�������λ�� + m_PredictionPoint ��һ֡��Ԥ��λ�� + m_bHaveDirection ��ǰĿ���Ƿ��Ѿ���������� true�� flase�� + m_dwLostFrame �൱ǰ֡δƥ�䵽����Ŀ�������ж��Ƿ�Ŀ�궪ʧ�� + m_dwID ID �����Բ�ͬ��ǰ����ͼʱ������ɫ�ϵ����� + m_dwBestMatch ƥ�䵽��ǰ֡��ǰ����� + m_bCalc ��־Ŀ�������ڵ�ǰ֡���Ƿ�ƥ�䵽 trueƥ�䵽 falseδƥ�䵽 + m_AlarmState ����״̬ false�� true���� + m_AlarmNum ������� + //m_TarBox Ŀ�����Ӿ��� *******************************************************************************/ void RegionSurveillance::VibeModelGetTrace(unsigned char* pSourceImg, float *MaskImgCfd, unsigned char* pRGBIn, RegionInfo* pRegionInfo) { @@ -1150,13 +1150,13 @@ void RegionSurveillance::VibeModelGetTrace(unsigned char* pSourceImg, float *Mas int m_dwMaxLost = 100; int m_dwMinFrame = 6; int dwTargetSize = 0; - CForeground testTarget; // testForgroundArray еtestTarget + CForeground testTarget; // testForgroundArray �е�testTarget - //ǰͼ-zhm + //ǰ��ͼ����-zhm vector foreContours; CConExtraction *pConExtraction = new CConExtraction(); - // ģص 100ǰӾ + // ���������ģ����ص� ���������100��ǰ����Ӿ��� if (channel_num == 3) { foreContours = pConExtraction->ExtractContours(pSourceImg, MaskImgCfd,GlobelWidth, GlobelHeight, GlobelWidthstep / 3); @@ -1166,8 +1166,8 @@ void RegionSurveillance::VibeModelGetTrace(unsigned char* pSourceImg, float *Mas foreContours = pConExtraction->ExtractContours(pSourceImg, MaskImgCfd, GlobelWidth, GlobelHeight, GlobelWidthstep); } - //켣ƥ-zhm - // һforeContoursĻ϶ǰӾεɸѡ 300ӾForegroundArray + //�켣ƥ��-zhm + // ��һ����foreContours�Ļ����϶�ǰ����Ӿ��ε��������ɸѡ �������������300����Ӿ�������ForegroundArray�� int forNum = foreContours.size(); for (int i = 0; i < forNum; i++) { @@ -1180,7 +1180,7 @@ void RegionSurveillance::VibeModelGetTrace(unsigned char* pSourceImg, float *Mas testTarget.m_ptCenter.y = (testTarget.m_rtConnect.top + testTarget.m_rtConnect.bottom) / 2; testTarget.m_cfd = foreContours[i].cfd; - //СС by zl 20160304 + //������С���������С����������� by zl 20160304 int targetArea = abs((testTarget.m_rtConnect.left - testTarget.m_rtConnect.right) * (testTarget.m_rtConnect.top - testTarget.m_rtConnect.bottom)); if ( targetArea > OBJECT_AREA_MIN && targetArea < OBJECT_AREA_MAX) { @@ -1189,7 +1189,7 @@ void RegionSurveillance::VibeModelGetTrace(unsigned char* pSourceImg, float *Mas } - if(ForegroundArray.size() > 0) //ǰⲻ by zl 20160307 + if(ForegroundArray.size() > 0) //ǰ���ⲻ���������� by zl 20160307 { SortForeground(ForegroundArray); MergeNeighborBox(ForegroundArray); @@ -1208,14 +1208,14 @@ void RegionSurveillance::VibeModelGetTrace(unsigned char* pSourceImg, float *Mas delete pConExtraction; // memory leak for 1 block m_DelArray.clear(); - //жǷ֡Ŀ궪ʧʧdwTargetSizeԼ + //�ж��Ƿ�֡��Ŀ�궪ʧ������ʧdwTargetSize�Լ� vector::size_type countn = 0; int dwStep = GlobelWidthstep; ///////////////////////////////////////////////////////////////////////////////////////// dwTargetSize = m_TargetArray.size(); for (int i = 0; i < dwTargetSize; i++, countn++) { - // Ѿ100֡δָǰ 򽫸ǰm_TargetArrayɾ + // ���Ѿ�����100֡δ���ָ�ǰ�� �򽫸�ǰ����m_TargetArray��ɾ�� if (m_TargetArray[i].m_dwLostFrame++ > m_dwMaxLost) { m_DelArray.push_back(*(m_TargetArray.begin() + countn)); @@ -1247,7 +1247,7 @@ void RegionSurveillance::VibeModelGetTrace(unsigned char* pSourceImg, float *Mas dwTargetSize = m_TargetArray.size(); double * pDistanceMatrix = new double[dwForegroundCount * dwTargetSize]; - // ÿһĿ͸֡еǰƥ + // ��ÿһ��Ŀ��͸�֡�е�ǰ������ƥ�� for (int i = 0; i < dwTargetSize; i++) { //CMPointDouble directionPre; @@ -1279,7 +1279,7 @@ void RegionSurveillance::VibeModelGetTrace(unsigned char* pSourceImg, float *Mas m_FinalArray.clear(); //m_TargetArray.clear(); // Tracking and draw - // Եǰ֡ÿһǰĿƥ + // �Ե�ǰ֡��ÿһ��ǰ����Ŀ�����ƥ�� bool left_flag_c = 1; for (int i = 0; i < dwForegroundCount; i++) { @@ -1307,7 +1307,7 @@ void RegionSurveillance::VibeModelGetTrace(unsigned char* pSourceImg, float *Mas } } //m_TargetArray.clear(); - // ƥɹ m_TargetArray[dwBestMatch].m_ptArray.size() !=500Ϊʲôܵ500 + // ���ƥ��ɹ� m_TargetArray[dwBestMatch].m_ptArray.size() !=500��������������������������������������������������Ϊʲô���ܵ���500 if (dwBestMatch >= 0 && m_TargetArray[dwBestMatch].m_dwBestMatch == i && m_TargetArray[dwBestMatch].m_ptArray.size() < 500) { // Find it @@ -1335,10 +1335,10 @@ void RegionSurveillance::VibeModelGetTrace(unsigned char* pSourceImg, float *Mas } // Update last reference point - // Ŀƥɹǰﵽһ + // �����Ŀ��ƥ��ɹ���ǰ���ﵽһ������ if (dwPointCount > m_dwFrameDist) { - // Ŀ֮ǰĵλã5֡֡ƽ + // Ŀ��֮ǰ�����ĵ�λ�ã�5֡֡ƽ���� m_TargetArray[dwBestMatch].m_LastRefPoint.x += (double) m_TargetArray[dwBestMatch].m_ptArray[dwPointCount - m_dwFrameDist - 1].x / m_dwFrameWnd; m_TargetArray[dwBestMatch].m_LastRefPoint.y += @@ -1371,13 +1371,13 @@ void RegionSurveillance::VibeModelGetTrace(unsigned char* pSourceImg, float *Mas } else { - // ⵽µĿ + // ��⵽�µ�Ŀ�� // New object found CTarget NewTarget; //NewTarget.GetID(); NewTarget.m_dwID= ++dwGlobalID; // GlobalID assigned for target - // µǰλ + // �µ�ǰ��������λ�� NewTarget.m_ptArray.push_back(ForegroundArray[i].m_ptCenter); m_TargetArray.push_back(NewTarget); @@ -1392,7 +1392,7 @@ void RegionSurveillance::VibeModelGetTrace(unsigned char* pSourceImg, float *Mas dwBestMatch = m_TargetArray.size() - 1; // Update current reference point - //m_TargetArray-m_CurRefPointǰǰĵλãȡ֡ƽ + //m_TargetArray-m_CurRefPoint��ǰǰ�������ĵ�λ�ã�ȡ��֡��ƽ������ m_TargetArray[dwBestMatch].m_CurRefPoint.x += (double)ForegroundArray[i].m_ptCenter.x / m_dwFrameWnd; m_TargetArray[dwBestMatch].m_CurRefPoint.y += (double)ForegroundArray[i].m_ptCenter.y / m_dwFrameWnd; @@ -1414,7 +1414,7 @@ void RegionSurveillance::VibeModelGetTrace(unsigned char* pSourceImg, float *Mas } } - //Ŀ + //�����������Ŀ�� m_FinalArray.push_back(m_TargetArray[dwBestMatch]); /* // Draw it @@ -1427,8 +1427,8 @@ void RegionSurveillance::VibeModelGetTrace(unsigned char* pSourceImg, float *Mas unsigned char bBlue = (unsigned char) ((m_TargetArray[dwBestMatch].m_dwID % 13) * 20 + 15); // Draw rectangle - // - // ĿӾ ɫ + //���� + // Ŀ����Ӿ��� ��ɫ for (int t = ForegroundArray[i].m_rtConnect.left; t <= ForegroundArray[i].m_rtConnect.right; t++) { pRGBIn[ForegroundArray[i].m_rtConnect.top * dwStep + t * 3] = 0; @@ -1455,11 +1455,11 @@ void RegionSurveillance::VibeModelGetTrace(unsigned char* pSourceImg, float *Mas int d = ForegroundArray[i].m_rtConnect.right; - // ROI + // ROI ��� for (int ii = 0; ii < m_numROI; ii++) { - // ĿӾνĿĵڣ򱨾 - if (pAlarmInfo[ii] == 1) //ֹ + // Ŀ����Ӿ��ν���������Ŀ�����ĵ��������ڣ��򱨾� + if (pAlarmInfo[ii] == 1) //��ֹ���� { if (pRegion[ii][GlobelWidth * a + c] || pRegion[ii][GlobelWidth * b + c] || @@ -1475,8 +1475,8 @@ void RegionSurveillance::VibeModelGetTrace(unsigned char* pSourceImg, float *Mas } } } - // ֻҪĿӾһ򱨾 - if (pAlarmInfo[ii] == 2) // + // ֻҪĿ����Ӿ�����һ������������򱨾� + if (pAlarmInfo[ii] == 2) //���� { int xmin = min(c, d), xmax = max(c, d), ymin = min(a, b), ymax = max(a, b); for (int iy = ymin; iy <= ymax; iy++) @@ -1493,8 +1493,8 @@ void RegionSurveillance::VibeModelGetTrace(unsigned char* pSourceImg, float *Mas } } - // ֻҪĿӾνУROIһͬʱӾĵڣ򱨾 - if (pAlarmInfo[ii] == 3) // + // ֻҪĿ����Ӿ��ν��������У����������ROI���������һ��ͬʱ��Ӿ������ĵ��������ڣ��򱨾� + if (pAlarmInfo[ii] == 3) //������� { int TotalArea = 0; if (TotalArea == 0) @@ -1522,19 +1522,19 @@ void RegionSurveillance::VibeModelGetTrace(unsigned char* pSourceImg, float *Mas } } - //Ŀ + //�����������Ŀ�� m_FinalArray.push_back(m_TargetArray[dwBestMatch]); CMPoint ptLast = m_TargetArray[dwBestMatch].m_ptArray[0]; - // Ŀÿһƥб + // ��Ŀ���ÿһ��ƥ������б��� for (int l = 1; l < dwPointNum; l++) { ForegroundArray[i].m_ptCenter = m_TargetArray[dwBestMatch].m_ptArray[l]; if (ForegroundArray[i].m_ptCenter == ptLast) { // Draw a point - //Ŀĵ + //���Ŀ�����ĵ� pRGBIn[ForegroundArray[i].m_ptCenter.y * dwStep + ForegroundArray[i].m_ptCenter.x * 3] = bBlue; pRGBIn[ForegroundArray[i].m_ptCenter.y * dwStep + ForegroundArray[i].m_ptCenter.x * 3 + 1] = bGreen; pRGBIn[ForegroundArray[i].m_ptCenter.y * dwStep + ForegroundArray[i].m_ptCenter.x * 3 + 2] = bRed; @@ -1636,10 +1636,10 @@ void RegionSurveillance::VibeModelGetTrace(unsigned char* pSourceImg, float *Mas /////////////////////////////////////////////////////////////////////////////////////// // Prediction int dwObjectCount = m_TargetArray.size(); - // еĿ + // �������е�Ŀ�� for (int i=0; i < dwObjectCount; i++) { - // Ŀڵǰ֡ûƥɹǵǰĿѾ + // �����Ŀ���ڵ�ǰ֡��û��ƥ��ɹ����ǵ�ǰĿ���Ѿ���������� if (!m_TargetArray[i].m_bCalc && m_TargetArray[i].m_bHaveDirection) { // Record prediction as current point @@ -1700,15 +1700,15 @@ void RegionSurveillance::VibeModelGetTrace(unsigned char* pSourceImg, float *Mas /****************************************************************************** * Function: RSRegion -* Description: Ȥ +* Description: ����Ȥ�������� * Calls: vibeMask * Called By: main -* Input: numROI ROI - pRegionInfo ROI - iflog true:־ false־ -* Output: pRegion 10ROIָ루boolÿСΪͼ*ͼߣȤֵΪ1 Ϊ0 - //regionAlarm 10ROI ־bool - pAlarmInfo 10ROI ־int +* Input: numROI ROI���� + pRegionInfo ROI���� + iflog true:�����־ false���������־ +* Output: pRegion 10��ROIָ�루bool��ÿ����СΪ��ͼ���*ͼ��ߣ�����Ȥ����ֵΪ1 ����Ϊ0 + //regionAlarm 10��ROI ������־��bool�� + pAlarmInfo 10��ROI ������־��int�� * Return: 3 1 *******************************************************************************/ void printAlarmType(fstream *file, int style) @@ -1716,22 +1716,22 @@ void printAlarmType(fstream *file, int style) switch (style) { case 1: - *file<<", "; + *file<<"�������, "; break; case 2: - *file<<"뿪, "; + *file<<"�뿪����, "; break; case 3: - *file<<"Խ, "; + *file<<"����Խ��, "; break; case 4: - *file<<"˫Խ, "; + *file<<"˫��Խ��, "; break; case 5: - *file<<"ǻ, "; + *file<<"�ǻ�, "; break; case 6: - *file<<", "; + *file<<"����, "; break; default : break; @@ -1741,12 +1741,12 @@ void printAlarmType(fstream *file, int style) int RegionSurveillance::RSRegion(int numROI, int alarm_info/*, bool iflog*/) { - //fstream file;//־ + //fstream file;//���������־ if (numROI > MAXROINUM) { return 0; } - //Զȷĵ + //�Զ���������ȷ������ĵ� //for(int i = 0; i < numROI; i++) //{ // if (iflog) @@ -1760,13 +1760,13 @@ int RegionSurveillance::RSRegion(int numROI, int alarm_info/*, bool iflog*/) // // if (pRegionInfo[i].AlarmInfo == 3) // { - // pRegionInfo[i].finaldir = get_ArrowDir(pRegionInfo[i].pROI[0], pRegionInfo[i].pROI[1], pRegionInfo[i].dirPoint);//ȷ㣬ͷ˵ + // pRegionInfo[i].finaldir = get_ArrowDir(pRegionInfo[i].pROI[0], pRegionInfo[i].pROI[1], pRegionInfo[i].dirPoint);//ȷ��������㣬��ͷ�˵����� // // if (iflog) // file<<", DirPoint("< -1 && y < GlobelHeight && x > -1 && x < GlobelWidth) // { // pRegion[GlobelWidth * y + x] = 1; @@ -1932,7 +1932,7 @@ int RegionSurveillance::RSRegion(int numROI, int alarm_info/*, bool iflog*/) // int y = (int) (((LineMin.y - LineMax.y) / (double)(LineMin.x - LineMax.x)) * (double)(x - LineMin.x) + 0.5 + (double)LineMin.y); // //pRegion[GlobelWidth * y + x] = 1; // -// //ԭԽ ܿ޸ +// //ԭ�������Խ�� ����ܿ�޸����� // if (y > -1 && y < GlobelHeight && x > -1 && x < GlobelWidth) // { // pRegion[GlobelWidth * y + x] = 1; @@ -1947,7 +1947,7 @@ int RegionSurveillance::RSRegion(int numROI, int alarm_info/*, bool iflog*/) // { // //pRegion[GlobelWidth * i + pPointList[startp].x] = 1; // -// //ԭԽ ܿ޸ +// //ԭ�������Խ�� ����ܿ�޸����� // if (i > -1 && i < GlobelHeight && pPointList[startp].x > -1 && pPointList[startp].x < GlobelWidth) // { // pRegion[GlobelWidth * i + pPointList[startp].x] = 1; @@ -1966,7 +1966,7 @@ int RegionSurveillance::RSRegion(int numROI, int alarm_info/*, bool iflog*/) // int x = (int) (((LineMin.x - LineMax.x) / (double) (LineMin.y - LineMax.y)) * (double) (y - LineMin.y) + 0.5 + (double)LineMin.x); // //pRegion[GlobelWidth * y + x] = 1; // -// //ԭԽ ܿ޸ +// //ԭ�������Խ�� ����ܿ�޸����� // if (y > -1 && y < GlobelHeight && x > -1 && x < GlobelWidth) // { // pRegion[GlobelWidth * y + x] = 1; @@ -1982,7 +1982,7 @@ int RegionSurveillance::RSRegion(int numROI, int alarm_info/*, bool iflog*/) // int x = (int) (((LineMin.x - LineMax.x) / (double) (LineMin.y - LineMax.y)) * (double) (y - LineMin.y) + 0.5 + (double)LineMin.x); // //pRegion[GlobelWidth * y + x] = 1; // -// //ԭԽ ܿ޸ +// //ԭ�������Խ�� ����ܿ�޸����� // if (y > -1 && y < GlobelHeight && x > -1 && x < GlobelWidth) // { // pRegion[GlobelWidth * y + x] = 1; @@ -1997,7 +1997,7 @@ int RegionSurveillance::RSRegion(int numROI, int alarm_info/*, bool iflog*/) // { // //pRegion[GlobelWidth * pPointList[startp].y + i] = 1; // -// //ԭԽ ܿ޸ +// //ԭ�������Խ�� ����ܿ�޸����� // if (pPointList[startp].y > -1 && pPointList[startp].y < GlobelHeight && i > -1 && i < GlobelWidth) // { // pRegion[GlobelWidth * pPointList[startp].y + i] = 1; @@ -2007,7 +2007,7 @@ int RegionSurveillance::RSRegion(int numROI, int alarm_info/*, bool iflog*/) // } // } // -// // ޸ıǷʽ Ե־Ϊ0 +// // �޸ı�Ƿ�ʽ �������Ե��־��Ϊ0 // for (int i = 0; i < GlobelHeight; i++) // { // for (int j = 0; j < GlobelWidth; j++) @@ -2153,8 +2153,8 @@ void RegionSurveillance::getObjectInfo(int ObjCount, MS_ObjectInfo* ObjInfo) } */ // unique ID for current object - ObjInfo[i].TarBox = m_FinalArray[i].m_TarBox; //ĿӾ - ObjInfo[i].UniqueID = m_FinalArray[i].m_dwID; //ǰĿصID + ObjInfo[i].TarBox = m_FinalArray[i].m_TarBox; //Ŀ����Ӿ��� + ObjInfo[i].UniqueID = m_FinalArray[i].m_dwID; //��ǰĿ����ص�ID //printf("UniqueID = %d, cfd = %f\n", ObjInfo[i].UniqueID, ObjInfo[i].confidence); } } @@ -2214,14 +2214,14 @@ void RegionSurveillance::getDeleteInfo(int DelCount, MS_ObjectInfo* ObjInfo) } */ // unique ID for current object - ObjInfo[i].TarBox = m_DelArray[i].m_TarBox; //ĿӾ - ObjInfo[i].UniqueID = m_DelArray[i].m_dwID; //ǰĿصID + ObjInfo[i].TarBox = m_DelArray[i].m_TarBox; //Ŀ����Ӿ��� + ObjInfo[i].UniqueID = m_DelArray[i].m_dwID; //��ǰĿ����ص�ID ObjInfo[i].confidence = m_DelArray[i].cfd; } } -// ͼתΪҶͼ +// ��ͼ��ת��Ϊ�Ҷ�ͼ�� void RegionSurveillance::VibeRGBToGray(unsigned char* RgbData, unsigned char* GrayData) { int nHeight, nWidth; @@ -2240,11 +2240,11 @@ void RegionSurveillance::VibeRGBToGray(unsigned char* RgbData, unsigned char* Gr -//pAlarmInfo 1 2뿪 3Խ 4˫Խ 5ǻ 6 +//pAlarmInfo 1������� 2�뿪���� 3����Խ�� 4˫��Խ�� 5�ǻ� 6���� void RegionSurveillance::MonitoringAlarm(unsigned char* pRGBIn, CForeground ForegroundArray_i, int dwBestMatch, RegionInfo* pRegionInfo) { - // Ŀ + // Ŀ������ //ExternalRectangle(pRGBIn, ForegroundArray_i, dwBestMatch, widthStep, 255, 0, 0); /* int dwStep = widthStep; @@ -2254,7 +2254,7 @@ void RegionSurveillance::MonitoringAlarm(unsigned char* pRGBIn, CForeground Fore unsigned char bBlue = (unsigned char) ((m_TargetArray[dwBestMatch].m_dwID % 13) * 20 + 15); - // ǰĿӾ + // ǰ��Ŀ����Ӿ������ for (int t = ForegroundArray_i.m_rtConnect.left; t <= ForegroundArray_i.m_rtConnect.right; t++) { pRGBIn[ForegroundArray_i.m_rtConnect.top * dwStep + t * 3] = 0; @@ -2281,11 +2281,11 @@ void RegionSurveillance::MonitoringAlarm(unsigned char* pRGBIn, CForeground Fore int c = ForegroundArray_i.m_rtConnect.left; int d = ForegroundArray_i.m_rtConnect.right; - // + // ������ for (int ii = 0; ii < m_numROI; ii++) { - if (pAlarmInfo[ii] == 1) // + if (pAlarmInfo[ii] == 1) //������� { //AccessToRestrictedAreas(pRegion[ii], dwBestMatch,a, b, c, d, ii); /* @@ -2295,7 +2295,7 @@ void RegionSurveillance::MonitoringAlarm(unsigned char* pRGBIn, CForeground Fore } */ } - else if (pAlarmInfo[ii] == 2) //뿪 + else if (pAlarmInfo[ii] == 2) //�뿪���� { //LeaveTheRestrictedAreas(pRegion[ii], dwBestMatch,a, b, c, d, ii); /* @@ -2306,7 +2306,7 @@ void RegionSurveillance::MonitoringAlarm(unsigned char* pRGBIn, CForeground Fore */ } - else if (pAlarmInfo[ii] == 3) //Խ + else if (pAlarmInfo[ii] == 3) //����Խ�� { //OneWayCrossBorder(pRegion[ii], dwBestMatch, a, b, c, d, ii, pRegionInfo); /* @@ -2317,7 +2317,7 @@ void RegionSurveillance::MonitoringAlarm(unsigned char* pRGBIn, CForeground Fore */ } - else if (pAlarmInfo[ii] == 4) //˫Խ + else if (pAlarmInfo[ii] == 4) //˫��Խ�� { //TwoWayCrossBorder(pRegion[ii], dwBestMatch, a, b, c, d, ii); /* @@ -2328,7 +2328,7 @@ void RegionSurveillance::MonitoringAlarm(unsigned char* pRGBIn, CForeground Fore */ } - else if (pAlarmInfo[ii] == 5) //ǻ + else if (pAlarmInfo[ii] == 5) //�ǻ� { //WanderMonitoring(pRegion[ii], dwBestMatch, a, b, c, d, ii, pRegionInfo, pRGBIn); /* @@ -2338,7 +2338,7 @@ void RegionSurveillance::MonitoringAlarm(unsigned char* pRGBIn, CForeground Fore } */ } - else if (pAlarmInfo[ii] == 6) // + else if (pAlarmInfo[ii] == 6) //���� { StayMonitoring( dwBestMatch, a, b, c, d, ii, pRegionInfo, pRGBIn); /* @@ -2357,7 +2357,7 @@ void RegionSurveillance::MonitoringAlarm(unsigned char* pRGBIn, CForeground Fore - // 켣 + // �켣��� //Trajectory(pRGBIn, ForegroundArray_i, dwBestMatch, width, height, widthStep); /* int dwStep = widthStep; @@ -2368,14 +2368,14 @@ void RegionSurveillance::MonitoringAlarm(unsigned char* pRGBIn, CForeground Fore int dwPointNum = m_TargetArray[dwBestMatch].m_ptArray.size(); CMPoint ptLast = m_TargetArray[dwBestMatch].m_ptArray[0]; - // Ŀÿһƥб + // ��Ŀ���ÿһ��ƥ������б��� for (int l = 1; l < dwPointNum; l++) { ForegroundArray_i.m_ptCenter = m_TargetArray[dwBestMatch].m_ptArray[l]; if (ForegroundArray_i.m_ptCenter == ptLast) { // Draw a point - //Ŀĵ + //���Ŀ�����ĵ� pRGBIn[ForegroundArray_i.m_ptCenter.y * dwStep + ForegroundArray_i.m_ptCenter.x * 3] = bBlue; pRGBIn[ForegroundArray_i.m_ptCenter.y * dwStep + ForegroundArray_i.m_ptCenter.x * 3 + 1] = bGreen; pRGBIn[ForegroundArray_i.m_ptCenter.y * dwStep + ForegroundArray_i.m_ptCenter.x * 3 + 2] = bRed; @@ -2458,13 +2458,13 @@ void RegionSurveillance::MonitoringAlarm(unsigned char* pRGBIn, CForeground Fore } /* -//Ӿ +//��Ӿ������ void RegionSurveillance::ExternalRectangle(unsigned char* pRGBIn, CForeground ForegroundArray_i, int dwBestMatch, int widthStep, int rgb_b, int rgb_g, int rgb_r) { int dwStep = widthStep; - // ǰĿӾ + // ǰ��Ŀ����Ӿ������ for (int t = ForegroundArray_i.m_rtConnect.left; t <= ForegroundArray_i.m_rtConnect.right; t++) { pRGBIn[ForegroundArray_i.m_rtConnect.top * dwStep + t * 3] = rgb_b; @@ -2487,7 +2487,7 @@ void RegionSurveillance::ExternalRectangle(unsigned char* pRGBIn, CForeground Fo void RegionSurveillance::Trajectory(unsigned char* pRGBIn, CForeground ForegroundArray_i, int dwBestMatch, int width, int height, int widthStep) { - // 켣 + // �켣��� int dwStep = widthStep; unsigned char bRed = (unsigned char) ((m_TargetArray[dwBestMatch].m_dwID % 3) * 85 + 85); unsigned char bGreen = (unsigned char) ((m_TargetArray[dwBestMatch].m_dwID % 7) * 36 + 36); @@ -2496,14 +2496,14 @@ void RegionSurveillance::Trajectory(unsigned char* pRGBIn, CForeground Foregroun int dwPointNum = m_TargetArray[dwBestMatch].m_ptArray.size(); CMPoint ptLast = m_TargetArray[dwBestMatch].m_ptArray[0]; - // Ŀÿһƥб + // ��Ŀ���ÿһ��ƥ������б��� for (int l = 1; l < dwPointNum; l++) { ForegroundArray_i.m_ptCenter = m_TargetArray[dwBestMatch].m_ptArray[l]; if (ForegroundArray_i.m_ptCenter == ptLast) { // Draw a point - //Ŀĵ + //���Ŀ�����ĵ� pRGBIn[ForegroundArray_i.m_ptCenter.y * dwStep + ForegroundArray_i.m_ptCenter.x * 3] = bBlue; pRGBIn[ForegroundArray_i.m_ptCenter.y * dwStep + ForegroundArray_i.m_ptCenter.x * 3 + 1] = bGreen; pRGBIn[ForegroundArray_i.m_ptCenter.y * dwStep + ForegroundArray_i.m_ptCenter.x * 3 + 2] = bRed; @@ -2589,26 +2589,26 @@ void RegionSurveillance::Trajectory(unsigned char* pRGBIn, CForeground Foregroun /****************************************************************************** * Function: RAccessToRestrictedAreas -* Description: -* Input: pRegion_i Ȥ - dwBestMatch Ŀ - ForBottom ǰǰӾСֵ - ForTop ǰǰӾֵ - ForLeft ǰǰӾκСֵ - ForRight ǰǰӾκֵ - indexROI ROI -* Output: m_TargetArray ĿϢ +* Description: ���������� +* Input: pRegion_i ����Ȥ������ + dwBestMatch Ŀ������ + ForBottom ��ǰǰ����Ӿ�����������Сֵ + ForTop ��ǰǰ����Ӿ������������ֵ + ForLeft ��ǰǰ����Ӿ��κ�������Сֵ + ForRight ��ǰǰ����Ӿ��κ��������ֵ + indexROI ROI ���� +* Output: m_TargetArray Ŀ����Ϣ *******************************************************************************/ //void RegionSurveillance::AccessToRestrictedAreas(bool *pRegion_i, int dwBestMatch, int ForBottom, int ForTop, int ForLeft, int ForRight, int indexROI) //{ // -// // ĿӾһ߽Ӿĵλڽ +// // Ŀ����Ӿ�����һ���߽����������Ӿ������ĵ�λ�ڽ����� // //if (pRegion_i[GlobelWidth * ForBottom + ForLeft] || // // pRegion_i[GlobelWidth * ForTop + ForLeft] || // // pRegion_i[GlobelWidth * ForTop + ForRight] || // // pRegion_i[GlobelWidth * ForBottom + ForRight]) // { -// //жǷȤij˾ĵҺ㶼жΪ +// //���ж��Ƿ�������Ȥ����ij��˾������ĵ���������Һ���������㶼���������ж�Ϊ���� // if (pRegion_i[GlobelWidth * (int) ((ForBottom + ForTop) / 2) + (ForLeft + ForRight) / 2] && \ // pRegion_i[GlobelWidth * (int)((ForBottom + ForTop) / 2) + (ForLeft + ForRight) / 2 + 1] && \ // pRegion_i[GlobelWidth * (int)((ForBottom + ForTop) / 2) + (ForLeft + ForRight) / 2 - 1] && \ @@ -2626,7 +2626,7 @@ void RegionSurveillance::Trajectory(unsigned char* pRGBIn, CForeground Foregroun // //} -//뿪 +//�뿪���� //void RegionSurveillance::LeaveTheRestrictedAreas(bool *pRegion_i, int dwBestMatch, int ForBottom, int ForTop, int ForLeft, int ForRight, int indexROI) //{ // if (pRegion_i[GlobelWidth * ForBottom + ForLeft] || @@ -2664,11 +2664,11 @@ void RegionSurveillance::Trajectory(unsigned char* pRGBIn, CForeground Foregroun // m_TargetArray[dwBestMatch].pbAlarmType[indexROI] = 0; //} -//Խ -//dir: 1 ͨϵ 0 +//����Խ�� +//dir: 1 �����������ͨ������ϵ�� 0������ //void RegionSurveillance::OneWayCrossBorder(bool *pRegion_i, int dwBestMatch, int ForBottom, int ForTop, int ForLeft, int ForRight, int indexROI, RegionInfo* pRegionInfo) //{ -// // ֻҪĿӾһ򱨾 +// // ֻҪĿ����Ӿ�����һ������������򱨾� // int tar_size = m_TargetArray[dwBestMatch].m_ptArray.size(); // int xmin = min(ForLeft, ForRight), xmax = max(ForLeft, ForRight), ymin = min(ForBottom, ForTop), ymax = max(ForBottom, ForTop); // for (int iy = ymin; iy <= ymax; iy++) @@ -2681,7 +2681,7 @@ void RegionSurveillance::Trajectory(unsigned char* pRGBIn, CForeground Foregroun // point_x = m_TargetArray[dwBestMatch].m_ptArray[tar_size - 4].x; // point_y = m_TargetArray[dwBestMatch].m_ptArray[tar_size - 4].y; // -// // жϷ +// // �жϷ��� // if (indexROI >= 0 && indexROI < m_numROI && pRegionInfo[indexROI].nPointNum >= 2) // { // if (abs(pRegionInfo[indexROI].pROI[0].x - pRegionInfo[indexROI].pROI[1].x) >= 1) @@ -2916,10 +2916,10 @@ void RegionSurveillance::Trajectory(unsigned char* pRGBIn, CForeground Foregroun // m_TargetArray[dwBestMatch].pbAlarmType[indexROI] = 0; //} -////˫Խ +////˫��Խ�� //void RegionSurveillance::TwoWayCrossBorder(bool *pRegion_i, int dwBestMatch, int ForBottom, int ForTop, int ForLeft, int ForRight, int indexROI) //{ -// // ֻҪĿӾһ򱨾 +// // ֻҪĿ����Ӿ�����һ������������򱨾� // int xmin = min(ForLeft, ForRight), xmax = max(ForLeft, ForRight), ymin = min(ForBottom, ForTop), ymax = max(ForBottom, ForTop); // for (int iy = ymin; iy <= ymax; iy++) // { @@ -2937,10 +2937,10 @@ void RegionSurveillance::Trajectory(unsigned char* pRGBIn, CForeground Foregroun // m_TargetArray[dwBestMatch].pbAlarmType[indexROI] = 0; //} -////˫Խ +////˫��Խ�� //void RegionSurveillance::TwoWayCrossBorder(bool *pRegion_i, int dwBestMatch, int ForBottom, int ForTop, int ForLeft, int ForRight, int indexROI) //{ -// // ֻҪĿӾһ򱨾 +// // ֻҪĿ����Ӿ�����һ������������򱨾� // int xmin = min(ForLeft, ForRight), xmax = max(ForLeft, ForRight), ymin = min(ForBottom, ForTop), ymax= max(ForBottom, ForTop); // for (int iy = ymin; iy <= ymax; iy++) // { @@ -2958,7 +2958,7 @@ void RegionSurveillance::Trajectory(unsigned char* pRGBIn, CForeground Foregroun // m_TargetArray[dwBestMatch].pbAlarmType[indexROI] = -1; //} -// Ƴ 0 1Ƴ +// ����������Ƴ� 0 ���� 1�Ƴ� bool RegionSurveillance::detectLeftRemove(unsigned char* pRGBIn, int ForBottom, int ForTop, int ForLeft, int ForRight) { bool flag; @@ -3071,11 +3071,11 @@ bool RegionSurveillance::detectLeftRemove(unsigned char* pRGBIn, int ForBottom, } } - if (ratio >= 0.85 && ratio <= 1.0) //ʾƳ + if (ratio >= 0.85 && ratio <= 1.0) //�����ʾ�Ƴ� { flag = 1; } - else // ʾ + else // �����ʾ���� { flag = 0; } @@ -3091,10 +3091,10 @@ bool CTargetFunc (CTarget &a, CTarget &b) else return false; } -// ǻ +// �ǻ���� void RegionSurveillance::WanderMonitoring(bool *pRegion_i, int dwBestMatch, int ForBottom, int ForTop, int ForLeft, int ForRight, int indexROI, RegionInfo* pRegionInfo, unsigned char* pRGBIn) { - // ĿӾһ߽Ӿĵλڽ + // Ŀ����Ӿ�����һ���߽����������Ӿ������ĵ�λ�ڽ����� bool flag = 0; if ((pRegion_i[GlobelWidth * ForBottom + ForLeft] || @@ -3121,7 +3121,7 @@ void RegionSurveillance::WanderMonitoring(bool *pRegion_i, int dwBestMatch, int m_TargetArray[dwBestMatch].lastFrame = 0; } } - if ((1 == m_TargetArray[dwBestMatch].m_ptArray.size() && m_TargetArray[dwBestMatch].nFrameCurr == 1) && m_TargetArray[dwBestMatch].m_bFirstInWander == true ) //ǻڣĿжΪ¶󣬽¶nFrameCurrΪӽĶnFrameCurr + if ((1 == m_TargetArray[dwBestMatch].m_ptArray.size() && m_TargetArray[dwBestMatch].nFrameCurr == 1) && m_TargetArray[dwBestMatch].m_bFirstInWander == true ) //�����ǻ������ڣ����Ŀ������ж�Ϊ�¶��󣬽����¶����nFrameCurr������Ϊ����������ӽ��Ķ����nFrameCurr { double bestDistance = 0; CTarget best; @@ -3199,7 +3199,7 @@ void RegionSurveillance::WanderMonitoring(bool *pRegion_i, int dwBestMatch, int m_TargetArray[dwBestMatch].m_bFirstInWander = false; - // жģǷи 0 1Ƴ + // �ж�ģ���Ƿ���и��� 0 ���� 1�Ƴ� left_flag_now_w = detectLeftRemove(pRGBIn, ForBottom, ForTop, ForLeft, ForRight); } else @@ -3227,10 +3227,10 @@ void RegionSurveillance::WanderMonitoring(bool *pRegion_i, int dwBestMatch, int } -// +// ������� void RegionSurveillance::StayMonitoring( int dwBestMatch, int ForBottom, int ForTop, int ForLeft, int ForRight, int indexROI, RegionInfo* pRegionInfo, unsigned char* pRGBIn) { - // ĿӾһ߽Ӿĵλڽ + // Ŀ����Ӿ�����һ���߽����������Ӿ������ĵ�λ�ڽ����� int tar_size = m_TargetArray[dwBestMatch].m_ptArray.size(); int cur_dis; bool flag = 0; @@ -3290,7 +3290,7 @@ void RegionSurveillance::StayMonitoring( int dwBestMatch, int ForBottom, int For } } - // жģǷи 0 1Ƴ + // �ж�ģ���Ƿ���и��� 0 ���� 1�Ƴ� left_flag_now_s = detectLeftRemove(pRGBIn, ForBottom, ForTop, ForLeft, ForRight); } //else @@ -3330,7 +3330,7 @@ void RegionSurveillance::RSrelease() pAlarmInfo = NULL; } - // ͷm_TargetArray + // �ͷ�m_TargetArray int i; for (i = 0; i < (int)m_TargetArray.size(); i++) { diff --git a/win/.vs/leftover/v14/.suo b/win/.vs/leftover/v14/.suo index 26111ff..a6df3a2 100644 Binary files a/win/.vs/leftover/v14/.suo and b/win/.vs/leftover/v14/.suo differ diff --git a/win/leftover.VC.VC.opendb b/win/leftover.VC.VC.opendb deleted file mode 100644 index 839dc36..0000000 Binary files a/win/leftover.VC.VC.opendb and /dev/null differ diff --git a/win/leftover.VC.db b/win/leftover.VC.db index da79aeb..19f25f4 100644 Binary files a/win/leftover.VC.db and b/win/leftover.VC.db differ -- libgit2 0.21.4