CN104751136B - A kind of multi-camera video event back jump tracking method based on recognition of face - Google Patents
A kind of multi-camera video event back jump tracking method based on recognition of face Download PDFInfo
- Publication number
- CN104751136B CN104751136B CN201510106388.8A CN201510106388A CN104751136B CN 104751136 B CN104751136 B CN 104751136B CN 201510106388 A CN201510106388 A CN 201510106388A CN 104751136 B CN104751136 B CN 104751136B
- Authority
- CN
- China
- Prior art keywords
- mrow
- face
- msub
- frame
- video
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Landscapes
- Image Analysis (AREA)
Abstract
本发明公开了一种基于人脸识别的多相机视频事件回溯追踪方法,其首先基于Haar‑like特征通过Adaboost方法训练人脸级联分类器,然后采用此分类器检测跟踪每个相机中出现的人脸,得到人脸库,再在视频中框定目标行人的人脸区域,提取其LBP特征,并将目标人脸在人脸库中进行匹配识别,最后根据人脸识别结果,提取目标在各相机出现的时间得出其行走路径,从而得到目标的回溯追踪结果。本发明通过将人脸识别方法在多场景的多个相机视频系统中应用,对于视频事件进行回溯,减少了人工查询视频的工作量,提高了查询的效率。
The invention discloses a multi-camera video event retrospective tracking method based on face recognition, which first trains a face cascade classifier through the Adaboost method based on Haar-like features, and then uses this classifier to detect and track the events that appear in each camera Face, get the face database, frame the face area of the target pedestrian in the video, extract its LBP features, and match and identify the target face in the face database, and finally extract the target in each face according to the face recognition results The time at which the camera appears gives its walking path, thereby obtaining the backtracking result of the target. In the present invention, by applying the face recognition method in multiple camera video systems in multiple scenes, the video events are traced back, reducing the workload of manual video query and improving the query efficiency.
Description
技术领域technical field
本发明属于智能分析系统技术领域,具体涉及一种基于人脸识别的多相机视频事件回溯追踪方法。The invention belongs to the technical field of intelligent analysis systems, and in particular relates to a multi-camera video event retrospective tracking method based on face recognition.
背景技术Background technique
视频监控系统遍布于人们生活的各个场合,当有异常事件发生时,通常需要从监控视频中查找可疑的人员目标,传统的方法往往是通过人工方式进行查看。由于视频监控数据量非常大,人工查找耗时耗力且效率低下,容易漏掉很多有用的信息。因此通过机器对监控数据进行处理,智能的实现回溯追踪有着重要的实际应用价值。Video surveillance systems are everywhere in people's lives. When an abnormal event occurs, it is usually necessary to find suspicious personnel targets from the surveillance video. The traditional method is often to check manually. Due to the large amount of video surveillance data, manual search is time-consuming, labor-intensive and inefficient, and it is easy to miss a lot of useful information. Therefore, through the processing of monitoring data by machines, the intelligent realization of backtracking has important practical application value.
对于视频中的行人目标,虽然其特征有多种,但人脸是可靠且优于其他特征的一种生物特征。近年来科技不断进步,人脸检测和识别技术也随之不断发展。人脸作为人的一种生物特征,其应用也越来越多。例如,人脸识别出入管理系统、人脸识别门禁考勤系统、人脸识别监控管理、人脸识别电脑安全防范、人脸识别照片搜索、人脸识别来访登记、人脸识别ATM机智能视频报警系统等。2008年奥运会和2010年上海世博会,就有将人脸识别用于身份认证进行安保工作。而这些大多都是用于单幅图像,或者单相机单一场景视频,用于多相机的多场景视频系统的较少。多相机多场景视频时如需查看视频事件则需要人工分别查阅多个相机视频,存在耗时耗力、检索效率低下的问题。For the pedestrian target in the video, although there are many kinds of features, the human face is a reliable and superior biometric feature. In recent years, with the continuous advancement of science and technology, face detection and recognition technology has also been continuously developed. As a biological feature of human beings, the face has more and more applications. For example, face recognition access management system, face recognition access control and attendance system, face recognition monitoring management, face recognition computer security protection, face recognition photo search, face recognition visitor registration, face recognition ATM intelligent video alarm system Wait. In the 2008 Olympic Games and the 2010 Shanghai World Expo, face recognition was used for identity authentication for security work. Most of these are used for a single image, or a single-camera single-scene video, and less for multi-camera multi-scene video systems. If you need to view video events in multi-camera and multi-scene videos, you need to manually check the videos of multiple cameras separately, which has the problems of time-consuming, labor-intensive, and low retrieval efficiency.
发明内容Contents of the invention
本发明的目的是提供一种基于人脸识别的多相机视频事件回溯追踪方法,以解决人工方式查看视频事件存在的耗时耗力、检索效率低下的问题。The purpose of the present invention is to provide a multi-camera video event retrospective tracking method based on face recognition to solve the problems of time-consuming, labor-intensive and low retrieval efficiency in manually viewing video events.
本发明的技术方案是这样实现的:一种基于人脸识别的多相机视频事件回溯追踪方法,具体按照以下步骤实施:The technical solution of the present invention is realized in the following way: a method for backtracking and tracking of multi-camera video events based on face recognition, specifically implemented according to the following steps:
步骤1:基于Haar-like特征通过Adaboost方法训练人脸级联分类器;Step 1: Train the face cascade classifier through the Adaboost method based on Haar-like features;
步骤2:采集监控系统中所有相机的视频;Step 2: collect the video of all cameras in the monitoring system;
步骤3:对采集的所有相机视频中的人脸进行跟踪,将跟踪后得到的人脸写进数据库作为人脸库,每个人脸在数据库中的命名规则是:相机号_帧号;Step 3: Track the faces in all the collected camera videos, and write the tracked faces into the database as the face database. The naming rule of each face in the database is: camera number_frame number;
步骤4:选取需要回溯追踪的目标行人,在视频中框定目标行人的人脸区域,通过提取目标行人和人脸库中人脸的LBP特征,在人脸库中对目标行人进行匹配识别;Step 4: Select the target pedestrian that needs to be traced back, frame the face area of the target pedestrian in the video, and match and identify the target pedestrian in the face database by extracting the LBP features of the target pedestrian and the face in the face database;
步骤5:根据步骤4中的人脸识别结果,提取目标行人在各相机出现的时间得出其行走路径,从而得到了目标行人的回溯追踪结果。Step 5: According to the face recognition result in step 4, extract the time when the target pedestrian appeared in each camera to obtain the walking path, and thus obtain the backtracking result of the target pedestrian.
本发明的特点还在于,The present invention is also characterized in that,
步骤1中训练人脸级联分类器的具体过程如下:The specific process of training face cascade classifier in step 1 is as follows:
1.1,给出训练样本,首先需要给出训练样本集(x1,y1),(x2,y2),...,(xn,yn),其中包含人脸正样本和负样本,xi表示样本,yi表示样本的正负,yi=1表示其为人脸正样本,yi=0表示其为人脸负样本(非人脸),n表示总的训练样本个数;1.1. Given the training samples, first you need to give the training sample set (x 1 ,y 1 ),(x 2 ,y 2 ),...,(x n ,y n ), which contains positive and negative face samples Sample, x i represents the sample, y i represents the positive or negative of the sample, y i =1 represents it is a face positive sample, y i =0 represents it is a face negative sample (non-face), n represents the total number of training samples ;
1.2,初始化权重:1.2, Initialize weights:
其中,w1,i代表第1次迭代过程第i个样本的初始化权重,l、m分别是正样本与负样本的数量,i=1,2...n;Among them, w 1,i represents the initialization weight of the i-th sample in the first iteration process, l, m are the number of positive samples and negative samples respectively, i=1,2...n;
1.3,归一化权重,对所有样本的权重都进行归一化,如式(2)所示,qt,i为归一化后的权重:1.3, normalized weights, normalize the weights of all samples, as shown in formula (2), q t, i are the normalized weights:
其中,wt,i表示第t次迭代过程第i个样本的权重;Among them, w t,i represents the weight of the i-th sample in the t-th iteration process;
1.4,对每个Haar-like特征训练最优弱分类器,并计算其加权错误率:1.4, train the optimal weak classifier for each Haar-like feature, and calculate its weighted error rate:
对于每个Haar-like特征在样本基础上训练其最优弱分类器h(x,f,p,θ)为:For each Haar-like feature, the optimal weak classifier h(x, f, p, θ) is trained on the basis of the sample as:
其中,f表示特征,f(x)表示特征值,p表示不等号的方向,p取1或-1,θ为阈值,p是为了使得不等号的方向始终都是<号;Among them , f represents the feature, f(x) represents the feature value, p represents the direction of the inequality sign, p takes 1 or -1, θ is the threshold, and p is to make the direction of the inequality sign always be <sign;
计算最优弱分类器h(x,f,p,θ)对所有样本的加权错误率εf,如下式所示:Calculate the weighted error rate ε f of the optimal weak classifier h(x,f,p,θ) for all samples, as shown in the following formula:
1.5,选择对所有样本加权错误率最小的最优弱分类器,作为此次迭代所得到的弱分类器;1.5. Select the optimal weak classifier with the smallest weighted error rate for all samples as the weak classifier obtained in this iteration;
1.6,调整权重,权重的调整是根据步骤1.5得到的弱分类器对各样本是否正判来进行,如式(5)、(6)所示,可看出若正判则权重减小,若误判则权重增大,可以使后续选择弱分类器时选到更重视误判样本的分类器:1.6. Adjust the weight. The adjustment of the weight is based on whether the weak classifier obtained in step 1.5 judges each sample positively. As shown in formulas (5) and (6), it can be seen that if the positive judgment is positive, the weight is reduced. The weight of misjudgment increases, which can make the subsequent selection of weak classifiers select classifiers that pay more attention to misjudgment samples:
其中,ei的取值为0或1,当样本被正判时取0,当样本被误判时取1,εt表示第t次迭代过程得到的弱分类器对所有样本的加权错误率;Among them, the value of e i is 0 or 1, 0 when the sample is positively judged, and 1 when the sample is misjudged, ε t represents the weighted error rate of the weak classifier for all samples obtained in the t-th iteration process ;
重复步骤1.3~1.6进行迭代过程,直至达到规定的迭代次数T,得到T个弱分类器,结束迭代过程;Repeat steps 1.3 to 1.6 for the iterative process until the specified number of iterations T is reached, T weak classifiers are obtained, and the iterative process ends;
1.7,将T个弱分类器组成强分类器,强分类器如下式所示:1.7. Combine T weak classifiers into a strong classifier, and the strong classifier is shown in the following formula:
1.8,改变迭代次数T,得到不同的强分类器,并按照T从小到大的顺序将强分类器进行级联,得到最终的级联分类器,强分类器的个数记为M,M大于20。1.8. Change the number of iterations T to obtain different strong classifiers, and cascade the strong classifiers in the order of T from small to large to obtain the final cascaded classifier. The number of strong classifiers is recorded as M, and M is greater than 20.
步骤3中人脸跟踪的具体过程如下:The specific process of face tracking in step 3 is as follows:
3.1,首先对相机中的待检测的视频帧进行灰度化,然后通过双线性插值方法缩小图像以提高检测速度,最后进行直方图均衡化以提高检测效果;3.1, first grayscale the video frame to be detected in the camera, then reduce the image by bilinear interpolation method to improve the detection speed, and finally perform histogram equalization to improve the detection effect;
3.2,对视频进行人脸检测并跟踪,跟追的方法为:对第N帧检测到的各人脸,依据帧间约束确定其在第N+1帧可能出现的范围,具体方法为:根据第N帧所检测到的人脸的位置及大小,在第N+1帧中以第N帧检测到的人脸中心为中心,将第N帧检测到的人脸区域的宽和高增大二倍,确定为第N+1帧中该人脸可能出现的范围,在此范围对第N+1帧进行该人脸的检测:3.2. Perform face detection and tracking on the video. The method of tracking is: for each face detected in the Nth frame, determine the possible range of its appearance in the N+1th frame according to the inter-frame constraints. The specific method is: according to The position and size of the face detected in the Nth frame is centered on the center of the face detected in the Nth frame in the N+1 frame, and the width and height of the face area detected in the Nth frame are increased Double, determine the range where the face may appear in the N+1th frame, and detect the face in the N+1th frame in this range:
若此范围内检测到的人脸为一个时,则为此人;If there is only one face detected within this range, it is this person;
若此范围内检测到的人脸不止一个时,计算第N帧检测到的人脸与第N+1帧检测到的各人脸中心间的欧式距离,将与第N帧距离最近的人脸确定为此人在第N+1帧出现的人脸;If more than one face is detected within this range, calculate the Euclidean distance between the face detected in the Nth frame and the center of each face detected in the N+1 frame, and the face closest to the Nth frame Determine the face of this person appearing in frame N+1;
若此范围内未检测到人脸时,则认为此人已走出该相机的视频区域。If no face is detected within this range, it is considered that the person has walked out of the video area of the camera.
步骤3中人脸检测方法如下:The face detection method in step 3 is as follows:
a,如果是视频图像的第一帧,则直接用步骤1得到的级联分类器进行检测;a, if it is the first frame of the video image, then directly use the cascade classifier obtained in step 1 to detect;
如果是视频图像的后续帧,则依据帧间约束确定为该帧中人脸可能出现的区域,在此区域内使用步骤1得到的级联分类器的前N个强分类器进行检测,N<M;除此区域外的其他区域使用步骤1得到的级联分类器进行检测;If it is a subsequent frame of the video image, it is determined as the area where the face may appear in the frame according to the inter-frame constraints, and the first N strong classifiers of the cascade classifier obtained in step 1 are used to detect in this area, N< M; other areas except this area are detected using the cascade classifier obtained in step 1;
b,对于检测到的人脸进行肤色检测,将非肤色误检结果排除掉,具体为:b. Perform skin color detection on the detected faces, and exclude non-skin color false detection results, specifically:
首先将图像从RGB色彩空间转换到YCbCr色彩空间,如式(9)、(10)、(11)所示:First convert the image from the RGB color space to the YC b C r color space, as shown in formulas (9), (10), and (11):
Y=0.257R+0.504G+0.098B+16 (9);Y=0.257R+0.504G+0.098B+16 (9);
Cb=-0.148R-0.291G+0.439B+128 (10);Cb=-0.148R-0.291G+0.439B+128 (10);
Cr=0.439R-0.368G-0.071B+128 (11);Cr=0.439R-0.368G-0.071B+128 (11);
对检测到的人脸区域中的像素点的Cb、Cr值进行判断,若满足85<Cb<130和132<Cr<180,则当前像素点就为肤色点,否则为非肤色点,若检测结果中肤色点占到总像素点60%以上则认为是人脸区域,否则为非人脸区域,予以排除。Judge the Cb and Cr values of the pixels in the detected face area. If 85<Cb<130 and 132<Cr<180 are satisfied, the current pixel is a skin color point, otherwise it is a non-skin color point. In the result, if the skin color points account for more than 60% of the total pixels, it is considered as a face area, otherwise it is a non-face area and is excluded.
步骤4的具体过程如下:The specific process of step 4 is as follows:
4.1,在视频中框定目标行人的人脸区域,在此区域中使用步骤1训练得到的级联分类器检测出目标人脸,作为对目标行人的标记;4.1. Frame the face area of the target pedestrian in the video, and use the cascade classifier trained in step 1 to detect the target face in this area as a mark for the target pedestrian;
4.2,提取目标行人的人脸及人脸库中人脸的均匀模式LBP特征;4.2. Extract the face of the target pedestrian and the uniform mode LBP feature of the face in the face database;
4.3,计算人脸库中人脸与目标行人的人脸之间的LBP特征值之间的距离,按照计算得到的距离从小到大将库中人脸进行排序,根据排序顺序,选择出一幅与目标行人的人脸最接近的一幅人脸图像,即为目标行人的人脸图像。4.3. Calculate the distance between the LBP eigenvalues of the face in the face library and the face of the target pedestrian, and sort the faces in the library according to the calculated distance from small to large. According to the sorting order, select a picture with The face image closest to the face of the target pedestrian is the face image of the target pedestrian.
步骤4.2的具体过程如下:The specific process of step 4.2 is as follows:
4.2.1,首先将目标行人的人脸及人脸库中人脸图像均匀分成m×m的图像块,即m2个图像块,然后判断每个图像块的每个像素点的LBP二进制码组合模式:4.2.1, first divide the face of the target pedestrian and the face image in the face database into m×m image blocks evenly, that is, m 2 image blocks, and then judge the LBP binary code of each pixel of each image block Combination mode:
分别将图像块的各像素点作为中心,其灰度值作为阈值,周围像素点灰度值与之比较进行二值化,得到LBP的二进制码,周围像素点与中心像素点比较二值化的公式如下式所示:Each pixel of the image block is taken as the center, and its gray value is used as the threshold, and the gray value of the surrounding pixels is compared with it for binarization to obtain the binary code of LBP, and the surrounding pixels are compared with the central pixel for binarization The formula is as follows:
其中,s(p)为以当前像素为中心的邻域的二值化值,gc为中心像素点的灰度值,gp为gc的邻域像素点灰度值;Among them, s(p) is the binarization value of the neighborhood centered on the current pixel, g c is the gray value of the center pixel, and g p is the gray value of the neighborhood pixel of g c ;
LBP二进制码序列中0和1之间跳变次数的计算公式如下:The calculation formula for the number of jumps between 0 and 1 in the LBP binary code sequence is as follows:
其中s(i)表示像素点P+1邻域的二值化值;Where s(i) represents the binarized value of the pixel P+1 neighborhood;
当U(LBP)≤2的二进制码组合模式为均匀模式,其它的二进制码组合模式为非均匀模式归为一种模式;When the binary code combination mode of U(LBP)≤2 is a uniform mode, other binary code combination modes are classified as a non-uniform mode;
4.2.2,求各图像块的LBP均匀模式的直方图,并将这m2个直方图串联起来,作为目标行人及人脸库中中人脸的LBP特征。4.2.2, Find the histogram of the LBP uniform mode of each image block, and connect the m 2 histograms in series as the LBP feature of the target pedestrian and the face in the face database.
步骤5的具体过程如下:The specific process of step 5 is as follows:
根据步骤4.3所选择的人脸图像,通过其在步骤3的命名规则可获得其帧号,进一步根据该相机视频的起始时间和帧率,可获得此人脸在该视频中出现的时间,最后将每个相机中选择的人脸视频帧按出现的时间的先后顺序标记出来,得到该目标行人的回溯追踪结果。According to the face image selected in step 4.3, its frame number can be obtained through its naming rule in step 3, and further according to the starting time and frame rate of the camera video, the time when the face appears in the video can be obtained, Finally, the face video frames selected in each camera are marked in the order of appearance time, and the backtracking result of the target pedestrian is obtained.
本发明的有益效果是,本发明通过人脸识别,智能化的得到目标行人在各相机视频中出现的时间,从而可以高效的实现对目标的回溯追踪,并能根据相机的安装位置实现对其行动轨迹的描绘,在异常事件发生时,可以快速的查找到其行踪,不用人工的一直查看视频,减轻了人工查找的工作量。The beneficial effect of the present invention is that the present invention intelligently obtains the time when the target pedestrian appears in each camera video through face recognition, so that the target pedestrian can be efficiently traced back and tracked according to the installation position of the camera. The depiction of the action track can quickly find its whereabouts when an abnormal event occurs, without manually checking the video all the time, reducing the workload of manual search.
附图说明Description of drawings
图1是本发明一种基于人脸识别的多相机视频事件回溯追踪方法的流程图;Fig. 1 is a flow chart of a method for backtracking and tracking multi-camera video events based on face recognition in the present invention;
图2是本发明的训练级联分类器的过程;Fig. 2 is the process of the training cascade classifier of the present invention;
图3是本发明中通过跟踪得到的人脸库中一个人的部分人脸图像;Fig. 3 is a partial face image of a person in the face database obtained by tracking in the present invention;
图4是本发明中框定的目标行人的人脸区域的图像;Fig. 4 is the image of the face area of the target pedestrian framed in the present invention;
图5是本发明中检测出的目标人脸的图像;Fig. 5 is the image of the target face detected in the present invention;
图6是采用本发明的回溯追踪方法回溯得到的目标行人在每个相机中的图像;Fig. 6 is the image of the target pedestrian in each camera obtained by backtracking using the backtracking method of the present invention;
图7是采用本发明的回溯追踪方法回溯得到的目标行人在多相机下每个相机中的最终回溯追踪结果示意图。Fig. 7 is a schematic diagram of the final backtracking result of the target pedestrian in each camera under multi-camera obtained backtracking by using the backtracking method of the present invention.
具体实施方式Detailed ways
下面通过附图和具体实施方式对本发明进行详细说明。The present invention will be described in detail below with reference to the drawings and specific embodiments.
参见图1,本发明的一种基于人脸识别的多相机视频事件回溯追踪方法,具体按照以下步骤实施:Referring to Fig. 1, a method for retrospectively tracking multi-camera video events based on face recognition of the present invention is specifically implemented according to the following steps:
步骤1:基于Haar-like特征通过Adaboost方法训练人脸级联分类器,具体过程如下:Step 1: Train the face cascade classifier through the Adaboost method based on Haar-like features. The specific process is as follows:
人脸检测时,组成通过Adaboost算法训练所得强分类器的每个弱分类器都与一个Haar-like特征相对应,是基于此特征的最优弱分类器,表示了人脸某部分的灰度分布特征。由于不是每一个Haar-like特征所描述的人脸特征都是重要的,可以作为判别人脸和非人脸的特征,所以Adaboost算法就需要通过迭代,从这些很庞大的特征中挑选出适合进行人脸与非人脸分类的特征,作为所选取的弱分类器,并根据其分类能力对每个若分类器赋予对应的权重,从而组成最终的强分类器。In face detection, each weak classifier that composes the strong classifier trained by the Adaboost algorithm corresponds to a Haar-like feature, which is the optimal weak classifier based on this feature, representing the grayscale of a certain part of the face distribution characteristics. Since not every face feature described by Haar-like features is important, it can be used as a feature to distinguish between a face and a non-face, so the Adaboost algorithm needs to be iteratively selected from these very large features. The features of face and non-face classification are used as the selected weak classifiers, and each weak classifier is assigned a corresponding weight according to its classification ability, thus forming the final strong classifier.
参见图2,训练强分类器的具体过程如下:Referring to Figure 2, the specific process of training a strong classifier is as follows:
1.1,给出训练样本,首先需要给出训练样本集(x1,y1),(x2,y2),...,(xn,yn),其中包含人脸正样本和负样本,xi表示样本,yi表示样本的正负,yi=1表示其为人脸正样本,yi=0表示其为人脸负样本(非人脸),n表示总的训练样本个数;1.1. Given the training samples, first you need to give the training sample set (x 1 ,y 1 ),(x 2 ,y 2 ),...,(x n ,y n ), which contains positive and negative face samples Sample, x i represents the sample, y i represents the positive or negative of the sample, y i =1 represents it is a face positive sample, y i =0 represents it is a face negative sample (non-face), n represents the total number of training samples ;
1.2,初始化权重:1.2, Initialize weights:
式中,w1,i代表第1次迭代过程第i个样本的初始化权重,l、m分别是正样本与负样本的数量,其中,i=1,2...n;In the formula, w 1,i represents the initialization weight of the i-th sample in the first iteration process, l, m are the number of positive samples and negative samples respectively, where i=1,2...n;
1.3,归一化权重,对所有样本的权重都进行归一化,如式(2)所示,qt,i为归一化后的权重:1.3, normalized weights, normalize the weights of all samples, as shown in formula (2), q t, i are the normalized weights:
其中,wt,i表示第t次迭代过程第i个样本的权重;Among them, w t,i represents the weight of the i-th sample in the t-th iteration process;
1.4,对每个Haar-like特征训练最优弱分类器,并计算其加权错误率:1.4, train the optimal weak classifier for each Haar-like feature, and calculate its weighted error rate:
对于每个Haar-like特征在样本基础上训练其最优弱分类器h(x,f,p,θ)为:For each Haar-like feature, the optimal weak classifier h(x, f, p, θ) is trained on the basis of the sample as:
其中,f表示特征,f(x)表示特征值,θ为阈值,p表示不等号的方向,p取1或-1,p是为了使得不等号的方向始终都是<号;Among them, f represents the feature, f(x) represents the feature value, θ is the threshold, p represents the direction of the inequality sign, p takes 1 or -1, and p is to make the direction of the inequality sign always be < sign;
计算最优弱分类器h(x,f,p,θ)对所有样本的加权错误率εf,如下式所示:Calculate the weighted error rate ε f of the optimal weak classifier h(x,f,p,θ) for all samples, as shown in the following formula:
1.5,选择对所有样本加权错误率最小的最优弱分类器,作为此次迭代所得到的弱分类器;1.5. Select the optimal weak classifier with the smallest weighted error rate for all samples as the weak classifier obtained in this iteration;
1.6,调整权重,权重的调整是根据步骤1.5得到的弱分类器对各样本是否正判来进行,如式(5)、(6)所示,可看出若正判则权重减小,若误判则权重增大,可以使后续选择弱分类器时选到更重视误判样本的分类器:1.6. Adjust the weight. The adjustment of the weight is based on whether the weak classifier obtained in step 1.5 judges each sample positively. As shown in formulas (5) and (6), it can be seen that if the positive judgment is positive, the weight is reduced. The weight of misjudgment increases, which can make the subsequent selection of weak classifiers select classifiers that pay more attention to misjudgment samples:
其中,ei的取值为0或1,当样本被正判时取0,当样本被误判时取1,εt表示第t次迭代过程得到的弱分类器对所有样本的加权错误率;Among them, the value of e i is 0 or 1, 0 when the sample is positively judged, and 1 when the sample is misjudged, ε t represents the weighted error rate of the weak classifier for all samples obtained in the t-th iteration process ;
重复步骤1.3~1.6进行迭代过程,直至达到规定的迭代次数T,得到T个弱分类器,结束迭代过程;Repeat steps 1.3 to 1.6 for the iterative process until the specified number of iterations T is reached, T weak classifiers are obtained, and the iterative process ends;
1.7,将T个弱分类器组成强分类器,强分类器是根据弱分类器的分类能力给予权重组成,即每个弱分类器进行投票决定判定结果,只是每个弱分类器所投票的分量不一样,得到的强分类器如下式所示:1.7. Combine T weak classifiers into a strong classifier. The strong classifier is composed of weights based on the classification ability of the weak classifiers, that is, each weak classifier votes to determine the judgment result, and only the component voted by each weak classifier Not the same, the obtained strong classifier is as follows:
相当于让所有弱分类器投票,再对投票结果按照弱分类器的错误率加权求和,将投票加权求和的结果与平均投票结果比较得出最终的结果;It is equivalent to letting all weak classifiers vote, and then weighting and summing the voting results according to the error rate of the weak classifiers, and comparing the weighted and summed results of the votes with the average voting results to obtain the final result;
1.8,改变迭代次数T,得到不同的强分类器,并按照T从小到大的顺序将强分类器进行级联,得到最终的级联分类器,强分类器的个数记为M,M大于20。1.8. Change the number of iterations T to obtain different strong classifiers, and cascade the strong classifiers in the order of T from small to large to obtain the final cascaded classifier. The number of strong classifiers is recorded as M, and M is greater than 20.
步骤2:采集监控系统中所有相机的视频;Step 2: collect the video of all cameras in the monitoring system;
步骤3:对采集到的所有相机视频中的人脸进行跟踪,得到每个人的多张人脸并将其作为人脸库,如图3所示,具体过程如下:Step 3: Track the faces in all the collected camera videos, get multiple faces of each person and use them as a face library, as shown in Figure 3, the specific process is as follows:
3.1,首先对相机中的待检测的视频帧进行灰度化,然后通过双线性插值方法缩小图像以提高检测速度,最后进行直方图均衡化以提高检测效果;3.1, first grayscale the video frame to be detected in the camera, then reduce the image by bilinear interpolation method to improve the detection speed, and finally perform histogram equalization to improve the detection effect;
3.2,对视频进行人脸检测并跟踪,跟追的方法为:对第N帧检测到的各人脸,依据帧间约束确定其在第N+1帧可能出现的范围,具体方法为:根据第N帧所检测到的人脸的位置及大小,在第N+1帧中以第N帧检测到的人脸中心为中心,将第N帧检测到的人脸区域的宽和高增大二倍,确定为第N+1帧中该人脸可能出现的范围,在此范围对第N+1帧进行该人脸的检测:3.2. Perform face detection and tracking on the video. The method of tracking is: for each face detected in the Nth frame, determine the possible range of its appearance in the N+1th frame according to the inter-frame constraints. The specific method is: according to The position and size of the face detected in the Nth frame is centered on the center of the face detected in the Nth frame in the N+1 frame, and the width and height of the face area detected in the Nth frame are increased Double, determine the range where the face may appear in the N+1th frame, and detect the face in the N+1th frame in this range:
若此范围内检测到的人脸为一个时,则为此人;If there is only one face detected within this range, it is this person;
若此范围内检测到的人脸不止一个时,计算第N帧检测到的人脸与第N+1帧检测到的各人脸中心间的欧式距离,将与第N帧距离最近的人脸确定为此人在第N+1帧出现的人脸;If more than one face is detected within this range, calculate the Euclidean distance between the face detected in the Nth frame and the center of each face detected in the N+1 frame, and the face closest to the Nth frame Determine the face of this person appearing in frame N+1;
若此范围内未检测到人脸时,则认为此人已走出该相机的视频区域;If no face is detected within this range, it is considered that the person has walked out of the video area of the camera;
人脸检测方法如下:The face detection method is as follows:
a,如果是视频图像的第一帧,则直接用步骤1得到的级联分类器进行人脸检测;a, if it is the first frame of the video image, then directly use the cascade classifier obtained in step 1 to perform face detection;
如果是视频图像的后续帧,则依据帧间约束确定为该帧中所跟追人脸可能出现的区域,在此区域内使用步骤1得到的级联分类器的前N个强分类器进行检测,N<M;除此区域外的其他区域使用步骤1得到的级联分类器进行检测;If it is a subsequent frame of the video image, it is determined according to the inter-frame constraints as the area where the face to be followed in the frame may appear, and the first N strong classifiers of the cascade classifier obtained in step 1 are used for detection in this area , N<M; other areas except this area are detected using the cascade classifier obtained in step 1;
b,对于检测到的人脸进行肤色检测,将非肤色误检结果排除掉,具体为:b. Perform skin color detection on the detected faces, and exclude non-skin color false detection results, specifically:
首先将图像从RGB色彩空间转换到YCbCr色彩空间,如式(9)、(10)、(11)所示:First convert the image from the RGB color space to the YC b C r color space, as shown in formulas (9), (10), and (11):
Y=0.257R+0.504G+0.098B+16 (9);Y=0.257R+0.504G+0.098B+16 (9);
Cb=-0.148R-0.291G+0.439B+128 (10);Cb=-0.148R-0.291G+0.439B+128 (10);
Cr=0.439R-0.368G-0.071B+128 (11);Cr=0.439R-0.368G-0.071B+128 (11);
对检测到的人脸区域中的像素点的Cb、Cr值进行判断,若满足85<Cb<130和132<Cr<180,则当前像素点就为肤色点,否则为非肤色点,若检测结果中肤色点占到总像素点60%以上则认为是人脸区域,否则为非人脸区域,予以排除。Judge the Cb and Cr values of the pixels in the detected face area. If 85<Cb<130 and 132<Cr<180 are satisfied, the current pixel is a skin color point, otherwise it is a non-skin color point. In the result, if the skin color points account for more than 60% of the total pixels, it is considered as a face area, otherwise it is a non-face area and is excluded.
3.3,将跟踪后得到的人脸写进数据库作为人脸库,每个人脸在数据库中的命名规则是:相机号_帧号,其中相机号表示该人脸属于哪个相机视频中检测到的,帧号表示该人脸图像属于该相机视频的哪一帧。3.3. Write the face obtained after tracking into the database as a face library. The naming rule of each face in the database is: camera number_frame number, where the camera number indicates which camera the face belongs to and is detected in the video. The frame number indicates which frame of the camera video the face image belongs to.
步骤4,在视频中框定目标行人的人脸区域,通过提取LBP特征,对于目标人脸在人脸库中进行匹配识别;具体过程如下:Step 4, frame the face area of the target pedestrian in the video, and perform matching and recognition on the target face in the face database by extracting LBP features; the specific process is as follows:
4.1,在视频中框定目标行人的人脸区域,如图4所示,在此区域中使用步骤1训练得到的级联分类器,在此区域中检测出目标人脸,作为对目标行人的标记,如图5所示;4.1, frame the face area of the target pedestrian in the video, as shown in Figure 4, use the cascade classifier trained in step 1 in this area, and detect the target face in this area as a mark for the target pedestrian , as shown in Figure 5;
4.2,提取目标行人的人脸及人脸库中人脸的均匀模式LBP特征:4.2. Extract the face of the target pedestrian and the uniform mode LBP feature of the face in the face database:
4.2.1首先将目标行人的人脸及人脸库中人脸图像均匀分成4×4的图像块,即16个图像块,然后判断每个图像块的每个像素点的LBP二进制码组合模式:4.2.1 First divide the face of the target pedestrian and the face image in the face database into 4×4 image blocks evenly, that is, 16 image blocks, and then judge the LBP binary code combination mode of each pixel of each image block :
LBP是一种对局部纹理特征进行描述的算子,将当前像素点作为中心,其灰度值作为阈值,周围像素点灰度值与之比较进行二值化,得到LBP的二进制码,周围像素点与中心像素点比较二值化的公式如下式所示:LBP is an operator that describes local texture features. The current pixel is taken as the center, and its gray value is used as a threshold. The gray value of the surrounding pixels is compared with it for binarization, and the binary code of LBP is obtained. The surrounding pixels The formula for comparing binarization between points and central pixels is as follows:
其中,s(p)为以当前像素为中心的邻域的二值化值,gc为中心点的灰度值,gp为gc的邻域像素点的灰度值;Among them, s(p) is the binarization value of the neighborhood centered on the current pixel, g c is the gray value of the center point, and g p is the gray value of the neighborhood pixel of g c ;
LBP的二进制码有多少种取值,即有多少种不同的二进制码组合模式。然而经过研究发现,有一些模式表示了大部分纹理模式,在图像中出现的概率高达90%以上,而一些其它模式在图像中出现的概率很低,所以可以认为有一些模式是图像纹理的基本属性,这些模式就是均匀模式(Uniform Pattern),即LBP二进制码序列中0和1之间跳变次数不超过两次的模式,跳变次数的计算公式如下:How many values does the binary code of LBP have, that is, how many different binary code combination modes there are. However, after research, it is found that some patterns represent most of the texture patterns, and the probability of appearing in the image is as high as 90%, while the probability of some other patterns appearing in the image is very low, so it can be considered that some patterns are the basic texture of the image. Attributes, these patterns are uniform patterns (Uniform Pattern), that is, patterns in which the number of jumps between 0 and 1 in the LBP binary code sequence does not exceed two times, and the calculation formula for the number of jumps is as follows:
其中s(i)表示像素点P+1邻域的二值化值;Where s(i) represents the binarized value of the pixel P+1 neighborhood;
当U(LBP)≤2的二进制码组合模式为均匀模式,其它的二进制码组合模式为非均匀模式归为一种模式;When the binary code combination mode of U(LBP)≤2 is a uniform mode, other binary code combination modes are classified as a non-uniform mode;
4.2.2,求各图像块的LBP均匀模式的直方图,并将这16个直方图串联起来,作为目标行人及人脸库中中人脸的LBP特征;4.2.2, Find the histogram of the LBP uniform mode of each image block, and connect these 16 histograms in series, as the LBP feature of the target pedestrian and the face in the face database;
4.3,通过欧式距离,计算人脸库中人脸与目标行人的人脸之间的LBP特征值之间的距离,按照计算得到的距离从小到大将库中人脸进行排序,根据排序顺序,选择出一幅与目标行人的人脸最接近的一幅人脸图像,即为目标行人的人脸图像。4.3. Through the Euclidean distance, calculate the distance between the face in the face library and the LBP feature value between the face of the target pedestrian, and sort the faces in the library according to the calculated distance from small to large. According to the sorting order, select A face image that is closest to the face of the target pedestrian is generated, which is the face image of the target pedestrian.
步骤5,根据人脸识别结果,提取目标行人在各相机出现的时间得出其行走路径,从而得到了目标的回溯追踪结果,具体过程如下:Step 5, according to the face recognition result, extract the time when the target pedestrian appears in each camera to get his walking path, and thus obtain the backtracking tracking result of the target. The specific process is as follows:
根据步骤4.3所选择的人脸图像,通过其在步骤3的命名规则可获得其帧号,进一步根据该相机视频的起始时间和帧率,可获得此人脸在该视频中出现的时间,最后将每个相机中选择的人脸视频帧按出现的时间的先后顺序标记出来,即可得到该目标行人的回溯追踪结果。According to the face image selected in step 4.3, its frame number can be obtained through its naming rule in step 3, and further according to the starting time and frame rate of the camera video, the time when the face appears in the video can be obtained, Finally, the face video frames selected in each camera are marked in the order of appearance time, and the backtracking result of the target pedestrian can be obtained.
图7给出的是最终回溯追踪结果图,从图7可以此目标行人出现的先后位置是相机5、相机4、相机3、相机1、相机2所对应的位置,因此,采用本发明方法可以快速准确的实现对目标的回溯追踪,大大提高了对视频事件中目标行人的检索效率。Figure 7 shows the final backtracking result diagram. From Figure 7, it can be seen that the successive positions of the target pedestrians are the corresponding positions of camera 5, camera 4, camera 3, camera 1, and camera 2. Therefore, using the method of the present invention can Quickly and accurately realize the backtracking of the target, which greatly improves the retrieval efficiency of the target pedestrian in the video event.
Claims (5)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510106388.8A CN104751136B (en) | 2015-03-11 | 2015-03-11 | A kind of multi-camera video event back jump tracking method based on recognition of face |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510106388.8A CN104751136B (en) | 2015-03-11 | 2015-03-11 | A kind of multi-camera video event back jump tracking method based on recognition of face |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN104751136A CN104751136A (en) | 2015-07-01 |
| CN104751136B true CN104751136B (en) | 2018-04-27 |
Family
ID=53590793
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201510106388.8A Expired - Fee Related CN104751136B (en) | 2015-03-11 | 2015-03-11 | A kind of multi-camera video event back jump tracking method based on recognition of face |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN104751136B (en) |
Families Citing this family (22)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105072399A (en) * | 2015-08-07 | 2015-11-18 | 广西南宁派腾科技有限公司 | Solar train compartment video monitoring system |
| CN105530433A (en) * | 2016-01-28 | 2016-04-27 | 北京金久瑞科技有限公司 | Image acquisition synchronization control device for multi-camera system |
| CN106127751B (en) * | 2016-06-20 | 2020-04-14 | 北京小米移动软件有限公司 | Image detection method, device and system |
| CN106778819A (en) * | 2016-11-24 | 2017-05-31 | 深圳智达机械技术有限公司 | A kind of device for image of anti-erroneous judgement |
| CN106778637B (en) * | 2016-12-19 | 2020-01-07 | 江苏慧眼数据科技股份有限公司 | Statistical method for man and woman passenger flow |
| CN106682691B (en) * | 2016-12-21 | 2019-08-02 | 厦门中控智慧信息技术有限公司 | Object detection method and device based on image |
| CN106851199A (en) * | 2017-02-07 | 2017-06-13 | 深圳云天励飞技术有限公司 | A kind of method for processing video frequency and device |
| CN107316036B (en) * | 2017-06-09 | 2020-10-27 | 广州大学 | Insect pest identification method based on cascade classifier |
| CN107818785A (en) * | 2017-09-26 | 2018-03-20 | 平安普惠企业管理有限公司 | A kind of method and terminal device that information is extracted from multimedia file |
| CN109325964B (en) * | 2018-08-17 | 2020-08-28 | 深圳市中电数通智慧安全科技股份有限公司 | Face tracking method and device and terminal |
| CN109543506A (en) * | 2018-09-29 | 2019-03-29 | 广东工业大学 | A kind of passerby's advertisement experience feedback system and method based on Expression Recognition |
| CN109815861B (en) * | 2019-01-11 | 2023-04-28 | 舟山魔墙科技有限公司 | User behavior information statistical method based on face recognition |
| CN110163111B (en) * | 2019-04-24 | 2024-06-28 | 平安科技(深圳)有限公司 | Face recognition-based number calling method and device, electronic equipment and storage medium |
| CN110188691A (en) * | 2019-05-30 | 2019-08-30 | 银河水滴科技(北京)有限公司 | A kind of motion track determines method and device |
| JP2021005320A (en) * | 2019-06-27 | 2021-01-14 | 東芝映像ソリューション株式会社 | Image processing system and image processing method |
| CN111027476A (en) * | 2019-12-10 | 2020-04-17 | 电子科技大学 | Face Recognition Tracker Based on Incremental Learning Algorithm |
| CN112215898B (en) * | 2020-09-18 | 2024-01-30 | 深圳市瑞立视多媒体科技有限公司 | Multi-camera frame data balance control method and device and computer equipment |
| CN113012194B (en) * | 2020-12-25 | 2024-04-09 | 深圳市铂岩科技有限公司 | Target tracking method, device, medium and equipment |
| CN113205079B (en) * | 2021-06-04 | 2023-09-05 | 北京奇艺世纪科技有限公司 | Face detection method and device, electronic equipment and storage medium |
| CN113870322B (en) * | 2021-08-23 | 2025-04-25 | 首都师范大学 | A multi-target tracking method, device and computer equipment based on event camera |
| CN116527848A (en) * | 2023-05-05 | 2023-08-01 | 北京七人科技有限公司 | Method and device for determining scene of camera, electronic equipment and storage medium |
| CN120807108A (en) * | 2025-09-02 | 2025-10-17 | 杭州但丁云科技有限公司 | Video job record tracing system and method based on order information association |
Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN202443476U (en) * | 2012-02-20 | 2012-09-19 | 华焦宝 | Multiple camera human face recognition system |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8285006B2 (en) * | 2007-04-13 | 2012-10-09 | Mira Electronics Co., Ltd. | Human face recognition and user interface system for digital camera and video camera |
-
2015
- 2015-03-11 CN CN201510106388.8A patent/CN104751136B/en not_active Expired - Fee Related
Patent Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN202443476U (en) * | 2012-02-20 | 2012-09-19 | 华焦宝 | Multiple camera human face recognition system |
Non-Patent Citations (4)
| Title |
|---|
| "基于视频监控网络的人脸跟踪算法研究";余珍珠;《中国优秀硕士学位论文全文数据库 信息科技辑》;20131215(第S2期);第1.4、2.2.1、2.3.2、2.4、4.5、5.1节 * |
| "智能像素聚类与AdaBoost方法像结合实现人脸跟踪";毕远;《中国优秀硕士学位论文全文数据库 信息科技辑》;20090715(第07期);第5.3.2节,图5-10 * |
| "重拍图像取证";翟晓波;《中国优秀硕士学位论文全文数据库 信息科技辑》;20140615(第06期);第5.1节,图5.2 * |
| "非重叠视域多摄像机目标匹配算法研究";王涛;《中国优秀硕士学位论文全文数据库 信息科技辑》;20130615(第06期);第1.4、3.2、5.3节,图3.3、图5.3 * |
Also Published As
| Publication number | Publication date |
|---|---|
| CN104751136A (en) | 2015-07-01 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN104751136B (en) | A kind of multi-camera video event back jump tracking method based on recognition of face | |
| CN110598535B (en) | Face recognition analysis method used in monitoring video data | |
| John et al. | Pedestrian detection in thermal images using adaptive fuzzy C-means clustering and convolutional neural networks | |
| CN107330397B (en) | A Pedestrian Re-identification Method Based on Large-Interval Relative Distance Metric Learning | |
| Ma et al. | A reliable people counting system via multiple cameras | |
| CN103246896B (en) | A kind of real-time detection and tracking method of robustness vehicle | |
| CN108053427A (en) | A kind of modified multi-object tracking method, system and device based on KCF and Kalman | |
| CN106503687A (en) | The monitor video system for identifying figures of fusion face multi-angle feature and its method | |
| CN101196991A (en) | Method and system for counting dense passenger flow and automatic detection of pedestrian walking speed | |
| Cho et al. | Pamm: Pose-aware multi-shot matching for improving person re-identification | |
| CN101236599A (en) | Face recognition detection device based on multi-camera information fusion | |
| CN108549846A (en) | A kind of movement character combined and head and shoulder structure pedestrian detection and statistical method | |
| CN100390811C (en) | Real-time method for tracking multiple faces from video | |
| Singh et al. | A comprehensive survey on person re-identification approaches: various aspects | |
| CN107230267A (en) | Intelligence In Baogang Kindergarten based on face recognition algorithms is registered method | |
| CN111353338A (en) | An energy efficiency improvement method based on video surveillance in business halls | |
| Xie et al. | Video based head detection and tracking surveillance system | |
| CN110555386A (en) | Face recognition identity authentication method based on dynamic Bayes | |
| CN105574509A (en) | Face identification system playback attack detection method and application based on illumination | |
| CN103106414A (en) | Detecting method of passer-bys in intelligent video surveillance | |
| Kapsalas et al. | Regions of interest for accurate object detection | |
| Mathew et al. | Person re-identification through face detection from videos using Deep Learning | |
| Zhao et al. | Pedestrian motion tracking and crowd abnormal behavior detection based on intelligent video surveillance | |
| Desai et al. | Real-time implementation of Indian license plate recognition system | |
| Moctezuma et al. | Person detection in surveillance environment with HoGG: Gabor filters and histogram of oriented gradient |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant | ||
| TR01 | Transfer of patent right | ||
| TR01 | Transfer of patent right |
Effective date of registration: 20190115 Address after: 210000 R203 room, east of 2 building, 1 Garden Road, Jiangpu street, Pukou District, Nanjing, Jiangsu. Patentee after: Beijing Hua Chong Chong Nanjing Information Technology Co., Ltd. Address before: 710048 No. 5 Jinhua South Road, Shaanxi, Xi'an Patentee before: Xi'an University of Technology |
|
| CF01 | Termination of patent right due to non-payment of annual fee | ||
| CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20180427 Termination date: 20200311 |