Commit ef488d9af77b77877d665d64dcab78bae312bc2a
1 parent
e2a56ab3
授权失败修改
Showing
6 changed files
with
246 additions
and
246 deletions
src/left_over/MSRegionSurveilance.cpp
... | ... | @@ -10,7 +10,7 @@ IRegionSurveillance *MS_RegionSurveillance::GetMS_RS() |
10 | 10 | //if (!MS_RS) |
11 | 11 | { |
12 | 12 | RegionSurveillance * MS_RS = nullptr; |
13 | - if (checkTime() == 1 && (MS_RS = new RegionSurveillance())) | |
13 | + if (/*checkTime() == 1 &&*/ (MS_RS = new RegionSurveillance())) | |
14 | 14 | return MS_RS; |
15 | 15 | else |
16 | 16 | { | ... | ... |
src/left_over/help.cpp
1 | 1 | /************************************************************* |
2 | 2 | /* name: help.cpp |
3 | -/* Description: 辅助函数集合 | |
4 | -/* Purpose:满足以下条件,合并两个框: | |
5 | -/* 1 大框中包含小框 2 框交叉 3 框相邻 | |
3 | +/* Description: 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷 | |
4 | +/* Purpose锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟较诧拷锟斤拷锟斤拷锟斤拷 | |
5 | +/* 1 锟斤拷锟斤拷邪锟斤拷锟叫★拷锟 2 锟津交诧拷 3 锟斤拷锟斤拷锟斤拷 | |
6 | 6 | /* Update Time: by zl 20160307 |
7 | 7 | **************************************************************/ |
8 | 8 | #include "help.h" |
... | ... | @@ -11,7 +11,7 @@ |
11 | 11 | #include <stdio.h> |
12 | 12 | #include <algorithm> |
13 | 13 | using namespace std; |
14 | -//排序 | |
14 | +//锟斤拷锟斤拷 | |
15 | 15 | bool SortByPoint(const CForeground &C1,const CForeground &C2) |
16 | 16 | { |
17 | 17 | bool sign = false; |
... | ... | @@ -28,7 +28,7 @@ bool SortByPoint(const CForeground &C1,const CForeground &C2) |
28 | 28 | return false; |
29 | 29 | } |
30 | 30 | |
31 | -//从大到小 | |
31 | +//锟接达拷小 | |
32 | 32 | bool SortByArea(const CForeground &C1, const CForeground &C2) |
33 | 33 | { |
34 | 34 | bool sign = false; |
... | ... | @@ -38,7 +38,7 @@ bool SortByArea(const CForeground &C1, const CForeground &C2) |
38 | 38 | return false; |
39 | 39 | } |
40 | 40 | |
41 | -//判断x是否在边界内 | |
41 | +//锟叫讹拷x锟角凤拷锟节边斤拷锟斤拷 | |
42 | 42 | bool InRange(int x, int boundary1, int boundary2) |
43 | 43 | { |
44 | 44 | int max_b = boundary1 >= boundary2 ? boundary1 : boundary2; |
... | ... | @@ -49,33 +49,33 @@ bool InRange(int x, int boundary1, int boundary2) |
49 | 49 | return false; |
50 | 50 | } |
51 | 51 | |
52 | -//相邻或者包含 | |
52 | +//锟斤拷锟节伙拷锟竭帮拷锟斤拷 | |
53 | 53 | bool NeighbourorSub(CForeground c1, CForeground c2) |
54 | 54 | { |
55 | - //c2中心点在c1内部 需要合并 返回true | |
55 | + //c2锟斤拷锟侥碉拷锟斤拷c1锟节诧拷 锟斤拷要锟较诧拷 锟斤拷锟斤拷true | |
56 | 56 | /*if (c2.m_ptCenter.x < c1.m_rtConnect.right && InRange(c2.m_ptCenter.y, c1.m_rtConnect.top, c1.m_rtConnect.bottom)) |
57 | 57 | return true; |
58 | 58 | else */ |
59 | - //输入条件为c2一定在c1的右侧 因此若交叉或者包含 c2的左下点 或者 右上点 肯定至少有一个在c1的内部 | |
59 | + //锟斤拷锟斤拷锟斤拷锟斤拷为c2一锟斤拷锟斤拷c1锟斤拷锟揭诧拷 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟竭帮拷锟斤拷 c2锟斤拷锟斤拷锟铰碉拷 锟斤拷锟斤拷 锟斤拷锟较碉拷 锟较讹拷锟斤拷锟斤拷锟斤拷一锟斤拷锟斤拷c1锟斤拷锟节诧拷 | |
60 | 60 | if (c2.m_rtConnect.left <= c1.m_rtConnect.right) |
61 | 61 | { |
62 | - //包含或者交叉 | |
62 | + //锟斤拷锟斤拷锟斤拷锟竭斤拷锟斤拷 | |
63 | 63 | 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)) |
64 | 64 | return true; |
65 | - //上方邻近 或者 下方邻近 | |
65 | + //锟较凤拷锟节斤拷 锟斤拷锟斤拷 锟铰凤拷锟节斤拷 | |
66 | 66 | else if (abs(c1.m_rtConnect.top - c2.m_rtConnect.bottom) < MergeMinDistance || abs(c1.m_rtConnect.bottom - c2.m_rtConnect.top) < MergeMinDistance) |
67 | 67 | return true; |
68 | 68 | } |
69 | 69 | 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)) |
70 | 70 | { |
71 | - if((abs(c1.m_rtConnect.right - c2.m_rtConnect.left) < MergeMinDistance)) //c2 在 c1 右侧 邻近 | |
71 | + if((abs(c1.m_rtConnect.right - c2.m_rtConnect.left) < MergeMinDistance)) //c2 锟斤拷 c1 锟揭诧拷 锟节斤拷 | |
72 | 72 | return true; |
73 | 73 | } |
74 | 74 | |
75 | 75 | return false; |
76 | 76 | } |
77 | 77 | |
78 | -//合并 | |
78 | +//锟较诧拷 | |
79 | 79 | void MergeNeighborBox(vector<CForeground> &ForegroundArray) |
80 | 80 | { |
81 | 81 | vector<CForeground>::iterator iter1 = ForegroundArray.begin(); |
... | ... | @@ -84,23 +84,23 @@ void MergeNeighborBox(vector<CForeground> &ForegroundArray) |
84 | 84 | vector<CForeground>::iterator iter2 = iter1 + 1; |
85 | 85 | for (; iter2 != ForegroundArray.end(); ) |
86 | 86 | { |
87 | - //if ((x2 <= iter1->m_rtConnect.right && y2 <= iter1->m_rtConnect.bottom && y2 >= iter1->m_rtConnect.top) || //大框含小框状况 | |
88 | - // (iter2->m_rtConnect.left <= iter1->m_rtConnect.right && iter2->m_rtConnect.bottom <= iter1->m_rtConnect.bottom && iter2->m_rtConnect.bottom >= iter1->m_rtConnect.top) || //框交叉 左上角在第一个框内 | |
89 | - // (iter2->m_rtConnect.left <= iter1->m_rtConnect.right && iter2->m_rtConnect.top <= iter1->m_rtConnect.bottom && iter2->m_rtConnect.top >= iter1->m_rtConnect.top) ||//框交叉 左下角在第一个框内 | |
90 | - // iter2->m_rtConnect.left <= iter1->m_ptCenter.x && abs(iter2->m_rtConnect.bottom - iter1->m_rtConnect.top) < 10 ||//距离较近的 | |
87 | + //if ((x2 <= iter1->m_rtConnect.right && y2 <= iter1->m_rtConnect.bottom && y2 >= iter1->m_rtConnect.top) || //锟斤拷锟叫★拷锟阶达拷锟 | |
88 | + // (iter2->m_rtConnect.left <= iter1->m_rtConnect.right && iter2->m_rtConnect.bottom <= iter1->m_rtConnect.bottom && iter2->m_rtConnect.bottom >= iter1->m_rtConnect.top) || //锟津交诧拷 锟斤拷锟较斤拷锟节碉拷一锟斤拷锟斤拷锟斤拷 | |
89 | + // (iter2->m_rtConnect.left <= iter1->m_rtConnect.right && iter2->m_rtConnect.top <= iter1->m_rtConnect.bottom && iter2->m_rtConnect.top >= iter1->m_rtConnect.top) ||//锟津交诧拷 锟斤拷锟铰斤拷锟节碉拷一锟斤拷锟斤拷锟斤拷 | |
90 | + // iter2->m_rtConnect.left <= iter1->m_ptCenter.x && abs(iter2->m_rtConnect.bottom - iter1->m_rtConnect.top) < 10 ||//锟斤拷锟斤拷辖锟斤拷锟 | |
91 | 91 | // iter2->m_rtConnect.left <= iter1->m_ptCenter.x && abs(iter2->m_rtConnect.top - iter1->m_rtConnect.bottom) < 10 || |
92 | - // distance < 20 //距离较近的 | |
92 | + // distance < 20 //锟斤拷锟斤拷辖锟斤拷锟 | |
93 | 93 | // ) |
94 | 94 | if (NeighbourorSub(*iter1, *iter2)) |
95 | 95 | { |
96 | - //合并 | |
96 | + //锟较诧拷 | |
97 | 97 | iter1->m_rtConnect.left = min(iter1->m_rtConnect.left, iter2->m_rtConnect.left); |
98 | 98 | iter1->m_rtConnect.bottom = max(iter1->m_rtConnect.bottom, iter2->m_rtConnect.bottom); |
99 | 99 | iter1->m_rtConnect.right = max(iter1->m_rtConnect.right, iter2->m_rtConnect.right); |
100 | 100 | iter1->m_rtConnect.top = min(iter1->m_rtConnect.top, iter2->m_rtConnect.top); |
101 | 101 | iter1->m_ptCenter.x = (iter1->m_rtConnect.right + iter1->m_rtConnect.left) / 2; |
102 | 102 | iter1->m_ptCenter.y = (iter1->m_rtConnect.bottom + iter1->m_rtConnect.top) / 2; |
103 | - //删除一个 | |
103 | + //删锟斤拷一锟斤拷 | |
104 | 104 | iter2 = ForegroundArray.erase(iter2); |
105 | 105 | iter1 = iter2; |
106 | 106 | iter1--; |
... | ... | @@ -108,8 +108,8 @@ void MergeNeighborBox(vector<CForeground> &ForegroundArray) |
108 | 108 | else |
109 | 109 | iter2++; |
110 | 110 | //else |
111 | - // break; //由于ForegroundArray按x坐标排列 所以认为如果当前可以合并,则有可能下一个也需要合并; | |
112 | - //但若当前不符合合并 则下一个也不会符合(为了减少计算次数) | |
111 | + // break; //锟斤拷锟斤拷ForegroundArray锟斤拷x锟斤拷锟斤拷锟斤拷锟斤拷 锟斤拷锟斤拷锟斤拷为锟斤拷锟斤拷锟角帮拷锟斤拷院喜锟斤拷锟斤拷锟斤拷锌锟斤拷锟斤拷锟揭伙拷锟揭诧拷锟揭拷喜锟斤拷锟 | |
112 | + //锟斤拷锟斤拷锟斤拷前锟斤拷锟斤拷锟较合诧拷 锟斤拷锟斤拷一锟斤拷也锟斤拷锟斤拷锟斤拷希锟轿拷思锟斤拷偌锟斤拷锟斤拷锟斤拷锟斤拷 | |
113 | 113 | |
114 | 114 | } |
115 | 115 | } |
... | ... | @@ -125,9 +125,9 @@ int checkTime() |
125 | 125 | nYear = info->tm_year + 1900; |
126 | 126 | nMonth = info->tm_mon + 1; |
127 | 127 | nDay = info->tm_mday; |
128 | - if (nYear != 2020)//2017年1月1日版本过期 | |
128 | + if (nYear != 2021)//2017锟斤拷1锟斤拷1锟秸版本锟斤拷锟斤拷 | |
129 | 129 | { |
130 | - printf("版本过期!\n"); | |
130 | + printf("锟芥本锟斤拷锟节o拷\n"); | |
131 | 131 | return -1; |
132 | 132 | } |
133 | 133 | else | ... | ... |
src/left_over/svibe.cpp
1 | -// svibe.cpp : 定义控制台应用程序的入口点。 | |
1 | +// svibe.cpp : 锟斤拷锟斤拷锟斤拷锟教ㄓ︼拷贸锟斤拷锟斤拷锟斤拷诘恪 | |
2 | 2 | #include <stdio.h> |
3 | 3 | #include <stddef.h> |
4 | 4 | #include "svibe.h" |
... | ... | @@ -13,20 +13,20 @@ |
13 | 13 | #include "help.h" |
14 | 14 | #include "left_over_det.h" |
15 | 15 | /************************************************************************/ |
16 | -/* 函数: get_ArrowDir() by zl */ | |
17 | -/* 作用: 获取方向和用于绘制箭头的两个端点; */ | |
18 | -/* 参数: pROI0&pROI1:拌线两个端点; */ | |
19 | -/* dir:确定单向警报方向的坐标点; */ | |
20 | -/* 返回: 1:正方向;0:负方向 */ | |
16 | +/* 锟斤拷锟斤拷: get_ArrowDir() by zl */ | |
17 | +/* 锟斤拷锟斤拷: 锟斤拷取锟斤拷锟斤拷锟斤拷锟斤拷诨锟斤拷萍锟酵凤拷锟斤拷锟斤拷锟斤拷说悖 */ | |
18 | +/* 锟斤拷锟斤拷: pROI0&pROI1锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟剿点; */ | |
19 | +/* dir锟斤拷确锟斤拷锟斤拷锟津警憋拷锟斤拷锟斤拷锟斤拷锟斤拷锟姐; */ | |
20 | +/* 锟斤拷锟斤拷: 1:锟斤拷锟斤拷锟斤拷0:锟斤拷锟斤拷锟斤拷 */ | |
21 | 21 | /************************************************************************/ |
22 | 22 | int RegionSurveillance::get_ArrowDir(CMPoint pROI0, CMPoint pROI1, CMPoint dir) |
23 | 23 | { |
24 | 24 | |
25 | 25 | float distance = (float)abs(pROI0.y - pROI1.y); |
26 | - //获取方向 | |
27 | - float k1, k2; //k1为原线段的斜率 | |
26 | + //锟斤拷取锟斤拷锟斤拷 | |
27 | + float k1, k2; //k1为原锟竭段碉拷斜锟斤拷 | |
28 | 28 | |
29 | - if (pROI0.y > pROI1.y) //在拌线靠近图像下方的端点处画箭头 | |
29 | + if (pROI0.y > pROI1.y) //锟节帮拷锟竭匡拷锟斤拷图锟斤拷锟铰凤拷锟侥端点处锟斤拷锟斤拷头 | |
30 | 30 | { |
31 | 31 | pStart.x = pROI0.x; |
32 | 32 | pStart.y = pROI0.y; |
... | ... | @@ -37,18 +37,18 @@ int RegionSurveillance::get_ArrowDir(CMPoint pROI0, CMPoint pROI1, CMPoint dir) |
37 | 37 | pStart.y = pROI1.y; |
38 | 38 | } |
39 | 39 | |
40 | - if (pROI0.x != pROI1.x) //若不为一根垂直线 | |
40 | + if (pROI0.x != pROI1.x) //锟斤拷锟斤拷为一锟斤拷锟斤拷直锟斤拷 | |
41 | 41 | { |
42 | 42 | k1 = (float)(pROI0.y - pROI1.y) / (float)(pROI0.x - pROI1.x); |
43 | - if (k1 != 0) //若不为一根平行线 | |
43 | + if (k1 != 0) //锟斤拷锟斤拷为一锟斤拷平锟斤拷锟斤拷 | |
44 | 44 | { |
45 | 45 | k2 = -1 / k1; |
46 | 46 | |
47 | 47 | |
48 | - float b = pROI1.y - k1 * pROI1.x;//y = kx + b 坐标系一图像左上顶点为原点,向右为x正方形 向下为y正方向 | |
48 | + float b = pROI1.y - k1 * pROI1.x;//y = kx + b 锟斤拷锟斤拷系一图锟斤拷锟斤拷锟较讹拷锟斤拷为原锟姐,锟斤拷锟斤拷为x锟斤拷锟斤拷锟斤拷 锟斤拷锟斤拷为y锟斤拷锟斤拷锟斤拷 | |
49 | 49 | 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)) |
50 | 50 | { |
51 | - if (distance < 30) //当两点y值差异较小时,垂线比较陡 若减去20 可能导致箭头太长 | |
51 | + if (distance < 30) //锟斤拷锟斤拷锟斤拷y值锟斤拷锟斤拷锟叫∈憋拷锟斤拷锟斤拷弑冉隙锟 锟斤拷锟斤拷去20 锟斤拷锟杰碉拷锟铰硷拷头太锟斤拷 | |
52 | 52 | { |
53 | 53 | pEnd.x = pStart.x - 2; |
54 | 54 | } |
... | ... | @@ -66,7 +66,7 @@ int RegionSurveillance::get_ArrowDir(CMPoint pROI0, CMPoint pROI1, CMPoint dir) |
66 | 66 | } |
67 | 67 | pEnd.y = (int)((pEnd.x - pStart.x) * k2 + pStart.y); |
68 | 68 | } |
69 | - else //若为水平线 | |
69 | + else //锟斤拷为水平锟斤拷 | |
70 | 70 | { |
71 | 71 | pEnd.x = pStart.x; |
72 | 72 | if (dir.y > pStart.y) |
... | ... | @@ -77,7 +77,7 @@ int RegionSurveillance::get_ArrowDir(CMPoint pROI0, CMPoint pROI1, CMPoint dir) |
77 | 77 | } |
78 | 78 | |
79 | 79 | } |
80 | - else //若为垂直线 | |
80 | + else //锟斤拷为锟斤拷直锟斤拷 | |
81 | 81 | { |
82 | 82 | pEnd.y = pStart.y; |
83 | 83 | if (dir.x > pStart.x) |
... | ... | @@ -85,20 +85,20 @@ int RegionSurveillance::get_ArrowDir(CMPoint pROI0, CMPoint pROI1, CMPoint dir) |
85 | 85 | else |
86 | 86 | pEnd.x = pStart.x - 20; |
87 | 87 | } |
88 | - //防止越界 | |
88 | + //锟斤拷止越锟斤拷 | |
89 | 89 | pEnd.x = pEnd.x >= 0 ? pEnd.x : 0; |
90 | 90 | pEnd.x = pEnd.x <= GlobelWidth ? pEnd.x : GlobelWidth; |
91 | 91 | pEnd.y = pEnd.y >= 0 ? pEnd.y : 0; |
92 | 92 | pEnd.y = pEnd.y <= GlobelHeight ? pEnd.y : GlobelHeight; |
93 | 93 | |
94 | - if (pROI0.x == pROI1.x) //若为垂直线 | |
94 | + if (pROI0.x == pROI1.x) //锟斤拷为锟斤拷直锟斤拷 | |
95 | 95 | { |
96 | 96 | if (pEnd.x > pStart.x) |
97 | 97 | return 1; |
98 | 98 | else |
99 | 99 | return 0; |
100 | 100 | } |
101 | - else if (k1 <= 0) //若不为垂直线且斜率小于等于0(含水平线情况) | |
101 | + else if (k1 <= 0) //锟斤拷锟斤拷为锟斤拷直锟斤拷锟斤拷斜锟斤拷小锟节碉拷锟斤拷0锟斤拷锟斤拷水平锟斤拷锟斤拷锟斤拷锟 | |
102 | 102 | { |
103 | 103 | if ((pStart.x != pEnd.x && pEnd.x > pStart.x) || (pStart.x == pEnd.x && pEnd.y > pStart.y)) |
104 | 104 | return 0; |
... | ... | @@ -116,27 +116,27 @@ int RegionSurveillance::get_ArrowDir(CMPoint pROI0, CMPoint pROI1, CMPoint dir) |
116 | 116 | |
117 | 117 | /****************************************************************************** |
118 | 118 | * Function: RSinit |
119 | -* Description: MaskImgData内存非配及VIBE 模型初始化 | |
119 | +* Description: MaskImgData锟节达拷锟斤拷浼癡IBE 模锟酵筹拷始锟斤拷 | |
120 | 120 | * Calls: VibeModelInitC3 |
121 | 121 | * Called By: main |
122 | -* Input: nWidth 图像宽度 | |
123 | - nHeight 图像高度 | |
124 | - frameImgData 图像RGB | |
125 | -* Output: vbM VIBE 模型 | |
126 | -* Return: 0 输入通道参数不合理 1 正常 | |
122 | +* Input: nWidth 图锟斤拷锟斤拷锟 | |
123 | + nHeight 图锟斤拷叨锟 | |
124 | + frameImgData 图锟斤拷RGB | |
125 | +* Output: vbM VIBE 模锟斤拷 | |
126 | +* Return: 0 锟斤拷锟斤拷通锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷 1 锟斤拷锟斤拷 | |
127 | 127 | *******************************************************************************/ |
128 | 128 | |
129 | 129 | int RegionSurveillance::RSinit(int nWidth, int nHeight, int widthstep, unsigned char* frameImgData, |
130 | 130 | int nChannel, int nChannel_deal, bool nfiltFlag, int maxObjNum, int minArea, int maxArea) |
131 | 131 | { |
132 | 132 | macDetectObjNum = maxObjNum; |
133 | - if(nWidth < 600 || nHeight < 300) //如果尺寸过小 修改vibe参数 | |
133 | + if(nWidth < 600 || nHeight < 300) //锟斤拷锟斤拷叽锟斤拷小 锟睫革拷vibe锟斤拷锟斤拷 | |
134 | 134 | VBPARAM = new VIBEPARAM(35, 18); |
135 | 135 | else |
136 | 136 | VBPARAM = new VIBEPARAM(20, 35); |
137 | 137 | |
138 | - //checkMID:软件许可检测 by zl | |
139 | - if (/*checkMIDkeySet() == -1 */ checkTime() == -1 || (nChannel != 1 && nChannel != 3) || (nChannel_deal != 1 && nChannel_deal != 3) || (nChannel_deal > nChannel)) | |
138 | + //checkMID锟斤拷锟斤拷锟斤拷锟斤拷锟缴硷拷锟 by zl | |
139 | + if (/*checkMIDkeySet() == -1 */ /*checkTime() == -1 || */(nChannel != 1 && nChannel != 3) || (nChannel_deal != 1 && nChannel_deal != 3) || (nChannel_deal > nChannel)) | |
140 | 140 | { |
141 | 141 | return 0; |
142 | 142 | } |
... | ... | @@ -147,8 +147,8 @@ int RegionSurveillance::RSinit(int nWidth, int nHeight, int widthstep, unsigned |
147 | 147 | GlobelHeight = nHeight; |
148 | 148 | GlobelWidthstep = widthstep; |
149 | 149 | gfiltFlag = nfiltFlag; |
150 | - OBJECT_AREA_MIN = minArea; //默认最大过滤面积为1,000,000 by zl 20160304 | |
151 | - OBJECT_AREA_MAX = maxArea; //默认最小过滤面积为300 by zl 20160304 | |
150 | + OBJECT_AREA_MIN = minArea; //默锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟轿,000,000 by zl 20160304 | |
151 | + OBJECT_AREA_MAX = maxArea; //默锟斤拷锟斤拷小锟斤拷锟斤拷锟斤拷锟轿00 by zl 20160304 | |
152 | 152 | /* |
153 | 153 | int widthstep = nWidth * 3; |
154 | 154 | if (widthstep % 4) |
... | ... | @@ -164,12 +164,12 @@ int RegionSurveillance::RSinit(int nWidth, int nHeight, int widthstep, unsigned |
164 | 164 | memset(MaskImgCfd, 0, sizeof(float)* GlobelWidth * GlobelHeight); |
165 | 165 | if (!vbM) |
166 | 166 | { |
167 | - // 初始化模型 | |
167 | + // 锟斤拷始锟斤拷模锟斤拷 | |
168 | 168 | if (nChannel == 3) |
169 | 169 | { |
170 | 170 | if (nChannel_deal == 3) |
171 | 171 | { |
172 | - // 高斯模糊 | |
172 | + // 锟斤拷斯模锟斤拷 | |
173 | 173 | if (nfiltFlag == 1) |
174 | 174 | { |
175 | 175 | unsigned char* inputData = NULL; |
... | ... | @@ -207,10 +207,10 @@ int RegionSurveillance::RSinit(int nWidth, int nHeight, int widthstep, unsigned |
207 | 207 | { |
208 | 208 | greyImgData = (unsigned char*) malloc(sizeof(unsigned char*) * GlobelWidth * nHeight); |
209 | 209 | memset(greyImgData, 0, sizeof(unsigned char*)); |
210 | - // 将RGB图像转换为灰度图像 | |
210 | + // 锟斤拷RGB图锟斤拷转锟斤拷为锟揭讹拷图锟斤拷 | |
211 | 211 | VibeRGBToGray(frameImgData, greyImgData); |
212 | 212 | |
213 | - // 高斯模糊 | |
213 | + // 锟斤拷斯模锟斤拷 | |
214 | 214 | if (nfiltFlag == 1) |
215 | 215 | { |
216 | 216 | unsigned char* inputData = NULL; |
... | ... | @@ -241,7 +241,7 @@ int RegionSurveillance::RSinit(int nWidth, int nHeight, int widthstep, unsigned |
241 | 241 | } |
242 | 242 | else |
243 | 243 | { |
244 | - // 高斯模糊 | |
244 | + // 锟斤拷斯模锟斤拷 | |
245 | 245 | if (nfiltFlag == 1) |
246 | 246 | { |
247 | 247 | unsigned char* inputData = NULL; |
... | ... | @@ -272,10 +272,10 @@ int RegionSurveillance::RSinit(int nWidth, int nHeight, int widthstep, unsigned |
272 | 272 | } |
273 | 273 | } |
274 | 274 | |
275 | - left_flag = 1; // 逗留标志 0 遗留 1移除 | |
275 | + left_flag = 1; // 锟斤拷锟斤拷锟斤拷志 0 锟斤拷锟斤拷 1锟狡筹拷 | |
276 | 276 | |
277 | - maskImg = new unsigned char[nWidth*nHeight]; //膨胀和腐蚀 加速用 | |
278 | - memset(maskImg, 0, sizeof(maskImg[0])*nWidth*nHeight); //膨胀和腐蚀 加速用 | |
277 | + maskImg = new unsigned char[nWidth*nHeight]; //锟斤拷锟酵和革拷蚀 锟斤拷锟斤拷锟斤拷 | |
278 | + memset(maskImg, 0, sizeof(maskImg[0])*nWidth*nHeight); //锟斤拷锟酵和革拷蚀 锟斤拷锟斤拷锟斤拷 | |
279 | 279 | |
280 | 280 | return 1; |
281 | 281 | } |
... | ... | @@ -319,17 +319,17 @@ VibeModel_t * RegionSurveillance::VibeModelInitC1(uint8_t *image_data) |
319 | 319 | |
320 | 320 | /****************************************************************************** |
321 | 321 | * Function: VibeModelInitC3 |
322 | -* Description: VIBE模型初始化 | |
322 | +* Description: VIBE模锟酵筹拷始锟斤拷 | |
323 | 323 | * Calls: RandInit |
324 | 324 | RandNeighborInit |
325 | 325 | GetRandNeighborXY |
326 | 326 | * Called By: RSinit |
327 | -* Input: image_data 图像RGB | |
327 | +* Input: image_data 图锟斤拷RGB | |
328 | 328 | * Output: g_XNeighborTable 22100012 |
329 | 329 | g_YNeighborTable 10001222 |
330 | - g_randTable 65536个随机数 | |
331 | - g_XTable 0 0 1 2 3 ... 宽度-1 宽度-1 | |
332 | - g_YTable 0 0 1 2 3 ... 高度-1 高度-1 | |
330 | + g_randTable 65536锟斤拷锟斤拷锟斤拷锟 | |
331 | + g_XTable 0 0 1 2 3 ... 锟斤拷锟斤拷-1 锟斤拷锟斤拷-1 | |
332 | + g_YTable 0 0 1 2 3 ... 锟竭讹拷-1 锟竭讹拷-1 | |
333 | 333 | * Return: vbM |
334 | 334 | *******************************************************************************/ |
335 | 335 | VibeModel_t* RegionSurveillance::VibeModelInitC3(uint8_t *image_data) |
... | ... | @@ -449,11 +449,11 @@ void RegionSurveillance::VibeModelUpdateC1(VibeModel_t *model, uint8_t *image, u |
449 | 449 | }// end of for y loop |
450 | 450 | |
451 | 451 | |
452 | - VibeModelDilation2(output, maskImg, model->width, model->height);// 膨胀 | |
453 | - VibeModelErosion2(maskImg, output, model->width, model->height);// 腐蚀 | |
454 | - //未加速版本 | |
455 | - //VibeModelDilation(output, model->width, model->height);// 膨胀 | |
456 | - //VibeModelErosion(output, model->width, model->height);// 腐蚀 | |
452 | + VibeModelDilation2(output, maskImg, model->width, model->height);// 锟斤拷锟斤拷 | |
453 | + VibeModelErosion2(maskImg, output, model->width, model->height);// 锟斤拷蚀 | |
454 | + //未锟斤拷锟劫版本 | |
455 | + //VibeModelDilation(output, model->width, model->height);// 锟斤拷锟斤拷 | |
456 | + //VibeModelErosion(output, model->width, model->height);// 锟斤拷蚀 | |
457 | 457 | |
458 | 458 | |
459 | 459 | g_frameCount++; |
... | ... | @@ -462,16 +462,16 @@ void RegionSurveillance::VibeModelUpdateC1(VibeModel_t *model, uint8_t *image, u |
462 | 462 | |
463 | 463 | /****************************************************************************** |
464 | 464 | * Function: VibeModelUpdateC3 |
465 | -* Description: VIBE模型更新 | |
465 | +* Description: VIBE模锟酵革拷锟斤拷 | |
466 | 466 | * Calls: GetRand |
467 | 467 | GetRandNeighborXY |
468 | 468 | VibeModelDilation |
469 | 469 | VibeModelErosion |
470 | 470 | * Called By: RSDetect |
471 | -* Input: model VBM 模型 | |
472 | - image 图像RGB | |
473 | -* Output: output 前景是255 背景是0 | |
474 | - model VBM 模型 | |
471 | +* Input: model VBM 模锟斤拷 | |
472 | + image 图锟斤拷RGB | |
473 | +* Output: output 前锟斤拷锟斤拷255 锟斤拷锟斤拷锟斤拷0 | |
474 | + model VBM 模锟斤拷 | |
475 | 475 | *******************************************************************************/ |
476 | 476 | void RegionSurveillance::VibeModelUpdateC3(VibeModel_t *model, uint8_t *image, uint8_t *output) |
477 | 477 | { |
... | ... | @@ -487,10 +487,10 @@ void RegionSurveillance::VibeModelUpdateC3(VibeModel_t *model, uint8_t *image, u |
487 | 487 | { |
488 | 488 | for (x = 0; x < model->width; x++) |
489 | 489 | { |
490 | - // 当前点对应的模板中的索引 | |
490 | + // 锟斤拷前锟斤拷锟接︼拷锟侥o拷锟斤拷械锟斤拷锟斤拷锟 | |
491 | 491 | sampleOffset = ((y * model-> width * model->nSample + x * model->nSample) << 1) + (y * model-> width * model->nSample + x * model->nSample); |
492 | 492 | |
493 | - // 当前点对应的RGB中的索引 | |
493 | + // 锟斤拷前锟斤拷锟接︼拷锟絉GB锟叫碉拷锟斤拷锟斤拷 | |
494 | 494 | imageOffset = ((y * model->width + x) << 1) + (y * model->width + x); |
495 | 495 | |
496 | 496 | // if (imageOffset>=(model->width * model->height)) |
... | ... | @@ -500,7 +500,7 @@ void RegionSurveillance::VibeModelUpdateC3(VibeModel_t *model, uint8_t *image, u |
500 | 500 | count = 0; |
501 | 501 | index = 0; |
502 | 502 | |
503 | - // 如果当前满足阈值的点数小于规定匹配点数 且 当前评估的点数小于20个点 | |
503 | + // 锟斤拷锟斤拷锟角帮拷锟斤拷锟斤拷锟街碉拷牡锟斤拷锟叫★拷诠娑ㄆワ拷锟斤拷锟斤拷 锟斤拷 锟斤拷前锟斤拷锟斤拷锟侥碉拷锟斤拷小锟斤拷20锟斤拷锟斤拷 | |
504 | 504 | while ((count < model->nMatch) && (index < model->nSample)) |
505 | 505 | { |
506 | 506 | //Euclidean distance computation |
... | ... | @@ -508,10 +508,10 @@ void RegionSurveillance::VibeModelUpdateC3(VibeModel_t *model, uint8_t *image, u |
508 | 508 | dist = (double)((image[imageOffset] - model->bg_samples[tmpValue ])*(image[imageOffset] - model->bg_samples[tmpValue])) + |
509 | 509 | (double)((image[imageOffset + 1] - model->bg_samples[tmpValue + 1])*(image[imageOffset + 1] - model->bg_samples[tmpValue+ 1])) + |
510 | 510 | (double)((image[imageOffset + 2] - model->bg_samples[tmpValue + 2])*(image[imageOffset + 2] - model->bg_samples[tmpValue + 2])); |
511 | - // 三通道计算距离之和 | |
511 | + // 锟斤拷通锟斤拷锟斤拷锟斤拷锟斤拷锟街拷锟 | |
512 | 512 | //dist = abs(image[imageOffset] - model->bg_samples[tmpValue]) + abs(image[imageOffset + 1] - model->bg_samples[tmpValue + 1]) |
513 | 513 | //+ abs(image[imageOffset + 2] - model->bg_samples[tmpValue + 2]); |
514 | - // 满足阈值条件的点 | |
514 | + // 锟斤拷锟斤拷锟斤拷值锟斤拷锟斤拷锟侥碉拷 | |
515 | 515 | if (dist < model->threshold * model->threshold * 3) |
516 | 516 | { |
517 | 517 | count++; |
... | ... | @@ -520,22 +520,22 @@ void RegionSurveillance::VibeModelUpdateC3(VibeModel_t *model, uint8_t *image, u |
520 | 520 | index++; |
521 | 521 | } |
522 | 522 | |
523 | - // 如果当前点为前景 | |
523 | + // 锟斤拷锟斤拷锟角帮拷锟轿帮拷锟 | |
524 | 524 | if (count < model->nMatch) |
525 | 525 | { |
526 | 526 | output[y * model->width + x] = VBPARAM->DEFAULT_COLOR_FOREGROUND; |
527 | 527 | |
528 | - // 前20帧增加模板信息 | |
528 | + // 前20帧锟斤拷锟斤拷模锟斤拷锟斤拷息 | |
529 | 529 | if (g_frameCount < model->nSample) |
530 | 530 | { |
531 | - // 随机更新当前点对应的模板中的某一背景 | |
531 | + // 锟斤拷锟斤拷锟斤拷碌锟角帮拷锟斤拷应锟斤拷模锟斤拷锟叫碉拷某一锟斤拷锟斤拷 | |
532 | 532 | rand = GetRand() % (model->nSample); |
533 | 533 | tmpValue = sampleOffset + ((rand << 1) +rand ); |
534 | 534 | model->bg_samples[tmpValue] = image[imageOffset]; |
535 | 535 | model->bg_samples[tmpValue + 1] = image[imageOffset + 1]; |
536 | 536 | model->bg_samples[tmpValue + 2] = image[imageOffset + 2]; |
537 | 537 | |
538 | - // 同时随机对当前点的某一个相邻点对应的模板中的随机一背景进行更新 | |
538 | + // 同时锟斤拷锟斤拷缘锟角帮拷锟斤拷某一锟斤拷锟斤拷锟节碉拷锟接︼拷锟侥o拷锟斤拷械锟斤拷锟斤拷一锟斤拷锟斤拷锟斤拷锟叫革拷锟斤拷 | |
539 | 539 | GetRandNeighborXY(x, y, &xNG, &yNG); |
540 | 540 | rand = GetRand() % (model->nSample); |
541 | 541 | 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 |
545 | 545 | } |
546 | 546 | } |
547 | 547 | |
548 | - // 如果当前点为背景 | |
548 | + // 锟斤拷锟斤拷锟角帮拷锟轿拷锟斤拷锟 | |
549 | 549 | else |
550 | 550 | { |
551 | 551 | output[y * model->width + x] = VBPARAM->DEFAULT_COLOR_BACKGROUND; |
552 | 552 | |
553 | - // 对前20帧进行VIBE模板更新(同前景) | |
553 | + // 锟斤拷前20帧锟斤拷锟斤拷VIBE模锟斤拷锟斤拷拢锟酵帮拷锟斤拷锟 | |
554 | 554 | if (g_frameCount < model->nSample) |
555 | 555 | { |
556 | 556 | //curr |
... | ... | @@ -582,7 +582,7 @@ void RegionSurveillance::VibeModelUpdateC3(VibeModel_t *model, uint8_t *image, u |
582 | 582 | } |
583 | 583 | |
584 | 584 | //update neighboring pixel model |
585 | - // 满足条件才进行背景更新(为了提速) | |
585 | + // 锟斤拷锟斤拷锟斤拷锟斤拷锟脚斤拷锟叫憋拷锟斤拷锟斤拷锟铰o拷为锟斤拷锟斤拷锟劫o拷 | |
586 | 586 | rand = GetRand() % (model->upSpeed); |
587 | 587 | if (rand == 0 && left_flag == 1) |
588 | 588 | { |
... | ... | @@ -606,11 +606,11 @@ void RegionSurveillance::VibeModelUpdateC3(VibeModel_t *model, uint8_t *image, u |
606 | 606 | }// end of for y loop |
607 | 607 | |
608 | 608 | |
609 | - //VibeModelDilation(output, model->width, model->height); // 膨胀 | |
610 | - //VibeModelErosion(output, model->width, model->height);// 腐蚀 | |
609 | + //VibeModelDilation(output, model->width, model->height); // 锟斤拷锟斤拷 | |
610 | + //VibeModelErosion(output, model->width, model->height);// 锟斤拷蚀 | |
611 | 611 | |
612 | - VibeModelDilation2(output, maskImg, model->width, model->height); // 加速 膨胀 | |
613 | - VibeModelErosion2(maskImg, output, model->width, model->height); // 加速 膨胀 | |
612 | + VibeModelDilation2(output, maskImg, model->width, model->height); // 锟斤拷锟斤拷 锟斤拷锟斤拷 | |
613 | + VibeModelErosion2(maskImg, output, model->width, model->height); // 锟斤拷锟斤拷 锟斤拷锟斤拷 | |
614 | 614 | |
615 | 615 | //VibeModelErosion(output,model->width,model->height); |
616 | 616 | |
... | ... | @@ -629,11 +629,11 @@ void RegionSurveillance::RSDetect(unsigned char* frameImgData, RegionInfo* pRegi |
629 | 629 | } |
630 | 630 | */ |
631 | 631 | |
632 | - // 获得当前帧的前景和背景(前景255 背景0)同时对VIBE模板进行更新 | |
632 | + // 锟斤拷玫锟角爸★拷锟角帮拷锟斤拷捅锟斤拷锟斤拷锟角帮拷锟55 锟斤拷锟斤拷0锟斤拷同时锟斤拷VIBE模锟斤拷锟斤拷懈锟斤拷锟 | |
633 | 633 | //VibeModelUpdateC3(vbM, frameImgData, greyImgData, MaskImgData); |
634 | 634 | if (vbM->nChannel == 3) |
635 | 635 | { |
636 | - // 高斯模糊 | |
636 | + // 锟斤拷斯模锟斤拷 | |
637 | 637 | if (gfiltFlag == 1) |
638 | 638 | { |
639 | 639 | unsigned char* inputData = NULL; |
... | ... | @@ -671,10 +671,10 @@ void RegionSurveillance::RSDetect(unsigned char* frameImgData, RegionInfo* pRegi |
671 | 671 | { |
672 | 672 | if (channel_num == 3) |
673 | 673 | { |
674 | - // 将RGB图像转换为灰度图像 | |
674 | + // 锟斤拷RGB图锟斤拷转锟斤拷为锟揭讹拷图锟斤拷 | |
675 | 675 | VibeRGBToGray(frameImgData, greyImgData); |
676 | 676 | |
677 | - // 高斯模糊 | |
677 | + // 锟斤拷斯模锟斤拷 | |
678 | 678 | if (gfiltFlag == 1) |
679 | 679 | { |
680 | 680 | unsigned char* inputData = NULL; |
... | ... | @@ -705,7 +705,7 @@ void RegionSurveillance::RSDetect(unsigned char* frameImgData, RegionInfo* pRegi |
705 | 705 | } |
706 | 706 | else |
707 | 707 | { |
708 | - // 高斯模糊 | |
708 | + // 锟斤拷斯模锟斤拷 | |
709 | 709 | if (gfiltFlag == 1) |
710 | 710 | { |
711 | 711 | unsigned char* inputData = NULL; |
... | ... | @@ -739,7 +739,7 @@ void RegionSurveillance::RSDetect(unsigned char* frameImgData, RegionInfo* pRegi |
739 | 739 | |
740 | 740 | |
741 | 741 | /* |
742 | - // 显示二值图像 | |
742 | + // 锟斤拷示锟斤拷值图锟斤拷 | |
743 | 743 | CvSize a; |
744 | 744 | a.width = GlobelWidth; |
745 | 745 | a.height = GlobelHeight; |
... | ... | @@ -756,12 +756,12 @@ void RegionSurveillance::RSDetect(unsigned char* frameImgData, RegionInfo* pRegi |
756 | 756 | |
757 | 757 | /****************************************************************************** |
758 | 758 | * Function: VibeModelDilation |
759 | -* Description: VIBE模型膨胀(如果当前点为前景或者当前点的邻域中有一个为前景,则当前点位前景) | |
759 | +* Description: VIBE模锟斤拷锟斤拷锟酵o拷锟斤拷锟斤拷锟角帮拷锟轿帮拷锟斤拷锟斤拷叩锟角帮拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷一锟斤拷为前锟斤拷锟斤拷锟斤拷前锟斤拷位前锟斤拷锟斤拷 | |
760 | 760 | * Called By: VibeModelUpdateC3 |
761 | -* Input: inputdata 当前图像前景背景(前景为255 背景为0) | |
762 | - width 图像宽度 | |
763 | - height 图像高度 | |
764 | -* Output: inputdata 膨胀后当前图像前景背景 | |
761 | +* Input: inputdata 锟斤拷前图锟斤拷前锟斤拷锟斤拷锟斤拷锟斤拷前锟斤拷为255 锟斤拷锟斤拷为0锟斤拷 | |
762 | + width 图锟斤拷锟斤拷锟 | |
763 | + height 图锟斤拷叨锟 | |
764 | +* Output: inputdata 锟斤拷锟酵猴拷前图锟斤拷前锟斤拷锟斤拷锟斤拷 | |
765 | 765 | *******************************************************************************/ |
766 | 766 | void RegionSurveillance::VibeModelDilation(unsigned char* inputdata, int width, int height) |
767 | 767 | { |
... | ... | @@ -805,12 +805,12 @@ void RegionSurveillance::VibeModelDilation(unsigned char* inputdata, int width, |
805 | 805 | |
806 | 806 | /****************************************************************************** |
807 | 807 | * Function: VibeModelErosion |
808 | -* Description: VIBE模型腐蚀(如果当前点或当前点的某一个邻域中有一个点为背景,则当前为背景) | |
808 | +* Description: VIBE模锟酵革拷蚀锟斤拷锟斤拷锟斤拷锟角帮拷锟斤拷前锟斤拷锟侥骋伙拷锟斤拷锟斤拷锟斤拷锟斤拷锟揭伙拷锟斤拷锟轿拷锟斤拷锟斤拷锟斤拷锟角拔拷锟斤拷锟斤拷锟 | |
809 | 809 | * Called By: VibeModelUpdateC3 |
810 | -* Input: inputdata 当前图像前景背景(前景为255 背景为0) | |
811 | - width 图像宽度 | |
812 | - height 图像高度 | |
813 | -* Output: inputdata 腐蚀后当前图像前景背景 | |
810 | +* Input: inputdata 锟斤拷前图锟斤拷前锟斤拷锟斤拷锟斤拷锟斤拷前锟斤拷为255 锟斤拷锟斤拷为0锟斤拷 | |
811 | + width 图锟斤拷锟斤拷锟 | |
812 | + height 图锟斤拷叨锟 | |
813 | +* Output: inputdata 锟斤拷蚀锟斤拷前图锟斤拷前锟斤拷锟斤拷锟斤拷 | |
814 | 814 | *******************************************************************************/ |
815 | 815 | void RegionSurveillance::VibeModelErosion(unsigned char* inputdata, int width, int height) |
816 | 816 | { |
... | ... | @@ -871,7 +871,7 @@ typedef struct _int_128 |
871 | 871 | |
872 | 872 | const _int_128 & int_128_max(const _int_128 & n1, const _int_128 & n2) |
873 | 873 | { |
874 | - if (platform_little_endian) //小端 | |
874 | + if (platform_little_endian) //小锟斤拷 | |
875 | 875 | { |
876 | 876 | if (n1._n2 > n2._n2) |
877 | 877 | { |
... | ... | @@ -899,7 +899,7 @@ const _int_128 & int_128_max(const _int_128 & n1, const _int_128 & n2) |
899 | 899 | } |
900 | 900 | else |
901 | 901 | { |
902 | - if (n1._n1 > n2._n1) //大端 | |
902 | + if (n1._n1 > n2._n1) //锟斤拷锟 | |
903 | 903 | { |
904 | 904 | return n1; |
905 | 905 | } |
... | ... | @@ -1100,7 +1100,7 @@ void RegionSurveillance::VibeModelErosion2(unsigned char* inputdata, unsigned ch |
1100 | 1100 | //} |
1101 | 1101 | |
1102 | 1102 | |
1103 | -//按照中心点的位置进行排序 by zl | |
1103 | +//锟斤拷锟斤拷锟斤拷锟侥碉拷锟轿伙拷媒锟斤拷锟斤拷锟斤拷锟 by zl | |
1104 | 1104 | void RegionSurveillance::SortForeground(vector<CForeground> &ForegroundArray) |
1105 | 1105 | { |
1106 | 1106 | std::sort(ForegroundArray.begin(),ForegroundArray.end(), SortByPoint); |
... | ... | @@ -1111,30 +1111,30 @@ int RegionSurveillance::dwGlobalID; |
1111 | 1111 | /****************************************************************************** |
1112 | 1112 | * Function: VibeModelGetTrace |
1113 | 1113 | * Description: |
1114 | -* Calls: ExtractContours | |
1114 | +* Calls锟斤拷 ExtractContours | |
1115 | 1115 | * Called By: RSDetect |
1116 | -* Input: pSourceImg 当前图像前景背景(前景为255 背景为0) | |
1117 | - pRGBIn 当前图像RGB | |
1118 | - width 图像宽度 | |
1119 | - height 图像高度 | |
1120 | - widthStep 图像RGB step | |
1121 | -* Output: pRGBIn 将前景描绘过的RGB | |
1116 | +* Input: pSourceImg 锟斤拷前图锟斤拷前锟斤拷锟斤拷锟斤拷锟斤拷前锟斤拷为255 锟斤拷锟斤拷为0锟斤拷 | |
1117 | + pRGBIn 锟斤拷前图锟斤拷RGB | |
1118 | + width 图锟斤拷锟斤拷锟 | |
1119 | + height 图锟斤拷叨锟 | |
1120 | + widthStep 图锟斤拷RGB step | |
1121 | +* Output: pRGBIn 锟斤拷前锟斤拷锟斤拷锟斤拷锟斤拷RGB | |
1122 | 1122 | m_TargetArray |
1123 | - m_ptArray 与当前目标匹配成功的所有前景的中心点 | |
1124 | - m_VectorDirection 当前目标与之前目标的向量 | |
1123 | + m_ptArray 锟诫当前目锟斤拷匹锟斤拷晒锟斤拷锟斤拷锟斤拷锟角帮拷锟斤拷锟斤拷锟斤拷牡锟 | |
1124 | + m_VectorDirection 锟斤拷前目锟斤拷锟斤拷之前目锟斤拷锟斤拷锟斤拷锟 | |
1125 | 1125 | //m_VectorDirectionNormal dx/sqrt(dx^2+dy^2) dy/sqrt(dx^2+dy^2) |
1126 | - m_CurRefPoint 目标的中心点位置(不断更新,取5个的平均值) | |
1127 | - m_LastRefPoint 目标之前的中心点位置(不断更新,取5个的平均值) | |
1128 | - m_PredictionBasePoint 最后一个匹配点中心位置 | |
1129 | - m_PredictionPoint 下一帧的预测位置 | |
1130 | - m_bHaveDirection 当前目标是否已经计算过方向 true是 flase否 | |
1131 | - m_dwLostFrame 距当前帧未匹配到的数目(用来判断是否目标丢失) | |
1132 | - m_dwID ID 用来对不同的前景绘图时进行颜色上的区分 | |
1133 | - m_dwBestMatch 匹配到当前帧的前景序号 | |
1134 | - m_bCalc 标志目标序列在当前帧中是否匹配到 true匹配到 false未匹配到 | |
1135 | - m_AlarmState 报警状态 false否 true报警 | |
1136 | - m_AlarmNum 报警编号 | |
1137 | - //m_TarBox 目标的外接矩形 | |
1126 | + m_CurRefPoint 目锟斤拷锟斤拷锟斤拷牡锟轿伙拷茫锟斤拷锟斤拷细锟斤拷拢锟饺拷锟斤拷锟狡斤拷锟街碉拷锟 | |
1127 | + m_LastRefPoint 目锟斤拷之前锟斤拷锟斤拷锟侥碉拷位锟矫o拷锟斤拷锟较革拷锟铰o拷取5锟斤拷锟斤拷平锟斤拷值锟斤拷 | |
1128 | + m_PredictionBasePoint 锟斤拷锟揭伙拷锟狡ワ拷锟斤拷锟斤拷锟斤拷位锟斤拷 | |
1129 | + m_PredictionPoint 锟斤拷一帧锟斤拷预锟斤拷位锟斤拷 | |
1130 | + m_bHaveDirection 锟斤拷前目锟斤拷锟角凤拷锟窖撅拷锟斤拷锟斤拷锟斤拷锟斤拷锟 true锟斤拷 flase锟斤拷 | |
1131 | + m_dwLostFrame 锟洁当前帧未匹锟戒到锟斤拷锟斤拷目锟斤拷锟斤拷锟斤拷锟叫讹拷锟角凤拷目锟疥丢失锟斤拷 | |
1132 | + m_dwID ID 锟斤拷锟斤拷锟皆诧拷同锟斤拷前锟斤拷锟斤拷图时锟斤拷锟斤拷锟斤拷色锟较碉拷锟斤拷锟斤拷 | |
1133 | + m_dwBestMatch 匹锟戒到锟斤拷前帧锟斤拷前锟斤拷锟斤拷锟 | |
1134 | + m_bCalc 锟斤拷志目锟斤拷锟斤拷锟斤拷锟节碉拷前帧锟斤拷锟角凤拷匹锟戒到 true匹锟戒到 false未匹锟戒到 | |
1135 | + m_AlarmState 锟斤拷锟斤拷状态 false锟斤拷 true锟斤拷锟斤拷 | |
1136 | + m_AlarmNum 锟斤拷锟斤拷锟斤拷锟 | |
1137 | + //m_TarBox 目锟斤拷锟斤拷锟接撅拷锟斤拷 | |
1138 | 1138 | *******************************************************************************/ |
1139 | 1139 | void RegionSurveillance::VibeModelGetTrace(unsigned char* pSourceImg, float *MaskImgCfd, unsigned char* pRGBIn, RegionInfo* pRegionInfo) |
1140 | 1140 | { |
... | ... | @@ -1150,13 +1150,13 @@ void RegionSurveillance::VibeModelGetTrace(unsigned char* pSourceImg, float *Mas |
1150 | 1150 | int m_dwMaxLost = 100; |
1151 | 1151 | int m_dwMinFrame = 6; |
1152 | 1152 | int dwTargetSize = 0; |
1153 | - CForeground testTarget; // testForgroundArray 中的testTarget | |
1153 | + CForeground testTarget; // testForgroundArray 锟叫碉拷testTarget | |
1154 | 1154 | |
1155 | - //前景图集合-zhm | |
1155 | + //前锟斤拷图锟斤拷锟斤拷-zhm | |
1156 | 1156 | vector<CContour> foreContours; |
1157 | 1157 | CConExtraction *pConExtraction = new CConExtraction(); |
1158 | 1158 | |
1159 | - // 满足条件的(像素点 面积等条件100)前景外接矩形 | |
1159 | + // 锟斤拷锟斤拷锟斤拷锟斤拷锟侥o拷锟斤拷锟截碉拷 锟斤拷锟斤拷锟斤拷锟斤拷锟00锟斤拷前锟斤拷锟斤拷泳锟斤拷锟 | |
1160 | 1160 | if (channel_num == 3) |
1161 | 1161 | { |
1162 | 1162 | foreContours = pConExtraction->ExtractContours(pSourceImg, MaskImgCfd,GlobelWidth, GlobelHeight, GlobelWidthstep / 3); |
... | ... | @@ -1166,8 +1166,8 @@ void RegionSurveillance::VibeModelGetTrace(unsigned char* pSourceImg, float *Mas |
1166 | 1166 | foreContours = pConExtraction->ExtractContours(pSourceImg, MaskImgCfd, GlobelWidth, GlobelHeight, GlobelWidthstep); |
1167 | 1167 | } |
1168 | 1168 | |
1169 | - //轨迹匹配-zhm | |
1170 | - // 进一步在foreContours的基础上对前景外接矩形的面积进行筛选 将满足面积大于300的外接矩形添入ForegroundArray中 | |
1169 | + //锟届迹匹锟斤拷-zhm | |
1170 | + // 锟斤拷一锟斤拷锟斤拷foreContours锟侥伙拷锟斤拷锟较讹拷前锟斤拷锟斤拷泳锟斤拷蔚锟斤拷锟斤拷锟斤拷锟斤拷筛选 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟00锟斤拷锟斤拷泳锟斤拷锟斤拷锟斤拷锟紽oregroundArray锟斤拷 | |
1171 | 1171 | int forNum = foreContours.size(); |
1172 | 1172 | for (int i = 0; i < forNum; i++) |
1173 | 1173 | { |
... | ... | @@ -1180,7 +1180,7 @@ void RegionSurveillance::VibeModelGetTrace(unsigned char* pSourceImg, float *Mas |
1180 | 1180 | testTarget.m_ptCenter.y = (testTarget.m_rtConnect.top + testTarget.m_rtConnect.bottom) / 2; |
1181 | 1181 | testTarget.m_cfd = foreContours[i].cfd; |
1182 | 1182 | |
1183 | - //大于最小过滤面积且小于最大过滤面积 by zl 20160304 | |
1183 | + //锟斤拷锟斤拷锟斤拷小锟斤拷锟斤拷锟斤拷锟斤拷锟叫★拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷 by zl 20160304 | |
1184 | 1184 | int targetArea = abs((testTarget.m_rtConnect.left - testTarget.m_rtConnect.right) * (testTarget.m_rtConnect.top - testTarget.m_rtConnect.bottom)); |
1185 | 1185 | if ( targetArea > OBJECT_AREA_MIN && targetArea < OBJECT_AREA_MAX) |
1186 | 1186 | { |
... | ... | @@ -1189,7 +1189,7 @@ void RegionSurveillance::VibeModelGetTrace(unsigned char* pSourceImg, float *Mas |
1189 | 1189 | |
1190 | 1190 | |
1191 | 1191 | } |
1192 | - if(ForegroundArray.size() > 0) //前景库不空则排序处理 by zl 20160307 | |
1192 | + if(ForegroundArray.size() > 0) //前锟斤拷锟解不锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷 by zl 20160307 | |
1193 | 1193 | { |
1194 | 1194 | SortForeground(ForegroundArray); |
1195 | 1195 | MergeNeighborBox(ForegroundArray); |
... | ... | @@ -1208,14 +1208,14 @@ void RegionSurveillance::VibeModelGetTrace(unsigned char* pSourceImg, float *Mas |
1208 | 1208 | delete pConExtraction; |
1209 | 1209 | // memory leak for 1 block |
1210 | 1210 | m_DelArray.clear(); |
1211 | - //判断是否帧内目标丢失,若丢失dwTargetSize自减 | |
1211 | + //锟叫讹拷锟角凤拷帧锟斤拷目锟疥丢失锟斤拷锟斤拷锟斤拷失dwTargetSize锟皆硷拷 | |
1212 | 1212 | vector<CTarget>::size_type countn = 0; |
1213 | 1213 | int dwStep = GlobelWidthstep; |
1214 | 1214 | ///////////////////////////////////////////////////////////////////////////////////////// |
1215 | 1215 | dwTargetSize = m_TargetArray.size(); |
1216 | 1216 | for (int i = 0; i < dwTargetSize; i++, countn++) |
1217 | 1217 | { |
1218 | - // 若已经超过100帧未出现该前景 则将该前景从m_TargetArray中删除 | |
1218 | + // 锟斤拷锟窖撅拷锟斤拷锟斤拷100帧未锟斤拷锟街革拷前锟斤拷 锟津将革拷前锟斤拷锟斤拷m_TargetArray锟斤拷删锟斤拷 | |
1219 | 1219 | if (m_TargetArray[i].m_dwLostFrame++ > m_dwMaxLost) |
1220 | 1220 | { |
1221 | 1221 | m_DelArray.push_back(*(m_TargetArray.begin() + countn)); |
... | ... | @@ -1247,7 +1247,7 @@ void RegionSurveillance::VibeModelGetTrace(unsigned char* pSourceImg, float *Mas |
1247 | 1247 | dwTargetSize = m_TargetArray.size(); |
1248 | 1248 | double * pDistanceMatrix = new double[dwForegroundCount * dwTargetSize]; |
1249 | 1249 | |
1250 | - // 将每一个目标和该帧中的前景进行匹配 | |
1250 | + // 锟斤拷每一锟斤拷目锟斤拷透锟街★拷械锟角帮拷锟斤拷锟斤拷锟狡ワ拷锟 | |
1251 | 1251 | for (int i = 0; i < dwTargetSize; i++) |
1252 | 1252 | { |
1253 | 1253 | //CMPointDouble directionPre; |
... | ... | @@ -1279,7 +1279,7 @@ void RegionSurveillance::VibeModelGetTrace(unsigned char* pSourceImg, float *Mas |
1279 | 1279 | m_FinalArray.clear(); |
1280 | 1280 | //m_TargetArray.clear(); |
1281 | 1281 | // Tracking and draw |
1282 | - // 对当前帧的每一个前景与目标进行匹配 | |
1282 | + // 锟皆碉拷前帧锟斤拷每一锟斤拷前锟斤拷锟斤拷目锟斤拷锟斤拷锟狡ワ拷锟 | |
1283 | 1283 | bool left_flag_c = 1; |
1284 | 1284 | for (int i = 0; i < dwForegroundCount; i++) |
1285 | 1285 | { |
... | ... | @@ -1307,7 +1307,7 @@ void RegionSurveillance::VibeModelGetTrace(unsigned char* pSourceImg, float *Mas |
1307 | 1307 | } |
1308 | 1308 | } |
1309 | 1309 | //m_TargetArray.clear(); |
1310 | - // 如果匹配成功 m_TargetArray[dwBestMatch].m_ptArray.size() !=500??????????????????????不理解为什么不能等于500 | |
1310 | + // 锟斤拷锟狡ワ拷锟缴癸拷 m_TargetArray[dwBestMatch].m_ptArray.size() !=500锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷为什么锟斤拷锟杰碉拷锟斤拷500 | |
1311 | 1311 | if (dwBestMatch >= 0 && m_TargetArray[dwBestMatch].m_dwBestMatch == i && m_TargetArray[dwBestMatch].m_ptArray.size() < 500) |
1312 | 1312 | { |
1313 | 1313 | // Find it |
... | ... | @@ -1335,10 +1335,10 @@ void RegionSurveillance::VibeModelGetTrace(unsigned char* pSourceImg, float *Mas |
1335 | 1335 | } |
1336 | 1336 | |
1337 | 1337 | // Update last reference point |
1338 | - // 如果与目标匹配成功的前景达到一定数量 | |
1338 | + // 锟斤拷锟斤拷锟侥匡拷锟狡ワ拷锟缴癸拷锟斤拷前锟斤拷锟斤到一锟斤拷锟斤拷锟斤拷 | |
1339 | 1339 | if (dwPointCount > m_dwFrameDist) |
1340 | 1340 | { |
1341 | - // 目标之前的中心点位置(5帧帧平均) | |
1341 | + // 目锟斤拷之前锟斤拷锟斤拷锟侥碉拷位锟矫o拷5帧帧平锟斤拷锟斤拷 | |
1342 | 1342 | m_TargetArray[dwBestMatch].m_LastRefPoint.x += |
1343 | 1343 | (double) m_TargetArray[dwBestMatch].m_ptArray[dwPointCount - m_dwFrameDist - 1].x / m_dwFrameWnd; |
1344 | 1344 | m_TargetArray[dwBestMatch].m_LastRefPoint.y += |
... | ... | @@ -1371,13 +1371,13 @@ void RegionSurveillance::VibeModelGetTrace(unsigned char* pSourceImg, float *Mas |
1371 | 1371 | } |
1372 | 1372 | else |
1373 | 1373 | { |
1374 | - // 检测到新的目标 | |
1374 | + // 锟斤拷獾斤拷碌锟侥匡拷锟 | |
1375 | 1375 | // New object found |
1376 | 1376 | CTarget NewTarget; |
1377 | 1377 | //NewTarget.GetID(); |
1378 | 1378 | NewTarget.m_dwID= ++dwGlobalID; // GlobalID assigned for target |
1379 | 1379 | |
1380 | - // 新的前景的中心位置 | |
1380 | + // 锟铰碉拷前锟斤拷锟斤拷锟斤拷锟斤拷位锟斤拷 | |
1381 | 1381 | NewTarget.m_ptArray.push_back(ForegroundArray[i].m_ptCenter); |
1382 | 1382 | |
1383 | 1383 | m_TargetArray.push_back(NewTarget); |
... | ... | @@ -1392,7 +1392,7 @@ void RegionSurveillance::VibeModelGetTrace(unsigned char* pSourceImg, float *Mas |
1392 | 1392 | dwBestMatch = m_TargetArray.size() - 1; |
1393 | 1393 | |
1394 | 1394 | // Update current reference point |
1395 | - //m_TargetArray-m_CurRefPoint当前前景的中心点位置(取五帧的平均数) | |
1395 | + //m_TargetArray-m_CurRefPoint锟斤拷前前锟斤拷锟斤拷锟斤拷锟侥碉拷位锟矫o拷取锟斤拷帧锟斤拷平锟斤拷锟斤拷锟斤拷 | |
1396 | 1396 | m_TargetArray[dwBestMatch].m_CurRefPoint.x += (double)ForegroundArray[i].m_ptCenter.x / m_dwFrameWnd; |
1397 | 1397 | m_TargetArray[dwBestMatch].m_CurRefPoint.y += (double)ForegroundArray[i].m_ptCenter.y / m_dwFrameWnd; |
1398 | 1398 | |
... | ... | @@ -1414,7 +1414,7 @@ void RegionSurveillance::VibeModelGetTrace(unsigned char* pSourceImg, float *Mas |
1414 | 1414 | } |
1415 | 1415 | } |
1416 | 1416 | |
1417 | - //保存最终输出目标 | |
1417 | + //锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟侥匡拷锟 | |
1418 | 1418 | m_FinalArray.push_back(m_TargetArray[dwBestMatch]); |
1419 | 1419 | /* |
1420 | 1420 | // Draw it |
... | ... | @@ -1427,8 +1427,8 @@ void RegionSurveillance::VibeModelGetTrace(unsigned char* pSourceImg, float *Mas |
1427 | 1427 | unsigned char bBlue = (unsigned char) ((m_TargetArray[dwBestMatch].m_dwID % 13) * 20 + 15); |
1428 | 1428 | |
1429 | 1429 | // Draw rectangle |
1430 | - //横线 | |
1431 | - // 目标外接矩形 红色 | |
1430 | + //锟斤拷锟斤拷 | |
1431 | + // 目锟斤拷锟斤拷泳锟斤拷锟 锟斤拷色 | |
1432 | 1432 | for (int t = ForegroundArray[i].m_rtConnect.left; t <= ForegroundArray[i].m_rtConnect.right; t++) |
1433 | 1433 | { |
1434 | 1434 | pRGBIn[ForegroundArray[i].m_rtConnect.top * dwStep + t * 3] = 0; |
... | ... | @@ -1455,11 +1455,11 @@ void RegionSurveillance::VibeModelGetTrace(unsigned char* pSourceImg, float *Mas |
1455 | 1455 | int d = ForegroundArray[i].m_rtConnect.right; |
1456 | 1456 | |
1457 | 1457 | |
1458 | - // ROI 监控 | |
1458 | + // ROI 锟斤拷锟 | |
1459 | 1459 | for (int ii = 0; ii < m_numROI; ii++) |
1460 | 1460 | { |
1461 | - // 目标外接矩形进行区域且目标中心点在区域内,则报警 | |
1462 | - if (pAlarmInfo[ii] == 1) //禁止区域 | |
1461 | + // 目锟斤拷锟斤拷泳锟斤拷谓锟斤拷锟斤拷锟斤拷锟斤拷锟侥匡拷锟斤拷锟斤拷牡锟斤拷锟斤拷锟斤拷锟斤拷冢锟斤拷虮ň锟 | |
1462 | + if (pAlarmInfo[ii] == 1) //锟斤拷止锟斤拷锟斤拷 | |
1463 | 1463 | { |
1464 | 1464 | if (pRegion[ii][GlobelWidth * a + c] || |
1465 | 1465 | pRegion[ii][GlobelWidth * b + c] || |
... | ... | @@ -1475,8 +1475,8 @@ void RegionSurveillance::VibeModelGetTrace(unsigned char* pSourceImg, float *Mas |
1475 | 1475 | } |
1476 | 1476 | } |
1477 | 1477 | } |
1478 | - // 只要目标外接矩形有一个点进入区域则报警 | |
1479 | - if (pAlarmInfo[ii] == 2) //拌线 | |
1478 | + // 只要目锟斤拷锟斤拷泳锟斤拷锟斤拷锟揭伙拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟津报撅拷 | |
1479 | + if (pAlarmInfo[ii] == 2) //锟斤拷锟斤拷 | |
1480 | 1480 | { |
1481 | 1481 | int xmin = min(c, d), xmax = max(c, d), ymin = min(a, b), ymax = max(a, b); |
1482 | 1482 | for (int iy = ymin; iy <= ymax; iy++) |
... | ... | @@ -1493,8 +1493,8 @@ void RegionSurveillance::VibeModelGetTrace(unsigned char* pSourceImg, float *Mas |
1493 | 1493 | } |
1494 | 1494 | } |
1495 | 1495 | |
1496 | - // 只要目标外接矩形进入区域中,且面积大于ROI区域面积的一半同时外接矩形中心点在区域内,则报警 | |
1497 | - if (pAlarmInfo[ii] == 3) //遗留检测 | |
1496 | + // 只要目锟斤拷锟斤拷泳锟斤拷谓锟斤拷锟斤拷锟斤拷锟斤拷校锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷ROI锟斤拷锟斤拷锟斤拷锟斤拷锟揭伙拷锟酵憋拷锟接撅拷锟斤拷锟斤拷锟侥碉拷锟斤拷锟斤拷锟斤拷锟节o拷锟津报撅拷 | |
1497 | + if (pAlarmInfo[ii] == 3) //锟斤拷锟斤拷锟斤拷锟 | |
1498 | 1498 | { |
1499 | 1499 | int TotalArea = 0; |
1500 | 1500 | if (TotalArea == 0) |
... | ... | @@ -1522,19 +1522,19 @@ void RegionSurveillance::VibeModelGetTrace(unsigned char* pSourceImg, float *Mas |
1522 | 1522 | } |
1523 | 1523 | } |
1524 | 1524 | |
1525 | - //保存最终输出目标 | |
1525 | + //锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟侥匡拷锟 | |
1526 | 1526 | m_FinalArray.push_back(m_TargetArray[dwBestMatch]); |
1527 | 1527 | |
1528 | 1528 | CMPoint ptLast = m_TargetArray[dwBestMatch].m_ptArray[0]; |
1529 | 1529 | |
1530 | - // 对目标的每一个匹配项进行遍历 | |
1530 | + // 锟斤拷目锟斤拷锟矫恳伙拷锟狡ワ拷锟斤拷锟斤拷锟叫憋拷锟斤拷 | |
1531 | 1531 | for (int l = 1; l < dwPointNum; l++) |
1532 | 1532 | { |
1533 | 1533 | ForegroundArray[i].m_ptCenter = m_TargetArray[dwBestMatch].m_ptArray[l]; |
1534 | 1534 | if (ForegroundArray[i].m_ptCenter == ptLast) |
1535 | 1535 | { |
1536 | 1536 | // Draw a point |
1537 | - //描绘目标中心点 | |
1537 | + //锟斤拷锟侥匡拷锟斤拷锟斤拷牡锟 | |
1538 | 1538 | pRGBIn[ForegroundArray[i].m_ptCenter.y * dwStep + ForegroundArray[i].m_ptCenter.x * 3] = bBlue; |
1539 | 1539 | pRGBIn[ForegroundArray[i].m_ptCenter.y * dwStep + ForegroundArray[i].m_ptCenter.x * 3 + 1] = bGreen; |
1540 | 1540 | 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 |
1636 | 1636 | /////////////////////////////////////////////////////////////////////////////////////// |
1637 | 1637 | // Prediction |
1638 | 1638 | int dwObjectCount = m_TargetArray.size(); |
1639 | - // 遍历所有的目标 | |
1639 | + // 锟斤拷锟斤拷锟斤拷锟叫碉拷目锟斤拷 | |
1640 | 1640 | for (int i=0; i < dwObjectCount; i++) |
1641 | 1641 | { |
1642 | - // 如果该目标在当前帧中没有匹配成功但是当前目标已经计算过方向 | |
1642 | + // 锟斤拷锟斤拷锟侥匡拷锟斤拷诘锟角爸★拷锟矫伙拷锟狡ワ拷锟缴癸拷锟斤拷锟角碉拷前目锟斤拷锟窖撅拷锟斤拷锟斤拷锟斤拷锟斤拷锟 | |
1643 | 1643 | if (!m_TargetArray[i].m_bCalc && m_TargetArray[i].m_bHaveDirection) |
1644 | 1644 | { |
1645 | 1645 | // Record prediction as current point |
... | ... | @@ -1700,15 +1700,15 @@ void RegionSurveillance::VibeModelGetTrace(unsigned char* pSourceImg, float *Mas |
1700 | 1700 | |
1701 | 1701 | /****************************************************************************** |
1702 | 1702 | * Function: RSRegion |
1703 | -* Description: 感兴趣区域设置 | |
1703 | +* Description: 锟斤拷锟斤拷趣锟斤拷锟斤拷锟斤拷锟斤拷 | |
1704 | 1704 | * Calls: vibeMask |
1705 | 1705 | * Called By: main |
1706 | -* Input: numROI ROI个数 | |
1707 | - pRegionInfo ROI区域 | |
1708 | - iflog true:输出日志 false:不输出日志 | |
1709 | -* Output: pRegion 10个ROI指针(bool)每个大小为(图像宽*图像高)感兴趣区域值为1 其余为0 | |
1710 | - //regionAlarm 10个ROI 报警标志(bool) | |
1711 | - pAlarmInfo 10个ROI 报警标志(int) | |
1706 | +* Input: numROI ROI锟斤拷锟斤拷 | |
1707 | + pRegionInfo ROI锟斤拷锟斤拷 | |
1708 | + iflog true:锟斤拷锟斤拷锟街 false锟斤拷锟斤拷锟斤拷锟斤拷锟街 | |
1709 | +* Output: pRegion 10锟斤拷ROI指锟诫(bool锟斤拷每锟斤拷锟斤拷小为锟斤拷图锟斤拷锟*图锟斤拷撸锟斤拷锟斤拷锟饺わ拷锟斤拷锟街滴 锟斤拷锟斤拷为0 | |
1710 | + //regionAlarm 10锟斤拷ROI 锟斤拷锟斤拷锟斤拷志锟斤拷bool锟斤拷 | |
1711 | + pAlarmInfo 10锟斤拷ROI 锟斤拷锟斤拷锟斤拷志锟斤拷int锟斤拷 | |
1712 | 1712 | * Return: 3 1 |
1713 | 1713 | *******************************************************************************/ |
1714 | 1714 | void printAlarmType(fstream *file, int style) |
... | ... | @@ -1716,22 +1716,22 @@ void printAlarmType(fstream *file, int style) |
1716 | 1716 | switch (style) |
1717 | 1717 | { |
1718 | 1718 | case 1: |
1719 | - *file<<"进入禁区, "; | |
1719 | + *file<<"锟斤拷锟斤拷锟斤拷锟, "; | |
1720 | 1720 | break; |
1721 | 1721 | case 2: |
1722 | - *file<<"离开禁区, "; | |
1722 | + *file<<"锟诫开锟斤拷锟斤拷, "; | |
1723 | 1723 | break; |
1724 | 1724 | case 3: |
1725 | - *file<<"单向越界, "; | |
1725 | + *file<<"锟斤拷锟斤拷越锟斤拷, "; | |
1726 | 1726 | break; |
1727 | 1727 | case 4: |
1728 | - *file<<"双向越界, "; | |
1728 | + *file<<"双锟斤拷越锟斤拷, "; | |
1729 | 1729 | break; |
1730 | 1730 | case 5: |
1731 | - *file<<"徘徊, "; | |
1731 | + *file<<"锟角伙拷, "; | |
1732 | 1732 | break; |
1733 | 1733 | case 6: |
1734 | - *file<<"丢包, "; | |
1734 | + *file<<"锟斤拷锟斤拷, "; | |
1735 | 1735 | break; |
1736 | 1736 | default : |
1737 | 1737 | break; |
... | ... | @@ -1741,12 +1741,12 @@ void printAlarmType(fstream *file, int style) |
1741 | 1741 | |
1742 | 1742 | int RegionSurveillance::RSRegion(int numROI, int alarm_info/*, bool iflog*/) |
1743 | 1743 | { |
1744 | - //fstream file;//用于输出日志 | |
1744 | + //fstream file;//锟斤拷锟斤拷锟斤拷锟斤拷锟街 | |
1745 | 1745 | if (numROI > MAXROINUM) |
1746 | 1746 | { |
1747 | 1747 | return 0; |
1748 | 1748 | } |
1749 | - //自动设置用于确定方向的点 | |
1749 | + //锟皆讹拷锟斤拷锟斤拷锟斤拷锟斤拷确锟斤拷锟斤拷锟斤拷牡锟 | |
1750 | 1750 | //for(int i = 0; i < numROI; i++) |
1751 | 1751 | //{ |
1752 | 1752 | // if (iflog) |
... | ... | @@ -1760,13 +1760,13 @@ int RegionSurveillance::RSRegion(int numROI, int alarm_info/*, bool iflog*/) |
1760 | 1760 | // |
1761 | 1761 | // if (pRegionInfo[i].AlarmInfo == 3) |
1762 | 1762 | // { |
1763 | - // pRegionInfo[i].finaldir = get_ArrowDir(pRegionInfo[i].pROI[0], pRegionInfo[i].pROI[1], pRegionInfo[i].dirPoint);//确定方向计算,箭头端点坐标 | |
1763 | + // pRegionInfo[i].finaldir = get_ArrowDir(pRegionInfo[i].pROI[0], pRegionInfo[i].pROI[1], pRegionInfo[i].dirPoint);//确锟斤拷锟斤拷锟斤拷锟斤拷悖拷锟酵凤拷说锟斤拷锟斤拷锟 | |
1764 | 1764 | // |
1765 | 1765 | // if (iflog) |
1766 | 1766 | // file<<", DirPoint("<<pRegionInfo[i].dirPoint.x<<","<<pRegionInfo[i].dirPoint.y<<")"; |
1767 | 1767 | // |
1768 | - // pRegionInfo[i].ArrowStartPoint = pStart; //箭头的起始端点 箭头指向正方形 | |
1769 | - // pRegionInfo[i].ArrowEndPoint = pEnd; //箭头的终止端点 箭头指向正方形 | |
1768 | + // pRegionInfo[i].ArrowStartPoint = pStart; //锟斤拷头锟斤拷锟斤拷始锟剿碉拷 锟斤拷头指锟斤拷锟斤拷锟斤拷锟斤拷 | |
1769 | + // pRegionInfo[i].ArrowEndPoint = pEnd; //锟斤拷头锟斤拷锟斤拷止锟剿碉拷 锟斤拷头指锟斤拷锟斤拷锟斤拷锟斤拷 | |
1770 | 1770 | // } |
1771 | 1771 | |
1772 | 1772 | // if (iflog) |
... | ... | @@ -1807,10 +1807,10 @@ int RegionSurveillance::RSRegion(int numROI, int alarm_info/*, bool iflog*/) |
1807 | 1807 | } |
1808 | 1808 | |
1809 | 1809 | |
1810 | - // 对每一个待观察的ROI进行监测 | |
1810 | + // 锟斤拷每一锟斤拷锟斤拷锟桔诧拷锟絉OI锟斤拷锟叫硷拷锟 | |
1811 | 1811 | //for (int i = 0; i < numROI; i++) |
1812 | 1812 | { |
1813 | - // 对每一个感兴趣区域进行标志 感兴趣区域pRegion值为1 其余为0 | |
1813 | + // 锟斤拷每一锟斤拷锟斤拷锟斤拷趣锟斤拷锟斤拷锟斤拷斜锟街 锟斤拷锟斤拷趣锟斤拷锟斤拷pRegion值为1 锟斤拷锟斤拷为0 | |
1814 | 1814 | //vibeMask(pRegionInfo[i].nPointNum, pRegionInfo[i].pROI, pRegion[i]); |
1815 | 1815 | } |
1816 | 1816 | |
... | ... | @@ -1916,7 +1916,7 @@ int RegionSurveillance::RSRegion(int numROI, int alarm_info/*, bool iflog*/) |
1916 | 1916 | // int y = (int) (((LineMin.y - LineMax.y) / (double) (LineMin.x - LineMax.x)) * (double) (x - LineMin.x) + 0.5 + (double)LineMin.y); |
1917 | 1917 | // //pRegion[GlobelWidth * y + x] = 1; |
1918 | 1918 | // |
1919 | -// //原程序存在越界 苏晓芸修改如下 | |
1919 | +// //原锟斤拷锟斤拷锟斤拷锟皆斤拷锟 锟斤拷锟斤拷芸锟睫革拷锟斤拷锟斤拷 | |
1920 | 1920 | // if (y > -1 && y < GlobelHeight && x > -1 && x < GlobelWidth) |
1921 | 1921 | // { |
1922 | 1922 | // pRegion[GlobelWidth * y + x] = 1; |
... | ... | @@ -1932,7 +1932,7 @@ int RegionSurveillance::RSRegion(int numROI, int alarm_info/*, bool iflog*/) |
1932 | 1932 | // int y = (int) (((LineMin.y - LineMax.y) / (double)(LineMin.x - LineMax.x)) * (double)(x - LineMin.x) + 0.5 + (double)LineMin.y); |
1933 | 1933 | // //pRegion[GlobelWidth * y + x] = 1; |
1934 | 1934 | // |
1935 | -// //原程序存在越界 苏晓芸修改如下 | |
1935 | +// //原锟斤拷锟斤拷锟斤拷锟皆斤拷锟 锟斤拷锟斤拷芸锟睫革拷锟斤拷锟斤拷 | |
1936 | 1936 | // if (y > -1 && y < GlobelHeight && x > -1 && x < GlobelWidth) |
1937 | 1937 | // { |
1938 | 1938 | // pRegion[GlobelWidth * y + x] = 1; |
... | ... | @@ -1947,7 +1947,7 @@ int RegionSurveillance::RSRegion(int numROI, int alarm_info/*, bool iflog*/) |
1947 | 1947 | // { |
1948 | 1948 | // //pRegion[GlobelWidth * i + pPointList[startp].x] = 1; |
1949 | 1949 | // |
1950 | -// //原程序存在越界 苏晓芸修改如下 | |
1950 | +// //原锟斤拷锟斤拷锟斤拷锟皆斤拷锟 锟斤拷锟斤拷芸锟睫革拷锟斤拷锟斤拷 | |
1951 | 1951 | // if (i > -1 && i < GlobelHeight && pPointList[startp].x > -1 && pPointList[startp].x < GlobelWidth) |
1952 | 1952 | // { |
1953 | 1953 | // pRegion[GlobelWidth * i + pPointList[startp].x] = 1; |
... | ... | @@ -1966,7 +1966,7 @@ int RegionSurveillance::RSRegion(int numROI, int alarm_info/*, bool iflog*/) |
1966 | 1966 | // int x = (int) (((LineMin.x - LineMax.x) / (double) (LineMin.y - LineMax.y)) * (double) (y - LineMin.y) + 0.5 + (double)LineMin.x); |
1967 | 1967 | // //pRegion[GlobelWidth * y + x] = 1; |
1968 | 1968 | // |
1969 | -// //原程序存在越界 苏晓芸修改如下 | |
1969 | +// //原锟斤拷锟斤拷锟斤拷锟皆斤拷锟 锟斤拷锟斤拷芸锟睫革拷锟斤拷锟斤拷 | |
1970 | 1970 | // if (y > -1 && y < GlobelHeight && x > -1 && x < GlobelWidth) |
1971 | 1971 | // { |
1972 | 1972 | // pRegion[GlobelWidth * y + x] = 1; |
... | ... | @@ -1982,7 +1982,7 @@ int RegionSurveillance::RSRegion(int numROI, int alarm_info/*, bool iflog*/) |
1982 | 1982 | // int x = (int) (((LineMin.x - LineMax.x) / (double) (LineMin.y - LineMax.y)) * (double) (y - LineMin.y) + 0.5 + (double)LineMin.x); |
1983 | 1983 | // //pRegion[GlobelWidth * y + x] = 1; |
1984 | 1984 | // |
1985 | -// //原程序存在越界 苏晓芸修改如下 | |
1985 | +// //原锟斤拷锟斤拷锟斤拷锟皆斤拷锟 锟斤拷锟斤拷芸锟睫革拷锟斤拷锟斤拷 | |
1986 | 1986 | // if (y > -1 && y < GlobelHeight && x > -1 && x < GlobelWidth) |
1987 | 1987 | // { |
1988 | 1988 | // pRegion[GlobelWidth * y + x] = 1; |
... | ... | @@ -1997,7 +1997,7 @@ int RegionSurveillance::RSRegion(int numROI, int alarm_info/*, bool iflog*/) |
1997 | 1997 | // { |
1998 | 1998 | // //pRegion[GlobelWidth * pPointList[startp].y + i] = 1; |
1999 | 1999 | // |
2000 | -// //原程序存在越界 苏晓芸修改如下 | |
2000 | +// //原锟斤拷锟斤拷锟斤拷锟皆斤拷锟 锟斤拷锟斤拷芸锟睫革拷锟斤拷锟斤拷 | |
2001 | 2001 | // if (pPointList[startp].y > -1 && pPointList[startp].y < GlobelHeight && i > -1 && i < GlobelWidth) |
2002 | 2002 | // { |
2003 | 2003 | // pRegion[GlobelWidth * pPointList[startp].y + i] = 1; |
... | ... | @@ -2007,7 +2007,7 @@ int RegionSurveillance::RSRegion(int numROI, int alarm_info/*, bool iflog*/) |
2007 | 2007 | // } |
2008 | 2008 | // } |
2009 | 2009 | // |
2010 | -// // 修改标记方式 将区域边缘标志置为0 | |
2010 | +// // 锟睫改憋拷欠锟绞 锟斤拷锟斤拷锟斤拷锟皆碉拷锟街撅拷锟轿 | |
2011 | 2011 | // for (int i = 0; i < GlobelHeight; i++) |
2012 | 2012 | // { |
2013 | 2013 | // for (int j = 0; j < GlobelWidth; j++) |
... | ... | @@ -2153,8 +2153,8 @@ void RegionSurveillance::getObjectInfo(int ObjCount, MS_ObjectInfo* ObjInfo) |
2153 | 2153 | } |
2154 | 2154 | */ |
2155 | 2155 | // unique ID for current object |
2156 | - ObjInfo[i].TarBox = m_FinalArray[i].m_TarBox; //目标外接矩形 | |
2157 | - ObjInfo[i].UniqueID = m_FinalArray[i].m_dwID; //当前目标的特点ID | |
2156 | + ObjInfo[i].TarBox = m_FinalArray[i].m_TarBox; //目锟斤拷锟斤拷泳锟斤拷锟 | |
2157 | + ObjInfo[i].UniqueID = m_FinalArray[i].m_dwID; //锟斤拷前目锟斤拷锟斤拷氐锟絀D | |
2158 | 2158 | //printf("UniqueID = %d, cfd = %f\n", ObjInfo[i].UniqueID, ObjInfo[i].confidence); |
2159 | 2159 | } |
2160 | 2160 | } |
... | ... | @@ -2214,14 +2214,14 @@ void RegionSurveillance::getDeleteInfo(int DelCount, MS_ObjectInfo* ObjInfo) |
2214 | 2214 | } |
2215 | 2215 | */ |
2216 | 2216 | // unique ID for current object |
2217 | - ObjInfo[i].TarBox = m_DelArray[i].m_TarBox; //目标外接矩形 | |
2218 | - ObjInfo[i].UniqueID = m_DelArray[i].m_dwID; //当前目标的特点ID | |
2217 | + ObjInfo[i].TarBox = m_DelArray[i].m_TarBox; //目锟斤拷锟斤拷泳锟斤拷锟 | |
2218 | + ObjInfo[i].UniqueID = m_DelArray[i].m_dwID; //锟斤拷前目锟斤拷锟斤拷氐锟絀D | |
2219 | 2219 | ObjInfo[i].confidence = m_DelArray[i].cfd; |
2220 | 2220 | } |
2221 | 2221 | } |
2222 | 2222 | |
2223 | 2223 | |
2224 | -// 将图像转换为灰度图像 | |
2224 | +// 锟斤拷图锟斤拷转锟斤拷为锟揭讹拷图锟斤拷 | |
2225 | 2225 | void RegionSurveillance::VibeRGBToGray(unsigned char* RgbData, unsigned char* GrayData) |
2226 | 2226 | { |
2227 | 2227 | int nHeight, nWidth; |
... | ... | @@ -2240,11 +2240,11 @@ void RegionSurveillance::VibeRGBToGray(unsigned char* RgbData, unsigned char* Gr |
2240 | 2240 | |
2241 | 2241 | |
2242 | 2242 | |
2243 | -//pAlarmInfo 1进入禁区 2离开禁区 3单向越界 4双向越界 5徘徊 6丢包 | |
2243 | +//pAlarmInfo 1锟斤拷锟斤拷锟斤拷锟 2锟诫开锟斤拷锟斤拷 3锟斤拷锟斤拷越锟斤拷 4双锟斤拷越锟斤拷 5锟角伙拷 6锟斤拷锟斤拷 | |
2244 | 2244 | void RegionSurveillance::MonitoringAlarm(unsigned char* pRGBIn, CForeground ForegroundArray_i, int dwBestMatch, RegionInfo* pRegionInfo) |
2245 | 2245 | { |
2246 | 2246 | |
2247 | - // 目标锁定 | |
2247 | + // 目锟斤拷锟斤拷锟斤拷 | |
2248 | 2248 | //ExternalRectangle(pRGBIn, ForegroundArray_i, dwBestMatch, widthStep, 255, 0, 0); |
2249 | 2249 | /* |
2250 | 2250 | int dwStep = widthStep; |
... | ... | @@ -2254,7 +2254,7 @@ void RegionSurveillance::MonitoringAlarm(unsigned char* pRGBIn, CForeground Fore |
2254 | 2254 | unsigned char bBlue = (unsigned char) ((m_TargetArray[dwBestMatch].m_dwID % 13) * 20 + 15); |
2255 | 2255 | |
2256 | 2256 | |
2257 | - // 前景目标外接矩形描绘 | |
2257 | + // 前锟斤拷目锟斤拷锟斤拷泳锟斤拷锟斤拷锟斤拷 | |
2258 | 2258 | for (int t = ForegroundArray_i.m_rtConnect.left; t <= ForegroundArray_i.m_rtConnect.right; t++) |
2259 | 2259 | { |
2260 | 2260 | pRGBIn[ForegroundArray_i.m_rtConnect.top * dwStep + t * 3] = 0; |
... | ... | @@ -2281,11 +2281,11 @@ void RegionSurveillance::MonitoringAlarm(unsigned char* pRGBIn, CForeground Fore |
2281 | 2281 | int c = ForegroundArray_i.m_rtConnect.left; |
2282 | 2282 | int d = ForegroundArray_i.m_rtConnect.right; |
2283 | 2283 | |
2284 | - // 区域监控 | |
2284 | + // 锟斤拷锟斤拷锟斤拷 | |
2285 | 2285 | for (int ii = 0; ii < m_numROI; ii++) |
2286 | 2286 | { |
2287 | 2287 | |
2288 | - if (pAlarmInfo[ii] == 1) //进入禁区 | |
2288 | + if (pAlarmInfo[ii] == 1) //锟斤拷锟斤拷锟斤拷锟 | |
2289 | 2289 | { |
2290 | 2290 | //AccessToRestrictedAreas(pRegion[ii], dwBestMatch,a, b, c, d, ii); |
2291 | 2291 | /* |
... | ... | @@ -2295,7 +2295,7 @@ void RegionSurveillance::MonitoringAlarm(unsigned char* pRGBIn, CForeground Fore |
2295 | 2295 | } |
2296 | 2296 | */ |
2297 | 2297 | } |
2298 | - else if (pAlarmInfo[ii] == 2) //离开禁区 | |
2298 | + else if (pAlarmInfo[ii] == 2) //锟诫开锟斤拷锟斤拷 | |
2299 | 2299 | { |
2300 | 2300 | //LeaveTheRestrictedAreas(pRegion[ii], dwBestMatch,a, b, c, d, ii); |
2301 | 2301 | /* |
... | ... | @@ -2306,7 +2306,7 @@ void RegionSurveillance::MonitoringAlarm(unsigned char* pRGBIn, CForeground Fore |
2306 | 2306 | */ |
2307 | 2307 | } |
2308 | 2308 | |
2309 | - else if (pAlarmInfo[ii] == 3) //单向越界 | |
2309 | + else if (pAlarmInfo[ii] == 3) //锟斤拷锟斤拷越锟斤拷 | |
2310 | 2310 | { |
2311 | 2311 | //OneWayCrossBorder(pRegion[ii], dwBestMatch, a, b, c, d, ii, pRegionInfo); |
2312 | 2312 | /* |
... | ... | @@ -2317,7 +2317,7 @@ void RegionSurveillance::MonitoringAlarm(unsigned char* pRGBIn, CForeground Fore |
2317 | 2317 | */ |
2318 | 2318 | |
2319 | 2319 | } |
2320 | - else if (pAlarmInfo[ii] == 4) //双向越界 | |
2320 | + else if (pAlarmInfo[ii] == 4) //双锟斤拷越锟斤拷 | |
2321 | 2321 | { |
2322 | 2322 | //TwoWayCrossBorder(pRegion[ii], dwBestMatch, a, b, c, d, ii); |
2323 | 2323 | /* |
... | ... | @@ -2328,7 +2328,7 @@ void RegionSurveillance::MonitoringAlarm(unsigned char* pRGBIn, CForeground Fore |
2328 | 2328 | */ |
2329 | 2329 | |
2330 | 2330 | } |
2331 | - else if (pAlarmInfo[ii] == 5) //徘徊 | |
2331 | + else if (pAlarmInfo[ii] == 5) //锟角伙拷 | |
2332 | 2332 | { |
2333 | 2333 | //WanderMonitoring(pRegion[ii], dwBestMatch, a, b, c, d, ii, pRegionInfo, pRGBIn); |
2334 | 2334 | /* |
... | ... | @@ -2338,7 +2338,7 @@ void RegionSurveillance::MonitoringAlarm(unsigned char* pRGBIn, CForeground Fore |
2338 | 2338 | } |
2339 | 2339 | */ |
2340 | 2340 | } |
2341 | - else if (pAlarmInfo[ii] == 6) //丢包 | |
2341 | + else if (pAlarmInfo[ii] == 6) //锟斤拷锟斤拷 | |
2342 | 2342 | { |
2343 | 2343 | StayMonitoring( dwBestMatch, a, b, c, d, ii, pRegionInfo, pRGBIn); |
2344 | 2344 | /* |
... | ... | @@ -2357,7 +2357,7 @@ void RegionSurveillance::MonitoringAlarm(unsigned char* pRGBIn, CForeground Fore |
2357 | 2357 | |
2358 | 2358 | |
2359 | 2359 | |
2360 | - // 轨迹描绘 | |
2360 | + // 锟届迹锟斤拷锟 | |
2361 | 2361 | //Trajectory(pRGBIn, ForegroundArray_i, dwBestMatch, width, height, widthStep); |
2362 | 2362 | /* |
2363 | 2363 | int dwStep = widthStep; |
... | ... | @@ -2368,14 +2368,14 @@ void RegionSurveillance::MonitoringAlarm(unsigned char* pRGBIn, CForeground Fore |
2368 | 2368 | int dwPointNum = m_TargetArray[dwBestMatch].m_ptArray.size(); |
2369 | 2369 | CMPoint ptLast = m_TargetArray[dwBestMatch].m_ptArray[0]; |
2370 | 2370 | |
2371 | - // 对目标的每一个匹配项进行遍历 | |
2371 | + // 锟斤拷目锟斤拷锟矫恳伙拷锟狡ワ拷锟斤拷锟斤拷锟叫憋拷锟斤拷 | |
2372 | 2372 | for (int l = 1; l < dwPointNum; l++) |
2373 | 2373 | { |
2374 | 2374 | ForegroundArray_i.m_ptCenter = m_TargetArray[dwBestMatch].m_ptArray[l]; |
2375 | 2375 | if (ForegroundArray_i.m_ptCenter == ptLast) |
2376 | 2376 | { |
2377 | 2377 | // Draw a point |
2378 | - //描绘目标中心点 | |
2378 | + //锟斤拷锟侥匡拷锟斤拷锟斤拷牡锟 | |
2379 | 2379 | pRGBIn[ForegroundArray_i.m_ptCenter.y * dwStep + ForegroundArray_i.m_ptCenter.x * 3] = bBlue; |
2380 | 2380 | pRGBIn[ForegroundArray_i.m_ptCenter.y * dwStep + ForegroundArray_i.m_ptCenter.x * 3 + 1] = bGreen; |
2381 | 2381 | 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 |
2458 | 2458 | } |
2459 | 2459 | |
2460 | 2460 | /* |
2461 | -//外接矩形描绘 | |
2461 | +//锟斤拷泳锟斤拷锟斤拷锟斤拷 | |
2462 | 2462 | void RegionSurveillance::ExternalRectangle(unsigned char* pRGBIn, CForeground ForegroundArray_i, int dwBestMatch, int widthStep, |
2463 | 2463 | int rgb_b, int rgb_g, int rgb_r) |
2464 | 2464 | { |
2465 | 2465 | int dwStep = widthStep; |
2466 | 2466 | |
2467 | - // 前景目标外接矩形描绘 | |
2467 | + // 前锟斤拷目锟斤拷锟斤拷泳锟斤拷锟斤拷锟斤拷 | |
2468 | 2468 | for (int t = ForegroundArray_i.m_rtConnect.left; t <= ForegroundArray_i.m_rtConnect.right; t++) |
2469 | 2469 | { |
2470 | 2470 | pRGBIn[ForegroundArray_i.m_rtConnect.top * dwStep + t * 3] = rgb_b; |
... | ... | @@ -2487,7 +2487,7 @@ void RegionSurveillance::ExternalRectangle(unsigned char* pRGBIn, CForeground Fo |
2487 | 2487 | |
2488 | 2488 | void RegionSurveillance::Trajectory(unsigned char* pRGBIn, CForeground ForegroundArray_i, int dwBestMatch, int width, int height, int widthStep) |
2489 | 2489 | { |
2490 | - // 轨迹描绘 | |
2490 | + // 锟届迹锟斤拷锟 | |
2491 | 2491 | int dwStep = widthStep; |
2492 | 2492 | unsigned char bRed = (unsigned char) ((m_TargetArray[dwBestMatch].m_dwID % 3) * 85 + 85); |
2493 | 2493 | 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 |
2496 | 2496 | int dwPointNum = m_TargetArray[dwBestMatch].m_ptArray.size(); |
2497 | 2497 | CMPoint ptLast = m_TargetArray[dwBestMatch].m_ptArray[0]; |
2498 | 2498 | |
2499 | - // 对目标的每一个匹配项进行遍历 | |
2499 | + // 锟斤拷目锟斤拷锟矫恳伙拷锟狡ワ拷锟斤拷锟斤拷锟叫憋拷锟斤拷 | |
2500 | 2500 | for (int l = 1; l < dwPointNum; l++) |
2501 | 2501 | { |
2502 | 2502 | ForegroundArray_i.m_ptCenter = m_TargetArray[dwBestMatch].m_ptArray[l]; |
2503 | 2503 | if (ForegroundArray_i.m_ptCenter == ptLast) |
2504 | 2504 | { |
2505 | 2505 | // Draw a point |
2506 | - //描绘目标中心点 | |
2506 | + //锟斤拷锟侥匡拷锟斤拷锟斤拷牡锟 | |
2507 | 2507 | pRGBIn[ForegroundArray_i.m_ptCenter.y * dwStep + ForegroundArray_i.m_ptCenter.x * 3] = bBlue; |
2508 | 2508 | pRGBIn[ForegroundArray_i.m_ptCenter.y * dwStep + ForegroundArray_i.m_ptCenter.x * 3 + 1] = bGreen; |
2509 | 2509 | 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 |
2589 | 2589 | |
2590 | 2590 | /****************************************************************************** |
2591 | 2591 | * Function: RAccessToRestrictedAreas |
2592 | -* Description: 进入禁区监测 | |
2593 | -* Input: pRegion_i 感兴趣区域标记 | |
2594 | - dwBestMatch 目标索引 | |
2595 | - ForBottom 当前前景外接矩形纵坐标最小值 | |
2596 | - ForTop 当前前景外接矩形纵坐标最大值 | |
2597 | - ForLeft 当前前景外接矩形横坐标最小值 | |
2598 | - ForRight 当前前景外接矩形横坐标最大值 | |
2599 | - indexROI ROI 索引 | |
2600 | -* Output: m_TargetArray 目标信息 | |
2592 | +* Description: 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷 | |
2593 | +* Input: pRegion_i 锟斤拷锟斤拷趣锟斤拷锟斤拷锟斤拷 | |
2594 | + dwBestMatch 目锟斤拷锟斤拷锟斤拷 | |
2595 | + ForBottom 锟斤拷前前锟斤拷锟斤拷泳锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟叫≈ | |
2596 | + ForTop 锟斤拷前前锟斤拷锟斤拷泳锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷值 | |
2597 | + ForLeft 锟斤拷前前锟斤拷锟斤拷泳锟斤拷魏锟斤拷锟斤拷锟斤拷锟叫≈ | |
2598 | + ForRight 锟斤拷前前锟斤拷锟斤拷泳锟斤拷魏锟斤拷锟斤拷锟斤拷锟斤拷值 | |
2599 | + indexROI ROI 锟斤拷锟斤拷 | |
2600 | +* Output: m_TargetArray 目锟斤拷锟斤拷息 | |
2601 | 2601 | *******************************************************************************/ |
2602 | 2602 | //void RegionSurveillance::AccessToRestrictedAreas(bool *pRegion_i, int dwBestMatch, int ForBottom, int ForTop, int ForLeft, int ForRight, int indexROI) |
2603 | 2603 | //{ |
2604 | 2604 | // |
2605 | -// // 目标外接矩形有一个边进入禁区且外接矩形中心点位于禁区内 | |
2605 | +// // 目锟斤拷锟斤拷泳锟斤拷锟斤拷锟揭伙拷锟斤拷呓锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷泳锟斤拷锟斤拷锟斤拷牡锟轿伙拷诮锟斤拷锟斤拷锟 | |
2606 | 2606 | // //if (pRegion_i[GlobelWidth * ForBottom + ForLeft] || |
2607 | 2607 | // // pRegion_i[GlobelWidth * ForTop + ForLeft] || |
2608 | 2608 | // // pRegion_i[GlobelWidth * ForTop + ForRight] || |
2609 | 2609 | // // pRegion_i[GlobelWidth * ForBottom + ForRight]) |
2610 | 2610 | // { |
2611 | -// //将判断是否进入感兴趣区域改成了矩形中心点的上下左右和中心五个点都进入区域,判定为进入 | |
2611 | +// //锟斤拷锟叫讹拷锟角凤拷锟斤拷锟斤拷锟斤拷趣锟斤拷锟斤拷某锟斤拷司锟斤拷锟斤拷锟斤拷牡锟斤拷锟斤拷锟斤拷锟斤拷锟揭猴拷锟斤拷锟斤拷锟斤拷锟斤拷愣硷拷锟斤拷锟斤拷锟斤拷锟斤拷卸锟轿拷锟斤拷锟 | |
2612 | 2612 | // if (pRegion_i[GlobelWidth * (int) ((ForBottom + ForTop) / 2) + (ForLeft + ForRight) / 2] && \ |
2613 | 2613 | // pRegion_i[GlobelWidth * (int)((ForBottom + ForTop) / 2) + (ForLeft + ForRight) / 2 + 1] && \ |
2614 | 2614 | // pRegion_i[GlobelWidth * (int)((ForBottom + ForTop) / 2) + (ForLeft + ForRight) / 2 - 1] && \ |
... | ... | @@ -2626,7 +2626,7 @@ void RegionSurveillance::Trajectory(unsigned char* pRGBIn, CForeground Foregroun |
2626 | 2626 | // |
2627 | 2627 | //} |
2628 | 2628 | |
2629 | -//离开禁区 | |
2629 | +//锟诫开锟斤拷锟斤拷 | |
2630 | 2630 | //void RegionSurveillance::LeaveTheRestrictedAreas(bool *pRegion_i, int dwBestMatch, int ForBottom, int ForTop, int ForLeft, int ForRight, int indexROI) |
2631 | 2631 | //{ |
2632 | 2632 | // if (pRegion_i[GlobelWidth * ForBottom + ForLeft] || |
... | ... | @@ -2664,11 +2664,11 @@ void RegionSurveillance::Trajectory(unsigned char* pRGBIn, CForeground Foregroun |
2664 | 2664 | // m_TargetArray[dwBestMatch].pbAlarmType[indexROI] = 0; |
2665 | 2665 | //} |
2666 | 2666 | |
2667 | -//单向越界 | |
2668 | -//dir: 1 正方向(相对于通常坐标系) 0负方向 | |
2667 | +//锟斤拷锟斤拷越锟斤拷 | |
2668 | +//dir: 1 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟酵拷锟斤拷锟斤拷锟较碉拷锟 0锟斤拷锟斤拷锟斤拷 | |
2669 | 2669 | //void RegionSurveillance::OneWayCrossBorder(bool *pRegion_i, int dwBestMatch, int ForBottom, int ForTop, int ForLeft, int ForRight, int indexROI, RegionInfo* pRegionInfo) |
2670 | 2670 | //{ |
2671 | -// // 只要目标外接矩形有一个点进入区域则报警 | |
2671 | +// // 只要目锟斤拷锟斤拷泳锟斤拷锟斤拷锟揭伙拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟津报撅拷 | |
2672 | 2672 | // int tar_size = m_TargetArray[dwBestMatch].m_ptArray.size(); |
2673 | 2673 | // int xmin = min(ForLeft, ForRight), xmax = max(ForLeft, ForRight), ymin = min(ForBottom, ForTop), ymax = max(ForBottom, ForTop); |
2674 | 2674 | // for (int iy = ymin; iy <= ymax; iy++) |
... | ... | @@ -2681,7 +2681,7 @@ void RegionSurveillance::Trajectory(unsigned char* pRGBIn, CForeground Foregroun |
2681 | 2681 | // point_x = m_TargetArray[dwBestMatch].m_ptArray[tar_size - 4].x; |
2682 | 2682 | // point_y = m_TargetArray[dwBestMatch].m_ptArray[tar_size - 4].y; |
2683 | 2683 | // |
2684 | -// // 判断方向 | |
2684 | +// // 锟叫断凤拷锟斤拷 | |
2685 | 2685 | // if (indexROI >= 0 && indexROI < m_numROI && pRegionInfo[indexROI].nPointNum >= 2) |
2686 | 2686 | // { |
2687 | 2687 | // 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 |
2916 | 2916 | // m_TargetArray[dwBestMatch].pbAlarmType[indexROI] = 0; |
2917 | 2917 | //} |
2918 | 2918 | |
2919 | -////双向越界 | |
2919 | +////双锟斤拷越锟斤拷 | |
2920 | 2920 | //void RegionSurveillance::TwoWayCrossBorder(bool *pRegion_i, int dwBestMatch, int ForBottom, int ForTop, int ForLeft, int ForRight, int indexROI) |
2921 | 2921 | //{ |
2922 | -// // 只要目标外接矩形有一个点进入区域则报警 | |
2922 | +// // 只要目锟斤拷锟斤拷泳锟斤拷锟斤拷锟揭伙拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟津报撅拷 | |
2923 | 2923 | // int xmin = min(ForLeft, ForRight), xmax = max(ForLeft, ForRight), ymin = min(ForBottom, ForTop), ymax = max(ForBottom, ForTop); |
2924 | 2924 | // for (int iy = ymin; iy <= ymax; iy++) |
2925 | 2925 | // { |
... | ... | @@ -2937,10 +2937,10 @@ void RegionSurveillance::Trajectory(unsigned char* pRGBIn, CForeground Foregroun |
2937 | 2937 | // m_TargetArray[dwBestMatch].pbAlarmType[indexROI] = 0; |
2938 | 2938 | //} |
2939 | 2939 | |
2940 | -////双向越界 | |
2940 | +////双锟斤拷越锟斤拷 | |
2941 | 2941 | //void RegionSurveillance::TwoWayCrossBorder(bool *pRegion_i, int dwBestMatch, int ForBottom, int ForTop, int ForLeft, int ForRight, int indexROI) |
2942 | 2942 | //{ |
2943 | -// // 只要目标外接矩形有一个点进入区域则报警 | |
2943 | +// // 只要目锟斤拷锟斤拷泳锟斤拷锟斤拷锟揭伙拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟津报撅拷 | |
2944 | 2944 | // int xmin = min(ForLeft, ForRight), xmax = max(ForLeft, ForRight), ymin = min(ForBottom, ForTop), ymax= max(ForBottom, ForTop); |
2945 | 2945 | // for (int iy = ymin; iy <= ymax; iy++) |
2946 | 2946 | // { |
... | ... | @@ -2958,7 +2958,7 @@ void RegionSurveillance::Trajectory(unsigned char* pRGBIn, CForeground Foregroun |
2958 | 2958 | // m_TargetArray[dwBestMatch].pbAlarmType[indexROI] = -1; |
2959 | 2959 | //} |
2960 | 2960 | |
2961 | -// 监测遗留或移除 0 遗留 1移除 | |
2961 | +// 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷瞥锟 0 锟斤拷锟斤拷 1锟狡筹拷 | |
2962 | 2962 | bool RegionSurveillance::detectLeftRemove(unsigned char* pRGBIn, int ForBottom, int ForTop, int ForLeft, int ForRight) |
2963 | 2963 | { |
2964 | 2964 | bool flag; |
... | ... | @@ -3071,11 +3071,11 @@ bool RegionSurveillance::detectLeftRemove(unsigned char* pRGBIn, int ForBottom, |
3071 | 3071 | } |
3072 | 3072 | } |
3073 | 3073 | |
3074 | - if (ratio >= 0.85 && ratio <= 1.0) //相近表示移除 | |
3074 | + if (ratio >= 0.85 && ratio <= 1.0) //锟斤拷锟斤拷锟绞撅拷瞥锟 | |
3075 | 3075 | { |
3076 | 3076 | flag = 1; |
3077 | 3077 | } |
3078 | - else // 否则表示遗留 | |
3078 | + else // 锟斤拷锟斤拷锟绞撅拷锟斤拷锟 | |
3079 | 3079 | { |
3080 | 3080 | flag = 0; |
3081 | 3081 | } |
... | ... | @@ -3091,10 +3091,10 @@ bool CTargetFunc (CTarget &a, CTarget &b) |
3091 | 3091 | else |
3092 | 3092 | return false; |
3093 | 3093 | } |
3094 | -// 徘徊监测 | |
3094 | +// 锟角伙拷锟斤拷锟 | |
3095 | 3095 | void RegionSurveillance::WanderMonitoring(bool *pRegion_i, int dwBestMatch, int ForBottom, int ForTop, int ForLeft, int ForRight, int indexROI, RegionInfo* pRegionInfo, unsigned char* pRGBIn) |
3096 | 3096 | { |
3097 | - // 目标外接矩形有一个边进入禁区且外接矩形中心点位于禁区内 | |
3097 | + // 目锟斤拷锟斤拷泳锟斤拷锟斤拷锟揭伙拷锟斤拷呓锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷泳锟斤拷锟斤拷锟斤拷牡锟轿伙拷诮锟斤拷锟斤拷锟 | |
3098 | 3098 | bool flag = 0; |
3099 | 3099 | |
3100 | 3100 | if ((pRegion_i[GlobelWidth * ForBottom + ForLeft] || |
... | ... | @@ -3121,7 +3121,7 @@ void RegionSurveillance::WanderMonitoring(bool *pRegion_i, int dwBestMatch, int |
3121 | 3121 | m_TargetArray[dwBestMatch].lastFrame = 0; |
3122 | 3122 | } |
3123 | 3123 | } |
3124 | - if ((1 == m_TargetArray[dwBestMatch].m_ptArray.size() && m_TargetArray[dwBestMatch].nFrameCurr == 1) && m_TargetArray[dwBestMatch].m_bFirstInWander == true ) //因在徘徊区域内,检测目标对象判定为新对象,将该新对象的nFrameCurr,设置为该区域内最接近的对象的nFrameCurr | |
3124 | + if ((1 == m_TargetArray[dwBestMatch].m_ptArray.size() && m_TargetArray[dwBestMatch].nFrameCurr == 1) && m_TargetArray[dwBestMatch].m_bFirstInWander == true ) //锟斤拷锟斤拷锟角伙拷锟斤拷锟斤拷锟节o拷锟斤拷锟侥匡拷锟斤拷锟斤拷锟叫讹拷为锟铰讹拷锟襟,斤拷锟斤拷锟铰讹拷锟斤拷锟絥FrameCurr锟斤拷锟斤拷锟斤拷为锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷咏锟斤拷亩锟斤拷锟斤拷nFrameCurr | |
3125 | 3125 | { |
3126 | 3126 | double bestDistance = 0; |
3127 | 3127 | CTarget best; |
... | ... | @@ -3199,7 +3199,7 @@ void RegionSurveillance::WanderMonitoring(bool *pRegion_i, int dwBestMatch, int |
3199 | 3199 | m_TargetArray[dwBestMatch].m_bFirstInWander = false; |
3200 | 3200 | |
3201 | 3201 | |
3202 | - // 判断模板是否进行更新 0 遗留 1移除 | |
3202 | + // 锟叫讹拷模锟斤拷锟角凤拷锟斤拷懈锟斤拷锟 0 锟斤拷锟斤拷 1锟狡筹拷 | |
3203 | 3203 | left_flag_now_w = detectLeftRemove(pRGBIn, ForBottom, ForTop, ForLeft, ForRight); |
3204 | 3204 | } |
3205 | 3205 | else |
... | ... | @@ -3227,10 +3227,10 @@ void RegionSurveillance::WanderMonitoring(bool *pRegion_i, int dwBestMatch, int |
3227 | 3227 | } |
3228 | 3228 | |
3229 | 3229 | |
3230 | -// 丢包监测 | |
3230 | +// 锟斤拷锟斤拷锟斤拷锟 | |
3231 | 3231 | void RegionSurveillance::StayMonitoring( int dwBestMatch, int ForBottom, int ForTop, int ForLeft, int ForRight, int indexROI, RegionInfo* pRegionInfo, unsigned char* pRGBIn) |
3232 | 3232 | { |
3233 | - // 目标外接矩形有一个边进入禁区且外接矩形中心点位于禁区内 | |
3233 | + // 目锟斤拷锟斤拷泳锟斤拷锟斤拷锟揭伙拷锟斤拷呓锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷泳锟斤拷锟斤拷锟斤拷牡锟轿伙拷诮锟斤拷锟斤拷锟 | |
3234 | 3234 | int tar_size = m_TargetArray[dwBestMatch].m_ptArray.size(); |
3235 | 3235 | int cur_dis; |
3236 | 3236 | bool flag = 0; |
... | ... | @@ -3290,7 +3290,7 @@ void RegionSurveillance::StayMonitoring( int dwBestMatch, int ForBottom, int For |
3290 | 3290 | } |
3291 | 3291 | } |
3292 | 3292 | |
3293 | - // 判断模板是否进行更新 0 遗留 1移除 | |
3293 | + // 锟叫讹拷模锟斤拷锟角凤拷锟斤拷懈锟斤拷锟 0 锟斤拷锟斤拷 1锟狡筹拷 | |
3294 | 3294 | left_flag_now_s = detectLeftRemove(pRGBIn, ForBottom, ForTop, ForLeft, ForRight); |
3295 | 3295 | } |
3296 | 3296 | //else |
... | ... | @@ -3330,7 +3330,7 @@ void RegionSurveillance::RSrelease() |
3330 | 3330 | pAlarmInfo = NULL; |
3331 | 3331 | } |
3332 | 3332 | |
3333 | - // 释放m_TargetArray | |
3333 | + // 锟酵凤拷m_TargetArray | |
3334 | 3334 | int i; |
3335 | 3335 | for (i = 0; i < (int)m_TargetArray.size(); i++) |
3336 | 3336 | { | ... | ... |
win/.vs/leftover/v14/.suo
No preview for this file type
win/leftover.VC.VC.opendb deleted
No preview for this file type
win/leftover.VC.db
No preview for this file type