CN101477641A - Demographic method and system based on video monitoring - Google Patents

Demographic method and system based on video monitoring Download PDF

Info

Publication number
CN101477641A
CN101477641A CN 200910076256 CN200910076256A CN101477641A CN 101477641 A CN101477641 A CN 101477641A CN 200910076256 CN200910076256 CN 200910076256 CN 200910076256 A CN200910076256 A CN 200910076256A CN 101477641 A CN101477641 A CN 101477641A
Authority
CN
China
Prior art keywords
head
image
current
previous frame
number
Prior art date
Application number
CN 200910076256
Other languages
Chinese (zh)
Inventor
英 黄
Original Assignee
北京中星微电子有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 北京中星微电子有限公司 filed Critical 北京中星微电子有限公司
Priority to CN 200910076256 priority Critical patent/CN101477641A/en
Publication of CN101477641A publication Critical patent/CN101477641A/en

Links

Abstract

The invention discloses a person number counting method and a system based on video monitoring. Based on video monitoring, the person number counting method can count the person number by detecting heads and estimating and tracking the movement of the heads, and can obviate counting error of manual counting due to the lack of energy. Because a video monitoring camera is usually arranged at a higher position and faces downwards slantwise in the monitored scene, the heads of all persons are visible basically and can be detected on a real-time basis even in a people-concentrated scene, so that the accurate counting can be achieved by continuously tracking the heads in the video, thereby obviating missing counting by manual counting in the people-concentrated scene.

Description

基于视频监控的人数统计方法和系统 Based on the number of video surveillance systems and statistical methods

技术领域 FIELD

本发明涉及视频监控技术,特别涉及一种基于视频监控的人数统计方法以及一种基于视频监控的人数统计系统。 The present invention relates to video surveillance technology, particularly to a statistical method based on the number of video surveillance system based on statistics and the number of video surveillance.

背景技术 Background technique

在例如超市、写字楼、地铁的出入口等场景,通常设置有视频监控系统的摄像头、以便实现对超市、写字楼、地铁的出入口等场景进行视频监控。 For example, a supermarket, office building, a subway entrance and other scenes, is generally provided with a camera video surveillance system, in order to achieve a supermarket, office building, subway entrance and exit scene video surveillance.

同时,出于某些特定需要,在上述各场景中,通常还需要统计出入的人数。 Meanwhile, for some specific needs in each of the above scenarios, usually required demographic and out. 而现有技术中的视频监控无法实现人数统计,因而上述的统计通常需要由人来完成。 The prior art video surveillance can not achieve the number of statistics, and thus the above statistics usually needs to be done by people.

然而,由于完成上述统计的人难以长时间集中精力一直保持对出入人数的精确计数,且在人流密集时容易漏计人数,因而由人来实现人数统计不但耗费人力,且人数统计的精度也不高。 However, due to the completion of the above statistics it difficult to concentrate for a long time remain accurate count of the number of people out, and in the crowded easily count the number of missing, which made people realize the number of statistics not only labor-intensive, and the number is not accurate statistics high.

发明内容 SUMMARY

有鉴于此,本发明提供了一种基于视频监控的人数统计方法以及一种基于视频监控的人数统计系统,能够基于视频监控实现人数统计。 Accordingly, the present invention provides a number of video surveillance based on the statistical method, and a number of statistics-based video surveillance system, the number of statistics can be realized based on the video monitor.

本发明提供的一种基于视频监控的人数统计方法,包括: al、在当前图像中进行人头检测,确定当前图像中的各人头; a2、利用当前图像、以及当前图像中各人头的位置,估算出前一帧图像中各人头的平移矢量速度; The present invention provides one kind of statistical methods based on the number of video surveillance, comprising: al, performed in the current image detecting head, each head is determined in the current image; A2, using the current image, and the image of the current position of each head, the estimate a previous frame in a translation vector of the speed of each head;

a3、根据前一帧图像中各人头的平移矢量速度,对前一帧图像中各人头进行预测跟踪,确定前一帧图像中各人头在当前图像中分别对应的人头,同时还确定新出现在当前图像中的人头、以供对下一帧图像执行所述步骤a2和a3时使用; a3, the previous frame image is a translation vector velocity of each head, the previous frame image of each head forecast track, determining a previous frame image of each head corresponding to each of the current image in the head, also identified emerging in current head image, for use on the next frame and when said step a2 a3;

a4、根据前一帧图像中各人头的数量、和/或前一帧图像中各人头在当前图像中分别对应的人头的数量,确定当前图像中的人数。 a4, in accordance with the number of each head of the previous frame image, and / or the previous frame respectively corresponding to each head in the head of the current image, determining the number of current image.

所述步骤al之前,该方法进一步包括:a0、利用前一帧图像的背景区域,从当前图像中检测包含运动物体的前景区域; Prior to the step Al, the method further comprising: a0, using the background region of the previous frame image is detected from the current image of the moving object comprises a foreground area;

且,所述步骤al中仅在当前图像的前景区域中检测人头。 And, said step al detected only when the current head foreground area of ​​the image.

从当前图像中检测包含运动物体的前景区域之后,所述步骤a0进一步包括: Foreground region from the current image after detecting a moving object, comprising the further step a0:

a01、将前一帧图像中的各运动物体与当前图像中各运动物体进行像素匹配,并根据像素匹配的运动物体在前一帧图像与当前图像中的位置差,估算出前一帧图像中各运动物体的平移矢量速度; A01, each moving object in front of an image pixel to match the current image of each moving object, and according to the pixel matching the moving object in the previous frame image and the image position difference between the current estimate the previous frame in each translational motion vector of velocity of the object;

a02、根据估算出的前一帧图像中各运动物体的平移矢量速度确定前一帧图像中各运动物体的预测跟踪位置,并将前一帧图像中各运动物体的预测跟踪位置与当前图像中各运动物体的实际位置进行匹配,以确定前一帧图像中各运动物体在当前图像中分别对应的运动物体、以及新出现在当前图像中的运动物体; A02, determining the predicted previous frame to track the position of each moving object according to a translation vector estimated speed of the previous image of each moving object, and the previous frame picture predicted position of each track of the moving object in the current image the actual position of each moving object matching, to determine the previous frame image of each moving object corresponding to each moving object in the current image, and emerging in the current image of the moving object;

a03、将当前图像中在前几帧图像中均未移动的运动物体设置为当前图像的背景,以供从下一帧图像中检测包含运动物体的前景区域时使用。 A03, a few of the current image in the previous frame image of a moving object moving neither set as a background of the current image, for use when detecting foreground region including the moving object from the next frame image. 所述步骤al包括: Said step al comprises:

al 1 、在当前图像的前景区域中搜索得到候选人头窗口; al 1, the current foreground area of ​​the image searched in the candidate window head;

a12、利用预先通过若干人头正样本和反样本训练得到的第一级分类器, a12, a first-class classifier using previously obtained by a number of positive samples and negative samples head training,

从搜索得到的所有候选人头窗口分别抽取Haar微特征和灰度均值特征,并 All candidates obtained from the search window head, respectively, and wherein micro extraction features gray value Haar, and

根据抽取的Haar微特征和灰度均值特征对搜索得到的所有候选人头窗口进 The micro all candidates Haar feature extraction head window and search features gray value obtained into

行第一级4企测过滤; 4 rows of the first half stage filtered measured;

a】3、对第一级检测过滤后剩余的候选人头窗口进行灰度归一化处理; a14、利用预先通过若干人头正样本和反样本训练得到的第二级分类器, 3 a], the first level after detecting the remaining candidate filter head window gradation normalization processing; A14, using a second-class classifier head previously obtained through several positive samples and negative samples training

从灰度归一化处理后的所有候选人头窗口分别抽取Haar微特征,并根据抽 Gradation candidates from all the head window normalized Haar microfeature decimated respectively according pumping

9取的Haar微特征对灰度归一化处理后的所有候选人头窗口进行第二级检测过滤; 9 taken Haar features micro gradation candidates normalized head window all the detection processing of the second stage filter;

a15、将第二级检测过滤后剩余的所有候选人头窗口中,相邻的多个候选人头窗口进行合并; A15, the head windows all candidates remaining after the second stage of the filter is detected in a window adjacent to the plurality of heads merge candidates;

a16、计算合并得到的所有候选人头窗口与预设人头特征规则的相似性; a16, all candidates head window is calculated and combined to give a predetermined head characteristics similarity rule;

a17、将相似性大于预设第一阈值的候选人头窗口确定为人头。 a17, the similarity is greater than a first predetermined threshold value candidates head window is determined to be the head.

所述步骤all中,按照预设计数子区域的位置、尺寸和形状仅在当前图像的部分前景区域中执行所述搜索,和/或在执行所述搜索时仅搜索预设人头尺寸的候选人头窗口。 In all the steps, according to a preset count sub-area location, size and shape of only performing the search, and / or when performing a search of said predetermined search head only head window size candidates in the current portion of the foreground region of the image .

所述步骤a2包括:将前一帧图像中的各人头与当前图像中各人头进行像素匹配,并根据像素匹配的人头在前一帧图像与当前图像中的位置差,估算出前一帧图像中各人头的平移矢量速度。 Said step a2 comprises: a front head for each image pixel to match the current image of each head, and the head according to the pixel matching the difference frame image and the previous image in the current position estimated in the previous frame translation vector for each head speed.

所述步骤a3包括:根据估算出的前一帧图像中各人头的平移矢量速度确定前一帧图像中各人头的预测跟踪位置,并将前一帧图像中各人头的预测跟踪位置与当前图像中各人头的实际位置进行匹配,以确定前一帧图像中各人头在当前图像中分别对应的人头、以及新出现在当前图像中的人头。 A3 comprises the step of: determining previous frame predicted head position of each track according to a translation vector estimated speed of the previous image of each head, and the previous frame image of each head tracking position and the predicted current image the actual position of each head by matching the image to determine the previous frame respectively corresponding to each head in the current image the head, and the head emerging in the current image.

在所述步骤a4中,所确定的当前图像中的人数仅包括:在连续N帧图像中均出现的人头的数量,其中,N为大于等于2的正整数; In the step a4, the number of the current image in the determined only comprises: N number of head in successive frames appear in both images, wherein, N is a positive integer greater than or equal to 2;

和/或,所确定的当前图像中的人数仅为预设计数子区域的位置、尺寸和形状内的人数。 And / or the number of the current image in the determined predetermined position count only sub-regions, the size and shape of the number.

在所述步骤a4中,所确定的当前图像中的人数仅包括:在连续N帧图像中均出现、且在连续N帧图像中的所述相似性总合大于预设第二阈值的人头的数量,其中,N为大于等于2的正整数。 In the step a4, the number of the current image determined includes only: are present in the N consecutive frame image, and the similarity in the aggregate N successive image frames of the second head is greater than a preset threshold value number, where, N is a positive integer greater than or equal to 2.

在所述步骤a4中,进一步根据所述步骤a2得到的平移矢量速度,分别确定当前图像中在不同运动方向的人数。 In the step a4, further accordance with the speed of the translation vector obtained in step a2, respectively, is determined in a current image in a number of different directions of movement.

本发明提供的一种基于视频监控的人数统计系统,包括: One inventive provide statistics based on the number of video surveillance systems, including:

人头检测模块,用于在当前图像中进行人头检测,确定当前图像中的各人头; Head detection module for detecting head in the current image, each head is determined in the current image;

图像存储模块,用于存储前一帧图像、以及表示前一帧图像中各人头的 Image storing means for storing an image of the front, and each represents the head of the previous frame

人头检测结果; Head detection result;

运动估计模块,用于利用当前图像、以及当前图像中各人头的位置,估算出前一帧图像中各人头的平移矢量速度; Motion estimation module, for using the current image, and a position of the head of each current image, the translation vector estimated speed of the previous frame image of each head;

预测跟踪模块,用于根据前一帧图像中各人头的平移矢量速度,对前一帧图像中各人头进行预测跟踪,确定前一帧图像中各人头在当前图像中分别对应的人头,同时还确定新出现在当前图像中的人头、以供所述速度估计模块和所述预测跟踪模块处理下一帧图像时使用; Prediction tracking module, according to the previous frame image speed of each head of a translation vector, the image of the previous frame to predict the track of each head, determining a previous frame image corresponding to each head in the current image the head, and also determining a new head appears in the current image, for using the velocity estimation module and the prediction when a next frame image tracking processing module;

数量确定模块,用于根据前一帧图像中各人头的数量、和/或前一帧图像中各人头在当前图像中分别对应的人头的数量,确定当前图像中的人数。 Determining the number of modules, each according to the number of the head of the previous frame image, and / or the previous frame respectively corresponding to each head in the head of the current image, determining the number of current image.

该系统进一步包括:前景检测模块,用于利用前一帧图像的背景区域, 从当前图像中检测包含运动物体的前景区域; The system further comprising: a foreground detection means for utilizing the background region of the previous frame image, foreground region including the moving object is detected from the current image;

且,所述人头检测模块仅在当前图像的前景区域中检测人头。 And, said head detection module detects only the head region of the current foreground image.

所述前景检测模块包括:前景提取子模块,用于从当前图像中检测包含运动物体的前景区域; The foreground detection module comprising: foreground extracting sub-module, for detecting a foreground moving object region from the current image;

且,所述前景检测模块进一步包括: And the foreground detection module further comprises:

运动估计子模块,用于将前一帧图像中的各运动物体与当前图像中各运动物体进行像素匹配,并根据像素匹配的运动物体在前一帧图4象与当前图像中的位置差,估算出前一帧图像中各运动物体的平移矢量速度; A motion estimation sub-module, for each of the moving object in the previous frame image is the current image pixel matching of each moving object, and an image with the image of FIG. 4 in accordance with a position difference between the current pixel matches the previous moving object, translation vector estimated speed of the previous frame image of each moving object;

预测跟踪子模块,用于根据估算出的前一帧图像中各运动物体的平移矢量速度确定前一帧图像中各运动物体的预测跟踪位置,并将前一帧图像中各运动物体的预测跟踪位置与当前图像中各运动物体的实际位置进行匹配,以确定前一帧图像中各运动物体在当前图像中分别对应的运动物体、以及新出现在当前图像中的运动物体; Prediction sub-tracking module configured to track the position of determining the predicted image in the previous frame of each moving object according to a translation vector estimated speed of the previous image of each moving object, and track the predicted previous frame of each moving object position match the current actual position of the image of each moving object to determine the previous frame image of each moving object corresponding to each moving object in the current image, and emerging in the current image of the moving object;

背景更新子模块,用于将当前图像中在前几帧图像中均未移动的运动物体设置为当前图像的背景,以供所述前景提取子模块从下一帧图像中检测包含运动物体的前景区域时使用。 Foreground background update sub-module, the current image for several frame image in the previous set were not moving a moving object as the background of the current image in the foreground extracting sub-module for detecting a next frame image from a moving object comprises area use. 所述人头检测模块包括: The head detection module comprises:

窗口搜索子模块,用于在当前图像的前景区域中搜索得到候选人头窗 Search sub-window module, used to search for a candidate to get the first window in the current foreground area of ​​the image

口; mouth;

利用预先通过若干人头正样本和反样本训练得到的第一级分类器,用于 The first-class classifier using previously obtained by a number of positive samples and negative samples head training for

从搜索得到的所有候选人头窗口分别抽取Haar微特征和灰度均值特征,并根据抽取的Haar微特征和灰度均值特征对搜索得到的所有候选人头窗口进行第一级4企测过滤; All candidates obtained from the search window head, respectively, and wherein micro-extraction Haar gray value features, and all candidates for the first search windows 4 was subjected to a first stage filter in accordance with the measured half Haar feature extraction and micro gray value characteristics;

灰度归一化子模块,用于对第一级检测过滤后剩余的候选人头窗口进行灰度归一化处理; Polar gradation normalization module for the first stage after the remaining candidate detection filter head window gradation normalization processing;

利用预先通过若干人头正样本和反样本训练得到的第二级分类器,用于 The second-class classifier using previously obtained by a number of positive samples and negative samples head training for

从灰度归一化处理后的所有候选人头窗口分别抽取Haar微特征,并根据抽取的Haar微特征对灰度归一化处理后的所有候选人头窗口进行第二级检测过滤; All candidates from gray head window after the normalization processing are extracted micro Haar features, and all candidates head window gradation normalization processing stage after the second detecting micro filter Haar feature extraction;

窗口合并子模块,用于将第二级检测过滤后剩余的所有候选人头窗口中,相邻的多个候选人头窗口进行合并; The combined sub-window module, all the candidates for the first detection window after a second stage remaining in the filter, the plurality of adjacent windows heads merge candidates;

相似性计算子模块,用于计算合并得到的所有候选人头窗口与预设人头特征规则的相似性; Similarity calculating sub-module, for calculating all candidates head window combined with a predetermined head characteristics obtained similarity rule;

结果判定子模块,用于将相似性大于预设第一阈值的候选人头窗口确定为人头。 Result of the determination sub-module for more than a preset similarity threshold window of the first candidate of the head as the head is determined.

所述窗口搜索子模块按照预设计数子区域的位置、尺寸和形状仅在当前图像的部分前景区域中执行所述搜索,和/或在执行所述搜索时仅搜索预设人头尺寸的候选人头窗口。 The sub-modules according to a preset search window count sub-area location, size and shape of only performing the search, and / or when performing a search of said predetermined search head only head window size candidates in the current portion of the foreground region of the image .

所述运动估计模块将前一帧图像中的各人头与当前图像中各人头进行像素匹配,并根据像素匹配的人头在前一帧图像与当前图像中的位置差,估算出前一帧图像中各人头的平移矢量速度。 The motion estimation module of each head of the previous frame image and a current image of each pixel to match the head, and the head according to the pixel matching the previous frame image and the difference between the current position in the image, previous estimates of each frame image head speed translation vector.

所述预测跟踪模块根据估算出的前一帧图像中各人头的平移矢量速度 The translation vector prediction module tracking an estimated speed of the previous image in accordance with the respective head

12确定前一帧图像中各人头的预测跟踪位置,并将前一帧图像中各人头的预测跟踪位置与当前图像中各人头的实际位置进行匹配,以确定前一帧图像中各人头在当前图像中分别对应的人头、以及新出现在当前图像中的人头。 12 determines the previous frame picture predicted head position of each track, and before an image of each head tracking position predicted image matches the actual current position of each head to determine the previous frame in the current of each head images respectively corresponding to head, head and emerging in the current image.

所述数量确定模块所确定的当前图像中的人数仅包括:在连续N帧图像中均出现的人头的数量,其中,N为大于等于2的正整数; Determining the number of persons in the current image block includes only the determined: number of head in successive frames N appear in both images, wherein, N is a positive integer greater than or equal to 2;

和/或,所确定的当前图像中的人数仅为预设计数子区域的位置、尺寸和形状内的人数。 And / or the number of the current image in the determined predetermined position count only sub-regions, the size and shape of the number.

所述数量确定模块所确定的当前图像中的人数仅包括:在连续N帧图像中均出现、且在连续N帧图像中的所述相似性总合大于预设第二阈值的人头的数量,其中,N为大于等于2的正整数。 Determining the number of persons in the current image block includes only a determined: N successive frames are present in the image, and the sum of the similarity in successive frame images N is greater than a second predetermined number of heads threshold value, wherein, N is a positive integer greater than or equal to 2.

所述数量确定模块进一步根据所述运动估计模块得到的平移矢量速度, 分别确定当前图像中在不同运动方向的人数。 Determining the number of said further module according to the translation velocity vector of the motion estimation module obtained were determined in a number of different current image in the direction of movement.

由上述技术方案可见,本发明基于视频监控,并通过人头检测、以及对人头的运动估计和跟踪来实现人数统计,以避免由人实现人数统计时、由于难以保持足够的精力而造成的计数误差,且考虑到视频监控摄像机按照在监控场景中通常设置在比较高的位置、并斜向下获取视频,因而即使场景中人流密集,所有的人头基本上也都是可见的,可实时检测到所有这些人头,并在视频中进行连续的跟踪以实现精确的计数,这样能够避免由人实现人数统计时由于人流密集而造成的漏计人数。 Seen from the above technical solution, the present invention is based on the video monitor, and by head detection, and motion of the head of the estimation and tracking to achieve demographic, to prevent the person to achieve demographic, since it is difficult to maintain enough energy caused counting discrepancies , and in view of video surveillance cameras in accordance with the scene monitoring is typically provided in a relatively high position, and acquires video obliquely downward, so that even in crowded scenes, but also substantially all of the head are visible, and real-time detection of all these heads, and continuously track in the video in order to achieve an accurate count, this can be avoided due to the number of total leakage crowded when people counting caused by people realize.

进一步地,由于可以在图像中可以4企测出包含运动物体的前景区域,因此,本发明可以仅在前景区域中进行人头检测、而无需在不可能出现人头的背景区域进行人头检测,从而能够排除不必要的^r测过程、以提高人数统计的效率。 Further, since half 4 can be detected foreground region including the moving object in the image, therefore, the present invention can be carried out only in the foreground region detection head, without requiring the detection head impossible in the background region of the head, thereby eliminate unnecessary ^ r measurement process, in order to increase the number of statistical efficiency.

在利用前一帧图像的背景区域来检测当前图像的前景区域的情况下,本发明还可以通过对前景区域的运动估计和预测跟踪,判断出当前图像中前景区域所包含的各运动物体,然后即可以此判断监控场景中的静止物体以更新背景区域,以使得在下一帧图像中检测的前景区域能够更加准确,从而能够提高人数统计的精度。 In the background region of the previous frame image is utilized to detect the current case of the foreground region of the image, the present invention also can be by the motion of the foreground area estimation and prediction tracking, it is determined that each of the moving object in the current image foreground region included, then in this scene is determined to monitor stationary object to update the background area, the foreground area so that the detected image in the next frame can be more accurate, thereby improving the accuracy of demographic.

再进一步地,本发明可以利用两级分类器对前景区域中搜索得到候选人头窗口进行两级检测过滤、并计算两级检测过滤后剩余的所有候选人头窗口与预设人头特征规则的相似性,以实现对人头的检测。 Still further, the present invention may utilize two classifier foreground region candidates searched in the first two detection windows filtered, and the similarity is calculated after all the remaining two candidates detection filter head window with a predetermined rule head characteristics, to enable detection of the human head.

在这种情况下,由于第一级分类器进行第一级检测过滤的候选窗口未进行灰度归一化处理,因而能够检测过滤掉大量灰度分布较为复杂的非人脸图像,从而能够减少第二级分类器的处理、以提高人头检测的效率,进而能够 In this case, since the first-stage classifier candidate detection window of the first filter stage is not performed normalized gray, gray distribution and thus a large number of more complex non-face image detection can be filtered out, thereby reducing processing the second stage classifier, to improve the efficiency of the detection head, and thus can be

进一步提高人数统计的效率;由于在计算候选人头窗口与预设人头特征规则的相似性之前,还可以先合并相邻的多个候选人头窗口,从而避免了同一个人头对应多个候选人头窗口,进一步提高了人头检测的准确性,进而能够进一步提高人数统计的精度;且,由于真实的人头才可能对应多个候选人头窗口、而虚警的出现往往比较孤立,因此,本发明如果仅计算合并后的候选人头窗口与预设人头特征规则的相似性,则能够避免将图像中的虚警误检测为人头,从而再进一步地提高了人头检测的准确性,进而能够再进一步地提高人数统计的精度。 To further increase the number of statistical efficiency; because the candidates before the similarity calculation with the preset window head first feature rules, you can also merge multiple candidates to head the adjacent window, thus avoiding multiple candidates corresponding to the same person head head window, thereby improving the accuracy of the detection head, and thus possible to further improve the accuracy of the statistical number; and, since it may be true corresponding to the plurality of candidate head head window, while false alarms tend to appear in isolation, therefore, the present invention is calculated only if the combined after the candidates head window similar to that of pre-poll feature rules, it is possible to avoid the image of the false alarm wrongly detected as the head, thereby further improving the accuracy of the head detection, and can further improve the statistics on the number of accuracy.

此外,本发明能够先通过人头的像素匹配实现运动估计,再通过人头的位置匹配实现预测跟踪,从而能够避免监控场景中被遮挡的人头遗漏,进而能够又进一步地提高人数统计的精度。 Further, the present invention can be achieved by the first head matching pixel motion estimation, then the predicted track achieved by matching the position of the head, the head can be avoided missing scene monitoring is blocked, and thus can be further improved statistical accuracy of the number.

为了避免仅出现一次的人头实际上为虚景而对人数统计精度产生影响, 可选地,本发明在确定人数时,可以不考虑仅出现一次的人头,以从而能够又进一步地提高人数统计的精度。 In order to avoid the head occur only once in fact produce an imaginary scene on the number of statistical accuracy influence Alternatively, the present invention in determining the number of people, can not be considered only once in the head, so as to be able to further improve the statistics on the number of accuracy.

而将本发明应用于例如超市、写字楼、地铁的出入口等场景的视频监控时,还可以分别确定当前图像中在不同运动方向的人数,以适应实际需要, 从而能够使得本发明的技术方案具有广泛的应用范围。 But the present invention is applied, for example, video surveillance supermarket, office building, subway entrance and exit of a scene, the current image may also be determined in a number of different motion directions, respectively, in order to adapt to the actual needs, it is possible that the aspect of the present invention have a wide range of applications.

附图说明 BRIEF DESCRIPTION

图1为本发明实施例中人数统计方法的示例性流程图;图2为本发明实施例中人数统计方法采用的人脸^f企测过程所抽取的 FIG 1 an exemplary flowchart of a method demographic embodiment of the invention; FIG. 2 embodiment, the number of faces used for statistical embodiment ^ f the extracted half metrology process of the present invention

Haar微特征的示例性结构图; An exemplary structure of FIG haar micro-feature;

图3为本发明实施例中人数统计方法采用的人脸检测过程所使用的第一级和第二级分类器的组成示意图; 3 a schematic diagram illustrating the face detection process in the number of statistical methods used and used in the first stage the second stage classifier embodiment of the invention;

图4为本发明实施例中人数统计方法采用的人脸检测过程的示例性流 FIG 4 embodiment the number of face detection used for statistical process of an exemplary embodiment of the present invention, stream

程图; Chart;

图5为本发明实施例中人数统计系统的示例性结构图; Figure 5 illustrates the exemplary configuration of FIG people counting system according to embodiments of the present invention;

图6为本发明实施例中人数统计系统的前景检测模块的示例性结构图; FIG 6 illustrates a structural view of the foreground people counting system according to the embodiment of the present invention, the detection module;

图7为本发明实施例中人数统计系统的人头检测模块的示例性结构图。 7 illustrates a configuration diagram of exemplary detection head module people counting system according to embodiments of the present invention. 具体实施方式 Detailed ways

为使本发明的目的、技术方案及优点更加清楚明白,以下参照附图并举实施例,对本发明进一步详细i兌明。 For purposes of this invention, the technical solution and merits thereof more apparent, the following embodiments with reference to the drawings simultaneously, i against the next in further detail the present invention.

本实施例中基于视频监控,并通过人头检测、以及对人头的运动估计和跟踪来实现人数统计,以避免由人实现人数统计时、由于难以保持足够的精力而造成的计数误差,且考虑到视频监控摄像机按照在监控场景中通常设置在比较高的位置、并斜向下获取视频,因而即使场景中人流密集,所有的人头基本上也都是可见的,可实时检测到所有这些人头,并在视频中进行连续的跟踪以实现精确的计数,这样能够避免由人实现人数统计时由于人流密集而造成的漏计人数。 When the embodiment based on the video monitor of the present embodiment, and is achieved demographic by head detector, and a motion of the head estimation and tracking, in order to avoid the person achieve demographic, since it is difficult to maintain sufficient energy resulting in counting errors, and taking into account Following the video surveillance cameras to monitor the scene is usually provided at a relatively high position, and acquires video obliquely downward, so that even in crowded scenes, but also substantially all of the head are visible, which can be detected in real time all of the head, and continuous track in the video in order to achieve an accurate count, this can be avoided due to the number of total leakage crowded when people counting caused by people realize.

图1为本发明实施例中人数统计方法的示例性流程图。 FIG 1 an exemplary flowchart of a method according to demographic embodiment of the present invention. 如图1所示,本实施例中基于视频监控的人数统计方法依次接收视频监控图像中的每一帧图像,并依次将每帧图像作为当前图像执行如下步骤: 1, the steps of the present embodiment, each frame of image receiving video surveillance images based statistical methods number of video surveillance sequentially, and sequentially performs each frame image as the current embodiment of the image:

步骤IOI,利用前一帧图像的背景区域,'从当前图像中检测包含运动物体的前景区域。 IOI step, using a background region of the previous frame image 'foreground region including the moving object is detected from the current image.

在本步骤中,可以采用现有的任一种前景检测方式,在此不再——赘述。 In the present step may be employed any of a foreground detection conventional way, which is not - repeat. 步骤102,在当前图像的前景区域中进行人头检测,确定当前图像中的各人头。 Step 102, a head detection current foreground region of the image, each head is determined in the current image.

在本步骤中,可以按照现有任一种人头检测方式实现人头检测;当然, 也可以按照本实施例中提出的一种基于两级分类器的方式实现人头检测。 In this step, the detection head may be achieved in accordance with any one of the conventional detection method head; of course, the head may also be implemented based on two detection classifier according to one embodiment of the present embodiment set forth. 其中,本实施例所提出的基于两级分类器实现人头检测的方式请详见后文。 Wherein the two classifiers Based on the detected rear head details can be found described embodiments proposed in the present embodiment.

需要说明的是,由于步骤101在当前图像中检测出了包含运动物体的前景区域,而本实施例实现人数统计所依据的人头必定属于运动物体,因此, 在本步骤中可以仅在前景区域中进行人头检测、而无需在不可能出现人头的背景区域进行人头检测,从而能够排除不必要的检测过程、以提高人数统计的效率。 Incidentally, since the step 101 is detected in the current image in the foreground region including the moving object, and the present embodiment implements people counting is based on the head must belong to the moving object, therefore, in this step may only foreground region be head detection, and detection in the background without head area unlikely to succeed, so can eliminate unnecessary testing process, in order to increase the number of statistical efficiency.

当然,上述步骤101仅^又为可选的步骤,如果不执行步骤101,则本步骤需要在当前图像的整帧中进行人头检测,但这样仅仅是额外进行了不必要的检测过程,而不会对人头检测结果造成实质性的影响。 Of course, step 101 is optional and only ^ step, if the step 101 is not performed, this step needs to be detected in the current head of the entire frame image, but this is only an unnecessary additional detection process carried out without will head the detection result of the impact substantial.

此外,可选地,用户可根据监控场景的实际情况任意设置用于表示仅对该区预内人头计数有效的计数子区域、和/或用于计数的人头的尺寸。 Further, alternatively, the user may arbitrarily set according to the actual scene monitoring is used to represent the only area of ​​pre-counting head count valid sub-regions, and / or for counting the size of a human head. 此时, 本步骤则可根据预设计数子区域的位置、尺寸和形状仅在当前图像的部分前景区域中执行人头检测,和/或在执行人头检测时仅检测符合预设人头尺寸的人头。 In this case, the step count may be preset according to the position of the sub-regions, the size and shape of the head is performed only in the current detecting portion in the foreground area of ​​the image, and / or detected only when performing head detection head matches the predetermined head size. 其中,上述的任意设置是指,在任意位置设置计数子区域、且设置的计数子区域可以为任意形状。 Wherein any of the above-mentioned means is provided, disposed at an arbitrary position count sub-regions, the sub-region and the count may be set to any shape.

步骤103,利用当前图像、以及当前图像中各人头的位置,估算出前一帧图像中各人头的平移矢量速度。 Step 103, using the current image, and the image of the current position of each head, the translation vector estimated speed of the previous frame image of each head.

在本步骤中,可以采用现有任意一种运动估计方式;当然,也可以采用本实施例所提供的一种像素匹配方式。 In the present step may be employed any of the conventional motion estimation mode; Of course, A pixel matching mode in this embodiment may also be employed provided. 其中,本实施例所提出的像素匹配方式请详见后文。 Wherein, the pixel matching method of the present embodiment set forth in Example please see later.

步骤104,根据前一帧图像中各人头的平移矢量速度,对前一帧图像中各人头进行预测跟踪,确定前一帧图像中各人头在当前图像中分别对应的人头,同时还确定新出现在当前图像中的人头、以供对下一帧图像执行所述步骤103和104时4吏用。 Step 104, the previous frame image is a translation vector velocity of each head, the previous frame image of each head forecast track, determining a previous frame image of each head corresponding to each of the current image in the head, also identified emerging in this image the head, for the time of the next frame 4 Official performed with the steps 103 and 104.

16在本步骤中,可以采用现有任一种预测跟踪方式,也可以采用本实施例中所提供的一种基于位置匹配的方式来实现。 In this step 16, the prediction may be employed any of the conventional tracking mode A in this embodiment provided by the position of the matching Based embodiment may also be employed. 其中,本实施例所提出的基于位置匹配的方式请详见后文。 Wherein, according to the present embodiment based on this later embodiment please match the position of the proposed embodiment.

步骤105,根据前一帧图像中各人头的数量、和/或前一帧图像中各人头 Step 105, according to the number of each head of the previous frame image, and / or the previous frame in each head

在当前图像中分别对应的人头的数量,确定当前图像中的人数。 Number of heads in the current image respectively corresponding to, determine the number of the current image.

可选地,用户可根据监控场景的实际情况任意设置用于表示仅对该区预 Alternatively, the user can arbitrarily set according to the actual scene monitoring is used to indicate only the region of the pre

内人头计数有效的计数子区域。 The counting head count valid subregions. 此时,本步骤则可以仅确定当前图像的计数 At this time, in this step it may be determined only the current image count

子区域内的人数。 Number of people in the sub-region. 至此,本流程结束。 So far, this process ends.

下面,对上述流程中的各步骤分别进行详细说明: 1 )关于步骤101: Next, the above-described process steps are each described in detail below: 1) In step 101:

在将第一帧图像作为当前图像执行步骤101时,整幅图像均为前景区域;而将对除第一帧图像之外的后续其他帧图像作为当前图像执行步骤l(M 时,通常只有一部分为前景区域、而剩余的另一部分则为背景区域。 In the first frame image as the current image step 101, the entire image both foreground region; will follow when the other frame image other than the first frame image of the current image as step l (M, usually only a portion of as the foreground area, while another portion was remaining background area.

这样,由于将除第一帧图像之外的每帧图像作为当前图像时,均需要利用该帧图像的前一帧图像的背景区域执行步骤101,因此,本实施例中的步骤101可以在从当前图像中检测包含运动物体的前景区域之后,进一步可选地对检测到的前景区域进行运动估计和预测跟踪、以识别出连续在多帧图像中出现的静止物体并更新背景区域,从而提高人数统计的精度。 Thus, since when each frame image other than the first frame image as the current image, step 101 require the use of background region of the previous frame image of the frame image, and therefore, in the present embodiment step 101 can range from after detecting a current image region moving foreground object, further optionally the detected foreground region prediction motion estimation and tracking to identify a stationary object in the plurality of consecutive frame image and updating the background region, thereby increasing the number of accuracy of statistics.

具体来说,对检测到的前景区域进行运动估计可以釆用现有任一种运动估计方式,也可以采用本实施例所提出的一种像素匹配方式,该方式包括: 基于像素块的方式,将前一帧图像中的各运动物体与当前图像中各运动物体进行像素匹配,并根据像素匹配的运动物体在前一帧图像与当前图像中的位置差,估算出前一帧图像中各运动物体的平移矢量速度。 Specifically, the detected foreground region motion estimation may preclude the use of any of the conventional motion estimation methods for a pixel matching forth embodiment according to the present embodiment may also be employed, the mode comprising: a pixel block based manner, each moving object in front of an image pixel to match the current image of each moving object, and the previous frame image and the image in the location of the current difference according to the pixel matching the moving object estimated before an image of each moving object translation velocity vector.

而对于检测到的前景区域进行预测跟踪,则可以采用现有任一种预测跟踪方式,也可以采用本实施例所提出的基于位置匹配的方式来实现,该方式包括:根据估算出的前一帧图像中各运动物体的平移矢量速度,直接确定、或根据前一帧图像中各运动物体的聚类处理结果来确定前一帧图像中各运动物体的预测跟踪位置,并将前一帧图像中各运动物体的预测跟踪位置与当前图像中各运动物体的实际位置进行匹配,以确定前一帧图像中各运动物体在当前图像中分别对应的运动物体、以及新出现在当前图像中的运动物体。 The prediction for the tracking of the detected foreground area, you can use any of a conventional predictive tracking mode, the present embodiment may be location-based matching methods to implement the proposed embodiments, which include: estimated according to the previous a translation vector in the frame image speed of each moving object directly determined, or predicted track to determine the location of the previous frame image of each moving object according to the result of the clustering process each previous frame image of the moving object, and a previous frame image predicted track the position of each moving object matched with the current actual position of the image of each moving object to determine the previous frame image of each moving object in the current image corresponding to the moving object, and a motion emerging in the current image object. 此后,即可将当前图像中在前M帧图像中均未移动的运动物体设置为 Thereafter, the image in the front to M image frames no moving object is currently moving to

当前图像的背景、M为大于等于1的正整数,以供从下一帧图像中执行步骤101时使用。 The current background image, M being a positive integer greater than or equal to 101 for the next frame is performed using the step.

2)关于步骤102: 2) In step 102:

本实施例提出了一种基于两级分类器实现人头检测的方式,该方式对从当前图像的整帧、或当前图像的前景区域中搜索得到的所有候选人头窗口采用三级检测过滤。 The present embodiment proposes a two classifications based on the detection head is implemented manner that the first window to search for all the candidates obtained from the entire current frame image, or the current foreground area of ​​the image using three detection filters. 其中,第一级检测过滤利用"人头/非人头"的二类分类器来实现,并针对未经灰度归一化处理的候选人头窗口;第二级检测过滤也利用"人头/非人头"的二类分类器来实现,但针对经灰度归一化处理的候选人头窗口;而第三级则是基于候选人头窗口与人头特征规则的相似性来实现。 Wherein the first filter stage is detected by using a "head / non-head" to achieve second-class classifier, and for the normalization process without gradation candidate window head; detecting a second filter stage is also using the "head / non-head" the second-class classifier to achieve, but the candidates for the first window of normalization processing gradation; and the third stage is based on the similarity of the candidate with the head window head features to implement rules. "人头/非人头"的二类分类器在本文中简称为"分类器"。 "Head / non-head" simply referred to as second-class classifier "classifier" herein.

上述的第一级分类器和第二级分类器可利用现有人脸检测技术中成熟的Adaboost理论来实现,第一级分类器从候选人头窗口中抽取哈尔(Haar) 小波的微结构特征(简称为Harr微特征)和灰度均值特征,而第二级分类器则从候选人头窗口中仅抽取Harr微特征;第一级分类器和第二级分类器基于所抽取的特征能够确定某个尺度的矩形人头候选窗口是否是人头。 Said first classifier stage and the second stage classifier can utilize existing face detection technique to implement sophisticated Adaboost theory, a first-class classifier feature extraction microstructures Hal (the Haar) wavelet window head from the candidates ( referred to as micro Harr features) and wherein gray value and the second candidate from the first stage classifier window microfeature extracting only Harr; a first stage and a second stage classifier classifier based on the extracted features can determine whether a whether the candidate windows scale head is rectangular head.

较佳地,本实施例采用了如图2左侧的所示的6种Haar微特征、以及如图2最右侧所示的1种灰度均值特征。 Preferably, the present embodiment employs six Haar micro-feature shown in FIG. 2 on the left side, and one kind of gray value features shown in the far right in FIG. 2. 对于如图2所示的6种Haar微特征,本发明计算图像中对应黑色区域和白色区域内像素灰度均值的差值得到特征;对于灰度均值特征,本发明则计算矩形框内所有像素的均值。 For the six kinds of micro-Haar features shown in FIG. 2, the present invention calculates the image corresponding to the difference between the black region and the white region of the pixel gray value characteristic obtained; for gray value features, the present invention is the calculation of all the pixels within the rectangular frame It means.

其中,上述黑色区域通常表示人头的背景图像,而上述白色区域则通常表示人头、尤其是人头正面的人脸;且,如图2所示的6种组微特征中,黑色区域或者白色区域的长、宽可以任意选择,只需不超过候选人头窗口的尺寸即可。 Wherein the black region of the head generally indicates a background image, and the white region is usually expressed head, especially the head front face; and, 6 kinds of group of micro features shown in Figure 2, black or white area of ​​the region length and width can be arbitrarily selected, only the candidates can not exceed the size of the first window.

当然,实际使用的Haar微特征可以不限于如图2所示的6种,而是包括下述之一或任意组合: Of course, the Haar micro-feature may not be limited to the actual use six kinds shown in Figure 2, but comprises one or any combination of the following:

左右相邻的一个黑色区域和一个白色区域之间的像素灰度均值差,即不限于黑色区域和白色区域哪一个在左、哪一个在右; Pixel gray value difference between horizontally adjacent black region and a white region, i.e., not limited to the white region and the black region in which the left and right which;

上下相邻的一个黑色区域和一个白色区域之间的像素灰度均值差,即不限于黑色区域和白色区域哪一个在上、哪一个在下; The difference between the pixel gray value to a vertically adjacent black region and a white region, i.e. is not limited to black and white areas in a region which, following which;

一个黑色区域与其左右相邻的两个白色区域之间的像素灰度均值差; A black area around the pixel gray value thereto between adjacent two white areas of difference;

一个白色区域与其左右相邻的两个黑色区域之间的像素灰度均值差; Pixel gray value difference between two black areas on a white region horizontally adjacent thereto;

两个对角相连的黑色区域,与相邻两个对角相连的白色区域之间的像素灰度均值差,不限于黑色区域与白色区域的相对位置关系; Two diagonally connected black region, adjacent pixel gray value between the two white areas connected diagonally difference, the relative positional relationship is not limited to the black area and white area;

对角相连的一个黑色区域和一个白色区域之间的像素灰度均值差,不限于黑色区域与白色区域的相对位置关系。 Pixel gray value difference between a black region and a diagonal connected to the white area, the relative positional relationship is not limited to the black area and white area.

且在第一级分类器和第二级分类器的具体实现上,本实施例基于Adaboost理论将多个基于单个特征的弱分类器组成为一个强分类器,然后将多个强分类器级联成一个完整的"人头/非人头,,的二类分类器,即本发明所需的第一级分类器、第二级分类器。参见图3,第一级分类器、第二级分类器由n层上述强分类器级联而成,在第一级分类器、第二级分类器检测时, 如果n层强分类器中的某一层强分类器判别一个候选人头窗口为(False )假, 则排除此窗口而不进行进一步的判别,如果输出为(Tme)真,则使用下一层更复杂的强分类器对该窗口进行判别。也就是说,每一层强分类器都能让几乎全部人头样本通过,而拒绝大部分非人头样本。这样输入低层强分类器的候选人头窗口就多,而输入高层的候选人头窗口大大减少。 And the specific implementation of the first stage classifier and the second classifier stage, the present embodiment is based on Adaboost theory based on the plurality of weak classifiers consists of the individual features a strong classifier, and a plurality of strong classifiers cascade into a complete "head / head ,, the two types of non-classifiers, i.e. the desired first stage classifier of the present invention, the second stage classifier Referring to Figure 3, a first classification stage, a second stage classifier cascading the n layer of the strong classifiers obtained by, in the first stage classifier, a second stage classifier detects, if the n-layer in a strong classifier strong classifier determines one candidate for a head window (False) false, exclude this window without further identification, if the output is (Tme) true, then the next layer window discriminate use more sophisticated strong classifier. That is, each layer can be strong classifier so that almost all of the samples by the head, refusing most non poll sample. such low-level input strong classifier candidates to head a multi-window, and enter the top candidates for head window greatly reduced.

此外,对于上述结构的第一级分类器和第二级分类器,还需要利用大量的人头正样本和人头反样本预先进行训练。 Further, the first stage classifier and the second classifier stage configuration described above, also need to use a large number of head and head positive samples previously negative samples for training. 其中,人头正样本可包括自人头正面、侧面、背面、以及顶部拍摄的人头图像,即覆盖了不同姿态、不同头发、戴不同帽子的真实人头图像;而人头反样本包括例如风景、动物、文字 Among them, the head of the positive samples may include self-head front, side, back, and head top of the image captured, that is, covering different attitude, different hair, wearing a real head images of different hats; and head anti sample included subjects such as scenery, animal, character

19等任意未包含人头的图像;而具体的训练方法可以基于现有的Adaboost理 Other arbitrary image head 19 is not included; and specific training method may be based on existing processing Adaboost

论来实现,在此不再赘述。 On to achieve, not discussed here.

而且,为了保证对所有人头正样本和人头反样本被处理时处于同等条 Moreover, in order to ensure that the head of all positive samples and negative samples are processed the same poll bar

件,在进行训练之前,本发明可以先设定样本搜索窗口的尺寸,例如13 x Member, prior to training, the present invention can be sized to sample the search window, for example 13 x

13,然后由第一级分类器和第二级分类器利用设定尺寸的样本搜索窗口对所 13, is then utilized by the first stage and the second stage classifier classifier sized samples of the search window

有人头正样本和人头反样本进行裁剪和尺寸归一化处理,得到尺寸相同的人 It was the first positive samples and negative samples were cut and head size normalization, people get the same size

头正样本和人头反4羊本。 Positive samples and the head 4 sheep anti heads present.

这样,如图4所示,步骤102的具体处理过程就可以包括: Thus, in step 102, a specific processing procedure shown in FIG. 4 may include:

步骤102a、在当前图像的整帧、或当前图像的前景区域中搜索得到候 Step 102a, in the entire current frame image, the foreground area of ​​the image or the current search candidate obtained

选人头窗口。 Election poll window.

较佳地,为了尽可能保证输入图像中所有可能的候选人头窗口不会被遗漏,本步骤中的处理过程可具体包括:先对输入的图像进行进行镜像、例如1.05倍尺寸放大或0.95倍尺寸缩小等预设比例的缩放、例如±10度等预设角度的旋转;然后在输入的图像、以及进行所述缩放、所述旋转后的图像中, 以穷举的方式搜索得到不同尺寸的若干候选人头窗口;最后,再将不同尺寸的若干候选人头窗口进行尺寸归一化处理,得到预设标准尺寸的若干候选人头窗口。 Preferably, in order to ensure that the input image as much as possible of all possible candidates head window will not be missed, the process in this step may specifically include: an image inputted first mirror, for example, 1.05 times, or 0.95 times the size of an enlarged size other preset ratio reduction scaling, rotation and the like, for example, ± 10 degrees of a predetermined angle; then the input image, as well as the scaling, rotation of the image in order to obtain an exhaustive search of a number of different sizes head window candidates; Finally, a number of candidates and then head window size of different sizes were normalized, to obtain a predetermined number of candidates of the first standard size window.

这样,可最大限度地避免不同角度或不同大小的候选人头窗口被遗漏; 还可保证在后续的处理过程中,对所有候选人头窗口采用同等条件的处理。 In this way, the maximum to avoid or at different angles of different sizes candidates head window is omitted; also ensures the subsequent processing, the processing using the same conditions for all candidates head window.

此外,对于如前文所述,用户可根据监控场景的实际情况任意设置用于表示仅对该区预内人头计数有效的计数子区域、和/或用于计数的人头的尺寸。 In addition, as previously described, a user can arbitrarily set according to the actual scene monitoring is used to indicate only the area within the pre-counting head count valid sub-regions, and / or for counting the size of a human head. 此时,本步骤则可根据预设计数子区域的位置、尺寸和形状仅在当前图像的部分前景区域中执行搜索,和/或在执行搜索时仅搜索符合预设人头尺寸的候选人头窗口。 In this case, the step count may be preset according to the position of the sub-regions, the size and shape of the portion of the current search is performed only the foreground area of ​​the image, and / or when performing searches search only candidates satisfying the predetermined head size head window.

步骤102b、利用预先通过若干人头正样本和反样本训练得到的第一级分类器,从搜索得到的所有候选人头窗口分别抽取Haar微特征和灰度均值特征,并根据抽取的Haar微特征和灰度均值特征对搜索得到的所有候选人头窗口进行第一级检测过滤。 Step 102b, a first-class classifier using previously obtained by a number of positive samples and negative samples head training, all candidates from the first search window obtained extract Haar features and the micro-features gray value, respectively, according to the micro-feature extraction and ash Haar mean feature of all candidates head window searched out in a first stage detection filter.

由于所有候选人头窗口经灰度归一化处理后,有可能存在某些非人头的候选人头窗口与实际为人头的候选人头窗口的灰度分布相类似,区分较为困难,因此,本步骤先不对所有候选人头窗口进行灰度归一化处理、并通过第一级检测过滤将上述的某些非人头的候选人头窗口排除掉,以减少后续为区分上述的某些非人头的候选人头窗口的处理,因而能够提高人头检测的效率。 Since all the candidates head window after gradation normalization process, the candidates may exist certain non-head window and the actual head of gradation candidates head distribution head window similar, it is difficult to distinguish, thus, it does not present the first step All candidates head window gradation normalized and filtered head above certain non-excluded candidates head window detection by the first stage to reduce the above-described subsequent to distinguish between certain non-head processing head window candidates , it is possible to improve the efficiency of the detection head.

需要说明的是,本步骤中从每个候选人头窗口抽取的Harr微特征的种类数量可任意设定;Harr微特征中黑色区域或者白色区域的长、宽可以任意选择,只需不超过候选人头窗口的尺寸即可;Harr微特征中的位置也可任意选择。 Incidentally, the number of kinds of micro-feature Harr this step each candidate extracted from the head window can be set arbitrarily; microfeature Harr long black or white area of ​​the region, a width can be arbitrarily selected, only the first candidate does not exceed window size can; microfeature Harr the position can be arbitrarily selected.

步骤102c、对第一级检测过滤后剩余的候选人头窗口进行灰度归一化处理。 Step 102c, the first stage after the remaining candidate detection filter head window gradation normalization.

步骤102d、利用预先通过若干人头正样本和反样本训练得到的第二级分类器,从灰度归一化处理后的所有候选人头窗口分别抽取Haar微特征, 并根据抽取的Haar微特征对灰度归一化处理后的所有候选人头窗口进行第二级;f企测过滤。 Step 102d, the second-class classifier using previously obtained by a number of positive samples and negative samples head training, all candidates from the head window gradation normalization decimated wherein each micro-Haar, Haar features and micro extraction of ash All candidates of the head window owned by a process after the second stage; F measured half filtration.

虽然所有候选人头窗口经灰度归一化处理后,有可能存在某些非人头的候选人头窗口与实际为人头的候选人头窗口的灰度分布相类似、区分较为困难,但由于上述的某些非人头的候选人头窗口已在第一次^r测过滤时被排除掉,因此,从本步骤开始的后续步骤均避免了对上迷的某些非人头的候选人头窗口的处理,从而提高了人头检测的效率。 While all candidates head window after gradation normalization process, there may be some non-window and the head of the first candidate for the actual distribution of gradation candidates head similar to the head of the window, it is difficult to distinguish, but some of the above non-head head window candidates have been excluded in the first filter test ^ r, therefore, the subsequent steps are started from the step of the present process avoids some of the fans of the non-head head window candidates, thereby increasing the head detection efficiency.

需要说明的是,本步骤中从每个候选人头窗口抽取的Harr微特征的种类数量可任意设定;Harr微特征中黑色区域或者白色区域的长、宽可以任意选择,只需不超过候选人头窗口的尺寸即可;Harr微特征中的位置也可任意选择。 Incidentally, the number of kinds of micro-feature Harr this step each candidate extracted from the head window can be set arbitrarily; microfeature Harr long black or white area of ​​the region, a width can be arbitrarily selected, only the first candidate does not exceed window size can; microfeature Harr the position can be arbitrarily selected.

步骤102e、将第二级检测过滤后剩余的所有候选人头窗口中,相邻的多个候选人头窗口进行合并。 Step 102e, all candidates head window after detecting the second stage remaining in the filter, the plurality of adjacent windows heads merge candidates.

本步骤所述的相邻可以是指:相互之间的尺寸差异小于预设尺寸差异阅值、和/或位置差异小于预设位置差异阈值、和/或重叠面积大于预设重叠面积阈值。 This step may be adjacent the means: size difference between each value reading less than the predetermined difference in size and / or position of the position difference is smaller than a preset difference threshold, and / or the overlap area overlapping area greater than the preset threshold.

由于从输入图像中搜索得到的某些相邻候选人头窗口,实际上可能对应的是该输入图像中的同一个人头,因此,为了避免对应同一个人头的多个相邻候选人头窗口被分别识别为不同的人头,由本步骤将相邻的多个候选人头窗口合并为一个、并由后续步骤仅针对合并后的候选人头窗口进行处理,以 Since some search window adjacent head candidates obtained from the input image, may actually correspond to the same person's head in the input image, therefore, in order to avoid a plurality of heads corresponding to the same individual window is adjacent the first candidates are identified a different head, by the step of the plurality of adjacent windows into one candidate header, the processing by the subsequent steps only candidates for the combined head window to

提高人头检测的准确性,从而提高人数统计的精度;且,由于真实的人头才可能对应多个候选人头窗口、而虚警的出现往往比较孤立,因此,如果后续步骤仅针对合并后的候选人头窗口进行处理,则能够避免将图像中的虚警误检测为人头,从而能够再进一步地提高人头检测的准确性,进而能够进一步提高人数统计的精度。 Improve the accuracy of detection of the head, thereby increasing the number of statistical accuracy; and, because the only real head may correspond to multiple candidates head window, and appear false alarms tend to be more isolated, therefore, if the next steps only candidate for the head of the merged window processing, it is possible to avoid false alarm in the image head is erroneously detected, it is possible to further improve the accuracy of detection of the head, and thus possible to further improve the statistical accuracy of the number.

当然,由于本步骤的作用主要是提高人头检测的准确性,如果不执行本步骤仅仅是降低人头检测的准确性、而不会妨碍人头检测的实现,因此本步骤为可选的步骤。 Of course, since the primary role of this step is to improve the detection accuracy of the head, if this step is performed not only to reduce the accuracy of the detection head, and the head does not interfere with detection achieved, so this step is an optional step.

步骤102f、计算合并得到的所有候选人头窗口与预设人头特征规则的相似性。 Step 102f, the first window is calculated for all candidates obtained combined with the similarity rule predetermined head characteristics.

相应地,本步骤中的具体处理过程可以包括:先"t姿照现有人脸检测中抽取轮廓点的方式,抽取候选人头窗口中的各轮廓点;然后利用现有的Sobel 算子计算候选人头窗口中各轮廓点在X方向的边界值ec/ge一;c 、以及在y方向的边界值WgL》,;此后,再利用公式V0念e — ;c)2 + — y)2计算候选人头窗口 Accordingly, the specific process of this step may include: a first "t posture as the conventional face detection mode extraction of contour points, each contour point candidates extracted header window; then existing candidates calculated Sobel operator head each contour point in the X-direction boundary value ec / ge a window; C, and a boundary value WgL "in the y direction ,; Thereafter, again using equation V0 read e -; c) 2 + - y) 2 calculated candidates head window

中各轮廓点的边界幅度、利用公式arctan^^计算候选人头窗口中各轮廓 Border amplitude of each contour point candidate is calculated using the formula arctan ^^ contour of each head window

点的边界方向;最后,计算候选人头窗口中各轮廓点的边界幅度和边界方向与标准人头边界的各轮廓点的边界幅度和边界方向的相似性,得到候选人头窗口与预设人头特征规则的相似性。 Point boundary direction; and finally, calculates similarity and amplitude boundary boundary direction and magnitude of the boundary in the boundary direction of each contour points with a standard head boundary contour point candidates of each head window, a window to give the candidates with a preset first characteristic head rules similarity.

需要说明的是,由于步骤102e为可选的步骤,因此,当执行完步骤102d 后、不执行步骤102e而直接执行本步骤时,本步骤可以按照上述方式计算第二级检测过滤后剩余的所有候选人头窗口与预设人头特征规则的相似性。 Incidentally, since the step is an optional step 102e, and therefore, when executed after step 102d, this step is performed directly without performing step 102e, this second stage detection step may be calculated as described above for all remaining after filtration candidates window and head of pre-poll feature similar rules.

步骤102g、将相似性大于预设第一阈值的候选人头窗口确定为人头。 Step 102g, the similarity is greater than a first predetermined threshold value candidates head window is determined to be the head.

至此,如图4所示的人头检测过程的流程结束。 Thus, the flow detection process head end shown in FIG.

3) 关于步骤103: 3) About Step 103:

本实施例对于步骤103的具体处理过程,提出了一种像素匹配方式包括:基于像素块,将前一帧图像中的各人头与当前图像中各人头进行像素匹配,并根据像素匹配的人头在前一帧图像与当前图像中的位置差,估算出前一帧图像中各人头的平移矢量速度。 For this embodiment, a specific processing procedure of step 103, a new pixel matching method comprising: based on the pixel block in the previous frame and the head of each head each matching pixel in the current image, and pixel matching in accordance with the head a previous frame image and the difference between the current position in the image, the translation vector estimated speed of the previous frame image of each head.

4) 关于步骤104: 4) In the step 104:

本实施例对于步骤104的具体处理过程,提供了一种基于位置匹配的方式包括:根据估算出的前一帧图像中各人头的平移矢量速度确定前一帧图像中各人头的预测跟踪位置,并将前一帧图像中各人头的预测跟踪位置与当前图像中各人头的实际位置进行匹配,以确定前一帧图像中各人头在当前图像中分别对应的人头、以及新出现在当前图像中的人头。 For this embodiment, a specific processing procedure in step 104, there is provided a matching location-based manner comprising: a translation vector for each head tracking speed determining the predicted previous frame the position of each head of the previous frame image according to the estimated, and the previous frame image of each head tracking position predicted image matches the actual current position of each head to determine the previous frame respectively corresponding to each head in the current image the head and emerging in the current image head. 其中,如果前一帧图像中的任意人头,在当前图像中存在位置匹配的人头,则可确定前一帧图像中的该人头在当前图像中对应与其位置匹配的人头;如果前一帧图像中的任意人头,在当前图像中不存在位置匹配的人头,则确定前一帧图像中的该人头暂时消失;如果当前图像中的任意人头没有与之匹配的前一帧图像中的人头,则确定当前图像中的该人头为新出现在当前图像中的人头。 Wherein, if the head of any of the previous frame, the position of head matching exists in the current image, the previous frame image may be determined in the head corresponding to its position in the current image matching head; if the previous frame image any head, the head position of the matching does not exist in the current image, it is determined that the previous frame image in the temporary loss of head; previous frame if the current image is not the head of any match in the head, is determined the head of the current image as a new image appears in the current poll.

例如,在前一巾贞图像中各人头的预测跟踪位置处设置相应的预测矩形框,并在当前图像中各人头的实际位置处设置相应的检测矩形框;然后分别计算各预测矩形框与每个检测矩形框的重叠面积,重叠面积越大,则表示对 For example, Chen one towel at a prediction image is provided in the front head tracking position corresponding to each rectangular frame prediction, and the corresponding set of detecting the actual position of a rectangular frame at a head of each of the current image; then calculated for each prediction rectangular frame with each respective a rectangular frame detection area of ​​overlap, the greater the overlap area, it is expressed

应的检测矩形框所在位置越有可能是该预测矩形框所对应人头在当前图像中的位置,因此,将与每个预测矩形框重叠面积最大的一个检测矩形框,分 Detecting the position corresponding to where rectangular frame prediction more likely it is that the head position of the rectangular frame in the current image corresponds, therefore, predicted largest rectangle overlapping a rectangular frame and detecting each of points

23别确定为该预测矩形框位置匹配的检测矩形框,然后依据位置匹配的预测矩形框和检测矩形框,确定前一帧图像中各人头在当前图像中分别对应的人头。 23 not determined that the predicted position of the matching of a rectangular frame detection rectangle, then based on the detection and prediction rectangular frame matches the position of a rectangular frame, determining a previous frame image corresponding to each head in the current image the head. 即,将与前一帧图像中每个人头的预测矩形框重叠面积最大的检测矩形框所对应的当前图像中的人头,分别确定为前一帧图像中人头的在当前图像中分别对应的人头;将当前图像中,未在前一帧图像中找到重叠预测矩形框的检测矩形框所对应的人头,确定为在当前图像中新出现的人头。 That is, the current image and the previous frame image prediction rectangular frame head of each area of ​​overlap the largest rectangular frame corresponding to the detection of the head, are determined in the current image corresponding to each of the front head is a head image ; the current image, an image of the predicted overlap is not found preceding the rectangular frame corresponding to a rectangular frame detection head, is determined as a head emerging in the current image.

此外,前一帧图像中的每个人头通常只能对应一个检测矩形框, 一个检测矩形框通常也只能对应前一帧图像中的一个人头。 In addition, the previous frame image of each detection head generally corresponds to only one rectangle, a rectangle is generally a head corresponding to only the previous frame image is detected. 那么如前一帧图像中的某个人头未对应任何一个检测矩形框、即该人头的预测矩形框与当前图像中的所有监测矩形框均无重叠,则认为前一帧图像中的该人头在当前图像中暂时消失。 Then, as in the previous frame does not correspond to any of a head detected a rectangular frame, i.e. the head of the rectangular frame prediction and monitoring of all the rectangular frame overlaps no current image, the previous frame image is considered the head of the the current image temporarily disappear. 但是,在本实施例中并不立即删除该人头、而是仍然跟踪前一帧图像中的该人头,在将后续的每帧图像作为当前图像执行本步骤时,根据该人头的平移速度继续更新该人头的预测矩形框,如连续P帧图像中该预测矩形都没重叠的检测矩形框,P为大于l的正整数,再确定该人头已经消失,否则认为该人头重新出现。 However, in the present embodiment, the head does not immediately deleted, but still a track before the head image, when the image of each subsequent frame as the current picture performed in this step, continue to update the translation speed of the head the head of the rectangular frame prediction, such as continuous P frame images did not overlap the predicted detection rectangular rectangular frame, P is a positive integer greater than l, and then determines that the head has disappeared, that the head or reappear.

5)关于步骤105: 5) In the step 105:

在步骤105如何确定当前图像中的人数,可以根据监控场景的实际情况和需要来任意设定。 In step 105 how to determine the number of current image may be arbitrarily set according to actual situation and the need to monitor the scene.

例如,假设前一帧图像中各人头的数量,大于前一帧图像中各人头在当前图像中分别对应的人头的数量,则表示前一帧图像中的至少一个人在当前图像中被遮挡、或消失,那么对于图像能够包含整个密闭房间景象的监控场景来说,由于不会有人从密闭房间中离开,因而步骤105可以将前一帧图像中各人头的数量确定为当前图像中的人数即可;而对于地铁出入口等人移动十分频繁的监控场景来说,由于人通常是快速的单方向移动、而很少会由于停留而被遮挡,因而步骤105可以将前一帧图像中各人头在当前图像中分别对应的人头的数量确定为当前图像中的人数即可,或同时再考虑多种其他条件来确定。 For example, assuming the number of the previous frame image of each head, the number of head of the previous frame image of each head corresponding to each of the current image is greater than said at least one previous frame image is occluded in the current image, or disappear, then for the entire image can contain a sealed room scene monitoring the scene, because no one will leave from the closed room, and thus step 105 may determine the number of each head before an image that is as the number of current image may be; for the subway entrance et al moving very frequent monitoring scenario, because people are usually moving fast in one direction, and rarely is blocked due to travel, and thus step 105 may be a previous frame image in each head the current number of images respectively corresponding to the number of the current head is determined as the image to, or simultaneously consider a variety of other conditions determined.

24再例如,对于作为人流出入较为频繁的大门等监控场景,步骤105还可 24 another example, for a flow out of the door to more frequent monitoring and other scenes, step 105 may further

进一步根据步骤103得到的平移矢量速度,分別确定当前图像中在不同运动 Further according to the translation velocity vector obtained in step 103, the current image are determined at different motion

方向的人数,即,如果某个人头跨过了进门的线,且平移速度的方向与进门 The number of directions, that is, if a head crossed the line of the door, and the translational velocity and direction of the door

方向一致,则进门的人头数加l;如某个人头跨过了出门的线,且平移速度的方向与出门方向一致,则出门的人头数加l。 The same direction, the head of the door plus the number L; crossed out as a head line, the translational velocity and direction coincides with the direction to go out, out of the number of head plus l.

由此可见,本步骤中确定当前图像中人数的具体方式只能依据监控场景的实际情况和需要来设定,因此,在此无法——赘述。 Thus, this step is to determine the current number of images in a specific way can only be based on the actual situation and the need to monitor the scene is set, therefore, this can not - repeat.

需要说明的是,步骤105中之所以在确定当前图像中的人数时,只考虑根据前一帧图像中各人头的数量、和/或前一帧图像中各人头在当前图像中分别对应的人头的数量,而不考虑新出现在当前图像中的人头数量,这是因为新出现在当前图像中的人头只有在后续至少一帧图像中继续出现,才有可能不是虚景。 Incidentally, the reason why it is determined in step 105 in the current image number, considering only the number of each head of the previous frame image, and / or the previous frame respectively corresponding to each head in the current image according to the head number, regardless of the number of head of emerging current image, and this is because the new image appears in the current poll only continue to appear in at least one subsequent images, may not have a virtual scene.

由此,无论采用哪种具体的确定规则,较佳地,本实施例在步骤105中所确定的当前图像中的人数仅包括:在连续N帧图像中均出现的人头的数量,其中,N为大于等于2的正整数。 Thus, regardless of which specific rules determined using, preferably, in the present embodiment the number of the current image according to the determined in step 105 only includes: N number of consecutive frame images appearing in both human head, wherein, N positive integer greater than or equal to 2. 此外,如前所述,可选地,用户可根据监控场景的实际情况任意设置用于表示仅对该区预内人头计数有效的计数子区域,那么此时,步骤105所确定的当前图像中的人数,仅为预设计数子区域的位置、尺寸和形状内的人头数量。 Further, as described above, alternatively, the user can arbitrarily set the count valid only for the head sub-areas within the count area for indicating a pre-monitoring the actual situation of the scene, then this time, a current image determined in step 105 number, only the sub-region of the predetermined position count, size and number of the head shape.

当然,对于如图4所示的人头检测方式,较佳地,在步骤105中所确定的当前图像中的人数仅包括:在连续N帧图像中均出现、且在连续N帧图像中的步骤102f所得到的相似性的总合大于预设第二阈值的人头的数量, 其中,N为大于等于2的正整数。 Of course, the detection head shown in FIG. 4, preferably, the number of current image determined in step 105 includes only: are present at N successive image frames, and the step of successive frame image N the sum of the number of similarity greater than a preset second threshold value, the head 102f obtained, wherein, N is a positive integer greater than or equal to 2. 即不以出现该人头的数量来判断,而是以该人头在多帧图像中是否具有较高相似度为判断依据。 That is not to occur to determine the number of the head, but in the head has a higher degree of similarity whether the multi-frame image is determined based on.

以上是对本实施例中基于视频监控的人数统计方法的详细说明„下面, 再对本实施例中基于视频监控的人数统计系统进行说明。 These are described in detail in the present embodiment based on the number of video surveillance statistical methods "below embodiments, further embodiment will be described based on the people counting system of the present embodiment of video surveillance.

图5为本发明实施例中人数统计系统的示例性结构图。 Figure 5 illustrates the exemplary configuration of FIG people counting system according to embodiments of the present invention. 如图5所示,本实施例中的人数统计系统包括:前景检测模块501、人头检测模块502、图像存储模块503、运动估计模块504、预测跟踪模块505、以及数量确定模块506。 5, in this embodiment of the people counting system comprising: a foreground detection module 501, head detection module 502, an image storage module 503, the motion estimation module 504, a prediction tracking module 505, and the number determining module 506.

前景检测模块501,用于按照现有任一种前景检测方式,利用前一帧图像的背景区域,从当前图像中检测包含运动物体的前景区域。 Foreground detection module 501 configured in accordance with any one of the conventional foreground detection method using background region of the previous frame image from the current image containing a moving object detecting foreground region.

人头检测模块502,用于在当前图像的前景区域中进行人头检测,确定当前图像中的各人头。 Head detection module 502 for detecting the current head foreground region of the image, each head is determined in the current image. 其中,人头检测模块502可以基于现有任一种人头检测方式的工作原理实现人头,也可以基于按照本实施例中方法部分所提出的基于两级分类器这一方式的工作原理实现人头检测。 Wherein the head detection module 502 may be implemented based on the operating principle of the head head detecting any conventional way, the detection head may be achieved based on the principle according to the present embodiment, part of the method based on the proposed embodiment of the two classifiers.

需要说明的是,前景检测模块501为可选的模块,对于包含前景检测模块501的情况,人头检测模块502无需在不可能出现人头的背景区域进行人头检测,从而能够排除不必要的检测过程、以提高人数统计的效率;而对于不包括前景检测模块501的情况,人头检测模块502直接在整帧当前图像中进行人头检测。 Incidentally, foreground detection module 501 is an optional module, the case 501, head detection module 502 without the detection head in the background region of the head unlikely to contain foreground detection module, thereby eliminating unnecessary detection process, to increase the number of statistical efficiency; and in the case of not including foreground detection module 501, head detection module 502 directly detected in the current image the entire head frame. 进一步可选地,用户可根据监控场景的实际情况,在人头检测模块502中任意设置用于表示仅对该区预内人头计数有效的计数子区域、 和/或用于计数的人头的尺寸;此时,人头检测模块502则可根据预设计数子区域的位置、尺寸和形状仅在当前图像的部分前景区域中执行人头检测, Further alternatively, the user can monitor the actual situation of the scene, the head detection module 502 is provided for indicating any counting head count valid only within the sub-region of the area pre-and / or for counting the size of a human head; in this case, the head detection module 502 may count sub-area according to a preset position, size and shape of the current is performed only in the detecting head portion in the foreground area of ​​the image,

意设置是指,在任意位置设置计数子区域、且设置的计数子区域可以为任意形状。 Intended setting means, disposed at an arbitrary position count sub-regions, the sub-region and the count may be set to any shape.

图像存储模块503,用于存储前一帧图像、以及表示前一帧图像中各人头的人头检测结果。 Image storage module 503 for storing the previous frame, and each represents a head of a human head detection result of the previous frame image. 其中,为了节省实现存储的硬件资源,图像存储模块503可以只存储一帧图像、表示该一帧图像中各人头的人头检测结果、以及该一帧图像中的其他相关信息,即在如图5所示系统完成对当前图像的处理后,当前图像、表示当前图像中各人头的人头检测结果、以及当前帧图像中的其他相关信息均会被存储至图像存储模块503,以覆盖图像存储模块503 中的前一帧图像、表示前一帧图像中各人头的人头检测结果、以及前一整帧图像中的其他相关信息。 Wherein, in order to save hardware resources to achieve storage, image storage module 503 may store only an image showing a detection result of each head of the head of an image, and an image other relevant information, i.e., 5 in FIG. the system shown in FIG complete processing of the current image, the current image that is the current head detection results of each head image, and other relevant information of the current frame image will be stored in the image storage module 503, storage module 503 to cover the image in the previous frame image, the detection result represents the head of each head of the previous frame image, and other related information before a full frame image. 这样,对于下一帧图像来说,当前图像即作为该下 Thus, for the next frame image, the current image that is, as the lower

26一帧图像的前一帧图像。 26 before an image of an image.

运动估计模块504,用于利用当前图像、以及当前图像中各人头的位置, 估算出前一帧图像中各人头的平移矢量速度。 Motion estimation module 504, utilizing the current image, and the image of the current position of each head, the translation vector estimated speed of the previous frame image of each head. 其中,运动估计模块504可以基于现有任意一种运动估计方式的工作原理实现运动估计;当然,运动估计模块504也可以基于本实施例方法部分所提供的像素匹配方式的工作原理实现运动估计。 Wherein the motion estimation module 504 may implement motion estimation based on the operating principle any prior embodiment of the motion estimation; of course, the motion estimation module 504 may be based on the principle of the present embodiment of the pixel matching method of embodiment examples provided portion motion estimation.

预测跟踪模块505,用于根据前一帧图像中各人头的平移矢量速度,对前一帧图像中各人头进行预测跟踪,确定前一帧图像中各人头在当前图像中分别对应的人头,同时还确定新出现在当前图像中的人头、以供所述速度估计模块504和所述预测跟踪模块505处理下一帧图像时使用。 Prediction tracking module 505, according to the previous frame image speed of each head of a translation vector, the image of the previous frame to predict the track of each head, determining a previous frame image corresponding to each head in the current image the head, while head is also determined in the current image emerging, for estimating the speed used when tracking module 504 and the prediction module 505 to process the next frame image. 其中,预测跟踪模块505可以基于现有任一种预测跟踪方式的工作原理实现预测跟踪;预测跟踪模块505也可以基于本实施例中方法部分所提供的基于位置匹配方式的工作原理来实现预测跟踪。 Wherein the prediction tracking module 505 may track prediction implemented prior to any working principle of a predictive tracking mode; prediction tracking module 505 may also be based on the principle of the position matching mode to implement the method according to the present embodiment, the prediction based on the provided part of the tracking .

数量确定模块506,用于根据前一帧图像中各人头的数量、和/或前一帧图像中各人头在当前图像中分别对应的人头的数量,确定当前图像中的人数。 Number determination module 506, according to the number of each head of the previous frame image, and / or the previous frame respectively corresponding to each head in the head of the current image, determining the number of current image. 其中,进一步可选地,用户可根据监控场景的实际情况,也可在数量确定模块506中任意设置用于表示仅对该区预内人头计数有效的计数子区域, 此时,数量确定模块506则可以仅确定当前图像的计数子区域内的人数。 Wherein, further optionally, the user can monitor the actual scene may be set to determine only counting head count valid area for the sub-regions within the pre-block 506 represent the number, time, number determination module 506 it may be determined only within the current count of the number of sub-regions of the image.

下面,对上述系统中的各模块进行详细说明。 Next, the above-described system, each module described in detail.

图6为本发明实施例中人数统计系统的前景检测模块的示例性结构图。 Figure 6 illustrates a configuration diagram of exemplary foreground detection module people counting system according to embodiments of the present invention. 如图6所示,前景检测模块501中包括前景提取子模块511,用于按照现有任一种前景检测方式,利用前一帧图像的背景区域,从当前图像中检测包含运动物体的前景区域;背景存储子模块510,用于存储前一帧图像的背景区域。 6, the detection module 501 comprises a foreground foreground extracting sub-module 511 configured in accordance with any one of the conventional foreground detection method using background region of the previous frame image from the image to detect the current foreground region contains a moving object ; background storage sub-module 510 for storing an image before the background region. 其中,在视频监控的第一帧图像作为当前图像时,整幅图像均为前景区域;而对除第一帧图像之外的后续其他帧图像作为当前图像时,通常只有一部分为前景区域、而剩余的另一部分则为背景区域。 Wherein, when the first frame image as the current image of the video monitor, the entire image both foreground region; while another subsequent frame image other than the first frame image as the current image, usually only part of the foreground area, and another part is the remaining background area.

这样,由于将除第一帧图像之外的每帧图像作为当前图像时,前景提取子模块511均需要利用该帧图像的前一帧图像的背景区域,因此,本实施例 Thus, since the current image as a foreground image of each frame to extract frame image other than the first sub-module 511 require the use of a background region of the previous frame image of the frame image, therefore, the present embodiment

中的前景检测模块501还可以包括: Foreground detection module 501 may further comprise:

运动估计子模块512,用于基于像素块的方式,将前一帧图像中的各运动物体与当前图像中各运动物体进行像素匹配,并根据像素匹配的运动物体 A motion estimation sub-module 512, based on the pixel block mode, each of the moving object in the previous frame image is the current image pixel matching of each moving object and the moving object according to the pixel matching

在前一帧图像与当前图像中的位置差,估算出前一帧图像中各运动物体的平移矢量速度; Previous frame image and the current image position difference, the translation vector estimated speed of the previous frame image of each moving object;

聚类处理子模块513,用于对前景提取子模块511得到的前景区域中的各运动物体进行聚类处理;聚类处理子模块514为可选的子模块; Clustering processing sub-module 513 for extracting the foreground of each moving foreground region sub-module 511 obtained in the process of clustering objects; clustering process sub-module 514 is an optional sub-module;

预测跟踪子模块514,用于根据估算出的前一帧图像中各运动物体的平移矢量速度,直接确定、或根据前一帧图像中各运动物体的聚类处理结果来确定前一帧图像中各运动物体的预测跟踪位置,并将前一帧图像中各运动物体的预测跟踪位置与当前图像中各运动物体的实际位置进行匹配,以确定前一帧图像中各运动物体在当前图像中分别对应的运动物体、以及新出现在当前图像中的运动物体; Prediction tracking sub-module 514, according to a translation vector estimated speed of the previous image of each moving object directly determined, or the previous frame is determined according to the clustering processing result of the previous frame image of each moving object predicted track the position of each moving object, and track the predicted position of each moving object in the image to match the current actual position of each moving object in the previous frame, the previous frame to determine the image of each moving object in the current image, respectively, corresponding to the moving object and the moving object appears in a new current image;

背景更新子模块515,用于将当前图像中在前M帧图像中均未移动的运动物体设置为当前图像的背景、M为大于等于1的正整数,并更新至背景存储子模块510中,以供所述前景提取子模块511从下一帧图像中检测包含运动物体的前景区域时使用。 Background update sub-module 515, for the image were not moving motion M image frames preceding the current object is set as a background of the current image, M being a positive integer greater than or equal to 1, and a background update to the storage sub-module 510, used for extracting the foreground sub-module 511 detects foreground region including the moving object from the next frame image.

如此一来,通过对检测到的前景区域进行运动估计和预测跟踪、以识别出连续在多帧图像中出现的静止物体并更新背景区域,能够提高人数统计的精度。 Thus, by detecting the foreground region prediction motion estimation and tracking to identify a stationary object in the plurality of consecutive frame image and updating the background region, the number of statistics can be enhanced accuracy.

图7为本发明实施例中人数统计系统的前景检测模块的示例性结构图。 7 illustrates the configuration of FIG foreground detection module people counting system according to embodiments of the present invention. 如图7所示,基于本实施例方法部分所提供的像素匹配方式的工作原理,人头检测模块502包括: 7, the pixel matching method based on the principle of this embodiment of the method provided by embodiment, the detection module 502 head comprising:

窗口搜索子模块521,用于在当前图像的前景区域中搜索得到候选人头窗口;较佳地,为了尽可能保证输入图像中所有可能的候选人头窗口不会被遗漏,窗口搜索子模块521的处理过程可具体包括:先对输入的图像进行进行镜像、例如1.05倍尺寸放大或0.95倍尺寸缩小等预设比例的缩放、例如±10度等预设角度的旋转;然后在输入的图像、以及进行所述缩放、所述旋转后的图像中,以穷举的方式搜索得到不同尺寸的若干候选人头窗口;最后,再将不同尺寸的若干候选人头窗口进行尺寸归一化处理,得到预设标准尺寸的若干候选人头窗口;此外,对于如前文所述,用户可根据监控场景的实际情况任意设置用于表示仅对该区预内人头计数有效的计数子区域、和/ 或用于计数的人头的尺寸,此时,窗口搜索子模块521骤则可根据预设计数子区域的位置、尺寸和形状仅 Window search sub-module 521, a search window in the current first candidate to obtain the foreground region of the image; Preferably, in order to ensure that the input image as much as possible of all possible candidates head will not be left window, the search window processing submodule 521 process may specifically include: an image inputted first mirror, for example, 1.05 times, or 0.95 times the size of the zoom preset ratio downsizing like zoom, rotate, e.g. ± 10 degrees of a predetermined angle and the like; and the image input, as well as the scaling, the image after the rotation, an exhaustive search for a way to obtain a plurality of differently sized head window candidates; Finally, a number of candidates and then head window size of different sizes were normalized to give a predetermined standard size several candidates head window; in addition, as previously described, a user can arbitrarily set according to the actual situation of the monitoring head count valid representation of the scene sub-area within the count area only pre-and / or for counting the head size, in this case, the search window may be sub-module 521 according to the position of a preset step count of the sub-regions, the size and shape only 当前图像的部分前景区域中执行搜索,和/ 或在执行搜索时仅搜索符合预设人头尺寸的候选人头窗口; The current search is performed, and / or pre-candidate for head size head window when performing searches search only complies with Part foreground region of the image;

利用预先通过若干人头正样本和反样本训练得到的第一级分类器522, 用于从搜索得到的所有候选人头窗口分别抽取Haar微特征和灰度均值特征, 并根据抽取的Haar微特征和灰度均值特征对搜索得到的所有候选人头窗口进行第一级检测过滤;其中,第一级分类器522从每个候选人头窗口抽取的Harr微特征的种类数量可任意设定;Harr微特征中黑色区域或者白色区域的长、宽可以任意选择,只需不超过候选人头窗口的尺寸即可;Harr微特征中的位置也可任意选择; Using the first stage classifier 522 obtained previously by a number of positive samples and negative samples head training, all the candidates for the first search windows are obtained from micro- Haar features and extracted gray value features, and feature extraction in accordance with the micro-Haar tion mean feature of all candidates head window searched out in a first stage detection filter; wherein the number of kinds of micro-feature classifier Harr first stage 522 of each candidate extracted from the head window can be set arbitrarily; microfeature black Harr long white region or regions, a width can be arbitrarily selected, only the candidates can not exceed the size of the first window; microfeature Harr the position can be arbitrarily selected;

灰度归一化子模块523,用于对第一级检测过滤后剩余的候选人头窗口进行灰度归一化处理; Polar gradation normalization module 523, a detection filter after the first stage the remaining candidates head window gradation normalization processing;

利用预先通过若干人头正样本和反样本训练得到的第二级分类器524, 用于从灰度归一化处理后的所有候选人头窗口分别抽取Haar微特征,并根据抽取的Haar微特征对灰度归一化处理后的所有候选人头窗口进行第二级检测过滤;其中,第二级分类器524从每个候选人头窗口抽取的Harr微特征的种类数量可任意设定;Harr微特征中黑色区域或者白色区域的长、宽可以任意选择,只需不超过候选人头窗口的尺寸即可;Harr微特征中的位置也可任意选择; Using the second stage classifier 524 obtained previously by a number of positive samples and negative samples head training, all candidates for the head window from the gray normalized Haar was extracted from the micro-feature, and feature extraction in accordance with the micro-Haar ash All candidates of the normalized head window after a second stage detection processing filter; wherein the number of kinds of micro-feature Harr second stage classifier 524 extracted from the header of each candidate window can be set arbitrarily; microfeature black Harr long white region or regions, a width can be arbitrarily selected, only the candidates can not exceed the size of the first window; microfeature Harr the position can be arbitrarily selected;

窗口合并子模块525,用于将第二级检测过滤后剩余的所有候选人头窗口中,相邻的多个候选人头窗口进行合并;其中,这里所述的相邻可以是指:相互之间的尺寸差异小于预设尺寸差异阔值、和/或位置差异小于预设位置 The combined sub-window module 525, a second stage for detection filter after all remaining candidates head window, the plurality of adjacent windows merge candidates heads; wherein adjacent herein may refer to: relative to each other size difference is less than a predetermined size difference value width, and / or location difference is less than the preset position

差异阈值、和/或重叠面积大于预设重叠面积阈值;且,窗口合并子模块525 为可选的; Difference threshold, and / or the overlap area overlapping area greater than the preset threshold value; and, combined sub-window module 525 is optional;

相似性计算子模块526,用于计算合并得到的所有候选人头窗口与预设人头特征规则的相似性;其中,对于不包含窗口合并子模块525的情况,相似性计算子模块526可以计算第二级检测过滤后剩余的所有候选人头窗口与预设人头特征规则的相似性;且,相似性计算子模块526计算相似性的具体处理过程可以包括:先按照现有人脸检测中抽取轮廓点的方式,抽取候选人头窗口中的各轮廓点;然后利用现有的Sobel算子计算候选人头窗口中各轮廓点在X方向的边界值Wge —x 、以及在y方向的边界值ec/ge —此后,再 Similarity calculation sub-module 526, the similarity of all candidates with a predetermined head characteristics head window for calculating the combined rule obtained; wherein, in the case of combined sub-module does not include a window 525, the similarity calculation module 526 may calculate a second sub after filtration similarity level detector head window all remaining candidates with a predetermined head characteristics rule; and, the similarity calculation sub-module 526 calculates the similarity of the specific process may include: extracting contour points according to the conventional manner face detection extracting each contour point candidates head window; then using a conventional Sobel operator head window candidates calculated respective contour points in the boundary values ​​X direction Wge -x, and the boundary value in the y direction ec / ge - Thereafter, again

利用公式如ge — x)2+, j)2计算候选人头窗口中各轮廓点的边界幅度、利用公式arctan^^计算候选人头窗口中各轮廓点的边界方向;最后,计算 Using the formula as ge - x) 2+, j) 2 calculates the first candidate of each amplitude window boundary contour points, is calculated using equation arctan ^^ boundary direction of each contour point candidates head window; Finally, the

候选人头窗口中各轮廓点的边界幅度和边界方向与标准人头边界的各轮廓点的边界幅度和边界方向的相似性,得到候选人头窗口与预设人头特征规则 Border amplitude similarity and boundary direction and magnitude of the boundary in the boundary direction of each contour points with a standard head boundary contour point candidates of each window head, head window candidates obtained wherein the preset rule head

的相似性; Similarity;

结果判定子模块527,用于将相似性大于预设第一阈值的候选人头窗口确定为人头。 Result of the determination sub-module 527, for more than a preset similarity threshold candidates head window is determined as a first head.

对于如图5所示系统中的运动估计模块504,如果其基于本实施例方法部分所提供的像素匹配方式的工作原理实现运动估计,则该运动估计模块504将前一帧图像中的各人头与当前图像中各人头进行像素匹配,并根据像素匹配的人头在前一帧图像与当前图像中的位置差,估算出前一帧图像中各人头的平移矢量速度。 For the system shown in Figure 5 in a motion estimation module 504, which is achieved if the motion pixel matching based on the principle embodiment of the method of this embodiment estimates provided embodiment, the motion estimation module 504 of each head of the previous frame image each head matching the current image pixel, and pixel matching in accordance with the head of the previous frame image difference between the current position in the image, the translation vector estimated speed of the previous frame image of each head.

对于如图5所示系统中的预测跟踪模块505,如果其基于本实施例中方法部分所提供的基于位置匹配方式的工作原理来实现预测跟踪,则该预测跟踪模块505需要根据估算出的前一帧图像中各人头的平移矢量速度确定前一帧图像中各人头的预测跟踪位置,并将前一帧图像中各人头的预测跟踪位置与当前图像中各人头的实际位置进行匹配,以确定前一帧图像中各人头在当前图像中分别对应的人头、以及新出现在当前图像中的人头。 For the system shown in Figure 5 in the prediction tracking module 505, which is achieved if the prediction matches the position of the working principle of the embodiment according to the present embodiment, the tracking method based on the provided part, the prediction tracking module 505 according to the estimated required before translation vector for each head speed determination previous frame predicted head position of each track of one frame of image, and the previous frame image of each head tracking position prediction matches the actual position of the current image of each head in order to determine previous frame image corresponding to each head of each head in the current image, and a head emerging in the current image. 其中,如果前一帧图像中的任意人头,在当前图像中存在位置匹配的人头,则可确定前一帧图像中的该人头在当前图像中对应与其位置匹配的人头;如果前一帧图像中的任意人头,在当前图像中不存在位置匹配的人头,则确定前一帧图像中的该人头暂时消失;如果当前图像中的任意人头没有与之匹配的前一帧图像中的人头,则确定当前图像中的该人头为新出现在当前图像中的人头。 Wherein, if the head of any of the previous frame, the position of head matching exists in the current image, the previous frame image may be determined in the head corresponding to its position in the current image matching head; if the previous frame image any head, the head position of the matching does not exist in the current image, it is determined that the previous frame image in the temporary loss of head; previous frame if the current image is not the head of any match in the head, is determined the head of the current image as a new image appears in the current poll.

例如,预测跟踪模块505在前一帧图像中各人头的预测跟踪位置处设置相应的预测矩形框,并在当前图像中各人头的实际位置处设置相应的检测矩形框;然后分别计算各预测矩形框与每个检测矩形框的重叠面积,重叠面积越大,则表示对应的检测矩形框所在位置越有可能是该预测矩形框所对应人头在当前图像中的位置,因此,将与每个预测矩形框重叠面积最大的一个检测矩形框,分别确定为该预测矩形框位置匹配的检测矩形框,然后依据位置匹配的预测矩形框和检测矩形框,确定前一巾贞图像中各人头在当前图像中分别对应的人头。 For example, the prediction module 505 provided with a track in the previous frame image at the predicted head position of each track corresponding to a rectangular frame prediction, and the corresponding set of detecting the actual position of a rectangular frame at a head of each of the current image; and were calculated for each prediction rectangular the overlapping area of ​​each detected frame and a rectangular frame, the greater the overlap area, said rectangular frame corresponding to the position where the detection is more likely to be the predicted head position of the rectangular frame in the current image corresponds, therefore, predicted to each largest rectangle overlapping a rectangular frame detection, respectively, for determining the predicted position matching rectangular frame detection rectangle, then based on the detection and prediction rectangular frame matches the position of a rectangular frame, determining a previous image of each head Zhen towel in the current image respectively corresponding heads. 即,预测跟踪模块505将与前一帧图像中每个人头的预测矩形框重叠面积最大的检测矩形框所对应的当前图像中的人头,分别确定为前一帧图像中人头的在当前图像中分别对应的人头;预测跟踪模块505将当前图像中,未在前一帧图像中找到重叠预测矩形框的检测矩形框所对应的人头,确定为在当前图像中新出现的人头。 That is, the tracking module 505 to predict the current image and the previous frame image prediction rectangular frame head of each area of ​​overlap the largest rectangular frame corresponding to the detection of the head, are determined to be the head in front of an image in the current image respectively corresponding to the head; tracking module 505 to predict the current image, a first image is found not to overlap the rectangular frame prediction rectangular frame corresponding to the detection head, is determined as a head emerging in the current image.

此外,前一帧图像中的每个人头通常只能对应一个检测矩形框, 一个检测矩形框通常也只能对应前一帧图像中的一个人头。 In addition, the previous frame image of each detection head generally corresponds to only one rectangle, a rectangle is generally a head corresponding to only the previous frame image is detected. 那么如前一帧图像中的某个人头未对应任何一个检测矩形框、即该人头的预测矩形框与当前图像中的所有监测矩形框均无重叠,则预测跟踪模块505认为前一帧图像中的该人头在当前图像中暂时消失。 Then, as in the previous frame does not correspond to any of a head detected a rectangular frame, i.e. the head of the rectangular frame prediction and monitoring of all the rectangular frame overlaps no current image, the tracking module 505 that prediction before an image the head of the temporary loss in the current image. 但是,在本实施例中并不立即删除该人头、而是仍然跟踪前一帧图像中的该人头,在将后续的每帧图像作为当前图像执行本步骤时,根据该人头的平移速度继续更新该人头的预测矩形框,如连续P帧图像中该预测矩形都没重叠的检测矩形框,P为大于l的正整数,再确定该 However, in the present embodiment, the head does not immediately deleted, but still a track before the head image, when the image of each subsequent frame as the current picture performed in this step, continue to update the translation speed of the head the head of the rectangular frame prediction, such as continuous P frame images did not overlap the predicted detection rectangular rectangular frame, P is a positive integer greater than l, and then determine the

31人头已经消失,否则认为该人头重新出现。 31 head has disappeared, or that the re-emergence of the head.

对于如图5所示系统中的数量确定模块506,如何确定当前图像中的人数,可以根据监控场景的实际情况和需要来任意设定。 For the system shown in Figure 5 in number determination module 506, how to determine the number of current image, according to the actual situation and the need to monitor the scene arbitrarily set. 具体请参见方法部分所举的实例,例如数量确定模块506可进一步根据所述运动估计模块得到的平移矢量速度,分别确定当前图像中在不同运动方向的人数,其他所有可能的实例在此不再赘述。 See Methods Specific examples cited, for example, module 506 may further determine the number according to the translational speed of the motion vector estimation module obtained were determined in a number of different current image in the direction of movement, all other possible examples which are not repeat.

需要说明的是,较佳地,为了避免虚景,数量确定模块506确定的当前图像中的人数仅包括:在连续N帧图像中均出现的人头的数量,其中,N为大于等于2的正整数;且,可选地,用户可根据监控场景的实际情况任意设置用于表示仅对该区预内人头计数有效的计数子区域,那么此时,数量确定模块506所确定的当前图像中的人数仅为预设计数子区域的位置、尺寸和形状内的人头数量。 Note that, preferably, in order to avoid the virtual scene, the number of the current image to determine the number of module 506 determines only includes: N number of head in successive frames appear in both images, wherein, N is greater than or equal to positive 2 integer; and, optionally, the user may arbitrarily set according to the actual situation of the monitoring head count valid representation of the scene sub-area within the count area only pre, then the time number determination module 506 determines the current image in only counting the number of sub-regions of the preset position, size and number of the head shape.

当然,对于基于如图7所示结构的人头检测模块502,数量确定模块506 所确定的当前图像中的人数仅包括:在连续N帧图像中均出现、且在连续N 巾贞图像中的所述相似性总合大于预设第二阈值的人头的数量,其中,N为大于等于2的正整数。 Of course, based on the structure of the head detection module 502 shown in FIG. 7, the number of the current image to determine the number of the determined module 506 includes only: are present at N successive image frames and the N continuous towel image Zhen the number of said head is greater than the sum of the similarity preset second threshold value, wherein, N is a positive integer greater than or equal to 2.

以上所述仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。 The above are only preferred embodiments of the present invention but are not intended to limit the scope of the present invention. 凡在本发明的精神和原则之内,所作的任何修改、等同替换以及改进等, 均应包含在本发明的保护范围之内。 Within the spirit and principle of the present invention, any modifications, equivalent substitutions and improvements should be included within the scope of the present invention.

Claims (20)

1、一种基于视频监控的人数统计方法,其特征在于,该方法包括:a1、在当前图像中进行人头检测,确定当前图像中的各人头;a2、利用当前图像、以及当前图像中各人头的位置,估算出前一帧图像中各人头的平移矢量速度;a3、根据前一帧图像中各人头的平移矢量速度,对前一帧图像中各人头进行预测跟踪,确定前一帧图像中各人头在当前图像中分别对应的人头,同时还确定新出现在当前图像中的人头、以供对下一帧图像执行所述步骤a2和a3时使用;a4、根据前一帧图像中各人头的数量、和/或前一帧图像中各人头在当前图像中分别对应的人头的数量,确定当前图像中的人数。 A statistical method based on the number of video surveillance, characterized in that the method comprises: a1, the current image in the detection head, each head is determined in the current image; A2, using the current image and the current image of each head position, estimated translation vector speed of the previous frame image of each head in; A3, the previous frame image is a translation vector velocity of each head, the previous frame image of each head forecast track, determining a previous frame image of each head respectively in the current image corresponding to the head, also identified in the current image head emerging, for use on the next frame and when said step a2 a3; a4, according to the previous frame image of each head number, the head number and / or the previous frame respectively corresponding to each head in the current image, determine the number of the current image.
2、 如权利要求l所述的方法,其特征在于,所述步骤al之前,该方法进一步包括:a0、利用前一帧图像的背景区域,从当前图像中检测包含运动物体的前景区域;且,所述步骤al中仅在当前图像的前景区域中检测人头。 2. The method of claim l, wherein, prior to said step Al, the method further comprising: a0, using the background region of the previous frame image is detected from the current image of the moving object comprises a foreground area; and said step of detecting al head only when the current foreground area of ​​the image.
3、 如权利要求2所述的方法,其特征在于,从当前图像中检测包含运动物体的前景区域之后,所述步骤aO进一步包括:a01、将前一帧图像中的各运动物体与当前图像中各运动物体进行像素匹配,并根据像素匹配的运动物体在前一帧图像与当前图像中的位置差,估算出前一帧图像中各运动物体的平移矢量速度;a02、根据估算出的前一帧图像中各运动物体的平移矢量速度确定前一帧图像中各运动物体的预测跟踪位置,并将前一帧图像中各运动物体的预测跟踪位置与当前图像中各运动物体的实际位置进行匹配,以确定前一帧图像中各运动物体在当前图像中分别对应的运动物体、以及新出现在当前图像中的运动物体;a03、将当前图像中在前几帧图像中均未移动的运动物体设置为当前图像的背景,以供从下一帧图像中检测包含运动物体的前景区域时使用。 3. The method of claim 2, characterized in that, after the foreground region including the moving object detected from the image current, said step aO further comprises: a01, each moving object in the previous frame image and the current image each moving object pixel matching, and according to the pixel matching the moving object in the previous frame image and the image position difference between the current estimate the previous frame in a translation vector velocity of each moving object; A02, according to the previous estimate of translation vector to determine the speed of each moving object in the previous frame predicted track the position of each moving object in the frame image and the previous frame picture predicted track the position of each moving object matched with the current actual position of the image of each moving object to determine the previous frame image of each moving object corresponding to each moving object in the current image, and the new image appears in the current moving object; A03, the current frame image in the previous few images of moving objects moving none background to the current image, for use when detecting foreground region including the moving object from the next frame image.
4、 如权利要求2所迷的方法,其特征在于,所述步骤al包括: all、在当前图像的前景区域中搜索得到候选人头窗口;a12、利用预先通过若干人头正样本和反样本训练得到的第一级分类器, 从搜索得到的所有候选人头窗口分别抽取Haar微特征和灰度均值特征,并根据抽取的Haar微特征和灰度均值特征对搜索得到的所有候选人头窗口进行第一级检测过滤;a13、对第一级检测过滤后剩余的候选人头窗口进行灰度归一化处理; a14、利用预先通过若干人头正样本和反样本训练得到的第二级分类器, 从灰度归一化处理后的所有候选人头窗口分别抽取Haar微特征,并根据抽取的Haar微特征对灰度归一化处理后的所有候选人头窗口进行第二级检测过滤;a15、将第二级检测过滤后剩余的所有候选人头窗口中,相邻的多个候选人头窗口进行合并;a16、计算合并得到的所有候 4. A method as claimed in claim 2 fans, wherein said step al comprises: all, in the current foreground area of ​​the image obtained in search head window candidates; A12, obtained by using a predetermined plurality of positive samples and negative samples head training a first classifier stage, all the candidates obtained from the search head window was extracted from micro-Haar features and gray value features, and all candidates for the first stage obtained by the search head window micro Haar feature extraction and feature gray value detection filter; A13, after the first filter stage the remaining candidate detection window head gradation normalization processing; A14, using a second-class classifier head previously obtained through several positive samples and counterexample training samples, from the normalized grayscale a head window of all candidates are treated Haar micro extraction features, and a second stage of filtering all candidates detection head window gradation normalization processing in accordance with the micro-Haar feature extraction; A15, the second detection stage filter All candidates remaining after the first window, the plurality of adjacent windows heads merge candidates; A16, calculating all candidates obtained combined 选人头窗口与预设人头特征规则的相似性; a17、将相似性大于预设第一阈值的候选人头窗口确定为人头。 Head window is selected and a preset similarity head characteristic rules; a17, the similarity is greater than a first predetermined threshold value is determined as the candidate window header head.
5、 如权利要求4所述的方法,其特征在于,所述步骤all中,按照预设计数子区域的位置、尺寸和形状仅在当前图像的部分前景区域中执行所述搜索,和/或在执行所述搜索时仅搜索预设人头尺寸的候选人头窗口。 5. The method as claimed in claim 4, wherein said step of all, the preset count sub-area location, size and shape of the search is performed only in the current section of the foreground region of the image, and / or Search only pre-poll dimension of the candidates head window when performing the search.
6、 如权利要求1至5中任一项所述的方法,其特征在于,所述步骤a2 包括:将前一帧图像中的各人头与当前图像中各人头进行像素匹配,并根据像素匹配的人头在前一帧图像与当前图像中的位置差,估算出前一帧图像中各人头的平移矢量速度。 6. The method of claim 1 to 5 according to any one of claims, wherein said step a2 comprises: each head of the previous frame image and a current image pixel to match each head, and according to the pixel matching poll the previous frame image and the difference between the current position in the image, the translation vector estimated speed of the previous frame image of each head.
7、 如权利要求1至5中任一项所述的方法,其特征在于,所述步骤a3 包括:根据估算出的前一帧图像中各人头的平移矢量速度确定前一帧图像中各人头的预测跟踪位置,并将前一帧图像中各人头的预测跟踪位置与当前图像中各人头的实际位置进行匹配,以确定前一帧图像中各人头在当前图像中分别对应的人头、以及新出现在当前图像中的人头。 7. The method of claim 1 to 5 according to any one of claims, wherein said step a3 comprises: determining a previous frame image of each head in accordance with the speed of the translation vector estimated before an image of each head It predicted track position and the previous frame image of each head in the track position and the prediction image of the current actual position of each head matching, to determine the previous frame respectively corresponding to each head in the current image the head, and the new head in the current image appears.
8、 如权利要求1至5中任一项所述的方法,其特征在于,在所述步骤a4中,所确定的当前图像中的人数仅包括:在连续N帧图像中均出现的人头的数量,其中,N为大于等于2的正整数;和/或,所确定的当前图像中的人数仅为预设计数子区域的位置、尺寸和形状内的人数。 8. A method as claimed in any one of claims 1 to 5, wherein, in the step a4, the number of the current image in the determined only include: head in N successive frames of the image appearing in both number, where, N is a positive integer greater than or equal to 2; and / or number of the current image of only the determined preset count sub-area location, size and number of the shape.
9、 如权利要求4所述的方法,其特征在于,在所述步骤a4中,所确定的当前图像中的人数仅包括:在连续N帧图像中均出现、且在连续N帧图像中的所述相似性总合大于预设第二阈值的人头的数量,其中,N为大于等于2的正整数。 9. A method as claimed in claim 4, wherein, in the step a4, the number of the current image determined includes only: all occur in a contiguous frame image N and the frame image N successive the number of head of the similarity is greater than the sum of the preset second threshold value, wherein, N is a positive integer greater than or equal to 2.
10、 如权利要求1至5中任一项所述的方法,其特征在于,在所述步骤a4中,进一步根据所述步骤a2得到的平移矢量速度,分别确定当前图像中在不同运动方向的人数。 10. A method as claimed in any one of claims 1 to 5, wherein, in the step a4, further accordance with the speed of the translation vector obtained in step a2, different motion directions are determined in the current image number.
11、 一种基于视频监控的人数统计系统,其特征在于,包括: 人头检测模块,用于在当前图像中进行人头检测,确定当前图像中的各人头;图像存储模块,用于存储前一帧图像、以及表示前一帧图像中各人头的人头检测结果;运动估计模块,用于利用当前图像、以及当前图像中各人头的位置,估算出前一帧图像中各人头的平移矢量速度;预测跟踪模块,用于根据前一帧图像中各人头的平移矢量速度,对前一帧图像中各人头进行预测跟踪,确定前一帧图像中各人头在当前图像中分别对应的人头,同时还确定新出现在当前图像中的人头、以供所述速度估计模块和所述预测跟踪模块处理下一帧图像时使用;数量确定模块,用于根据前一帧图像中各人头的数量、和/或前一帧图像中各人头在当前图像中分别对应的人头的数量,确定当前图像中的人数。 11, people counting system based on a video monitor, characterized by, comprising: a head detection module for detecting head in the current image, determining each of the head current image; an image storage module for storing a previous frame image, and denote the previous frame image head to detect the head of the result; motion estimation module, for using the current image, and the image in the current position of each head, the estimated translation vector speed of the previous frame image of each head; a predictive tracking module, for the previous frame image speed of each head of a translation vector, the image of the previous frame to predict the track of each head, determining a previous frame image corresponding to each head in the current image the head, also identified a new It appears in the current image of the head, for the velocity estimation module and a tracking module using said prediction image for the next frame; number determining module configured according to the number of each head of the previous frame image, and / or before a head picture number respectively corresponding to each head in the current image, determine the number of the current image.
12、 如权利要求11所述的系统,其特征在于,该系统进一步包括:前景检测模块,用于利用前一帧图像的背景区域,从当前图像中检测包含运动物体的前景区域;且,所述人头检测模块仅在当前图像的前景区域中检测人头。 12. The system as claimed in claim 11, characterized in that the system further comprises: a detection module prospects for utilizing the background region of the previous frame image from the current image containing the foreground area detected moving object; and, the said head detection module detects only the head region of the current foreground image.
13、 如权利要求12所述的系统,其特征在于,所述前景检测模块包括: 前景提取子模块,用于从当前图像中检测包含运动物体的前景区域;且,所述前景检测模块进一步包括:运动估计子模块,用于将前一帧图像中的各运动物体与当前图像中各运动物体进行像素匹配,并根据像素匹配的运动物体在前一帧图像与当前图像中的位置差,估算出前一帧图像中各运动物体的平移矢量速度;预测跟踪子模块,用于根据估算出的前一帧图像中各运动物体的平移矢量速度确定前一帧图像中各运动物体的预测跟踪位置,并将前一帧图像中各运动物体的预测跟踪位置与当前图像中各运动物体的实际位置进行匹配,以确定前一帧图像中各运动物体在当前图像中分別对应的运动物体、以及新出现在当前图像中的运动物体;背景更新子模块,用于将当前图像中在前几帧图 13. The system as claimed in claim 12, wherein said foreground detection module comprising: foreground extracting sub-module, for foreground region including the moving object detected from the image current; and, the detection module further comprises a foreground : a motion estimation sub-module, for each of the moving object in the previous frame pixel match each moving object in the current image and the previous frame image and the difference between the current position in the image according to the pixel matching the moving object estimated a previous frame in a translation vector velocity of each moving object; prediction tracking sub-module, for determining a prediction track of the previous frame image of each moving object according to the position translation vector velocity before an estimated image of each moving object, and the previous frame predicted position of each moving object tracking with the current actual position of the image of each moving object matching, to determine the previous frame image of each moving object corresponding to each moving object in the current image, as well as emerging in the current moving object in the image; background update sub-module, for the first few frames in the current image of FIG. 中均未移动的运动物体设置为当前图像的背景,以供所述前景提取子模块从下一帧图像中检测包含运动物体的前景区域时使用。 No moving object in the moving image as the background current, for use by the foreground extracting sub-module when using the region containing the foreground moving object is detected from the next frame image.
14、 如权利要求12所述的系统,其特征在于,所述人头检测模块包括: 窗口搜索子模块,用于在当前图像的前景区域中搜索得到候选人头窗口;利用预先通过若干人头正样本和反样本训练得到的第一级分类器,用于从搜索得到的所有候选人头窗口分别抽取Haar微特征和灰度均值特征,并根据抽取的Haar微特征和灰度均值特征对搜索得到的所有候选人头窗口进行第一级才企测过滤;灰度归一化子模块,用于对第一级检测过滤后剩余的候选人头窗口进行灰度归一化处理;利用预先通过若干人头正样本和反样本训练得到的第二级分类器,用于从灰度归一化处理后的所有候选人头窗口分别抽取Haar微特征,并根据抽取的Haar微特征对灰度归一化处理后的所有候选人头窗口进行第二级检测过滤;窗口合并子模块,用于将第二级检测过滤后剩余的所有候选人头窗口中 14. The system as claimed in claim 12, wherein said head detecting module comprising: a sub-window search module for searching for candidates obtained in the current foreground window head region of the image; by using a predetermined plurality of positive samples and the head anti training samples obtained first-stage classifier, for all candidates from the search head window obtained was extracted from micro-Haar features and gray value features, and micro-obtained search according Haar feature extraction and gray value of all the candidate features a first stage head window filter was measured half; Polar gradation normalization module for the first stage after the remaining candidate detection filter head window gradation normalization processing; by using a predetermined plurality of positive samples and counterexample head training samples obtained second-stage classifier, for all candidates from the head window gradation normalization processing are decimated micro Haar features, and all candidates for the first gradation after the normalization processing in accordance with the micro-feature extraction Haar second level detection window filter; windows merge all candidates head sub-module, configured to detect the second level after filtration of the remaining ,相邻的多个候选人头窗口进行合并;相似性计算子模块,用于计算合并得到的所有候选人头窗口与预设人头特征规则的相似性;结果判定子模块,用于将相似性大于预设第一阈值的候选人头窗口确定为人头。 , The plurality of adjacent windows merge candidates head; similarity calculating submodule, calculating the similarity of all candidates for the first window and the predetermined head characteristics combined rule obtained; result of the determination sub-module, for greater than a predetermined similarity the first window candidate set threshold value is determined as a first head.
15、 如权利要求14所述的系统,其特征在于,所述窗口搜索子模块按照预设计数子区域的位置、尺寸和形状仅在当前图像的部分前景区域中执行所述搜索,和/或在执行所述搜索时仅搜索预设人头尺寸的候选人头窗口。 15. The system as claimed in claim 14, wherein the search window according to a preset count sub-module sub-area location, size and shape of the search is performed only in the current section of the foreground region of the image, and / or Search only pre-poll dimension of the candidates head window when performing the search.
16、 如权利要求11至15中任一项所述的系统,其特征在于,所述运动估计模块将前一帧图像中的各人头与当前图像中各人头进行像素匹配,并根据像素匹配的人头在前一帧图像与当前图像中的位置差,估算出前一帧图像中各人头的平移矢量速度。 16, 11 to the system 15 as claimed in any one of claims, wherein the motion estimation module in the previous frame for each pixel matches the current head of each head image, and according to the pixel matching preceding a head image and a position difference between the current image, the translation vector estimated speed of the previous frame image of each head.
17、 如权利要求11至15中任一项所述的系统,其特征在于,所述预测跟踪模块根据估算出的前一帧图像中各人头的平移矢量速度确定前一帧图像中各人头的预测跟踪位置,并将前一帧图像中各人头的预测跟踪位置与当前图像中各人头的实际位置进行匹配,以确定前一帧图像中各人头在当前图像中分别对应的人头、以及新出现在当前图像中的人头。 17, 11 to the system as claimed in any one of claim 15, characterized in that said prediction tracking module determines that the previous frame image of each head in accordance with the speed of the translation vector estimated before an image of each head predicted track position and the previous frame image of each head tracking position predicted image matches the actual current position of each head to determine the previous frame respectively corresponding to each head in the current image the head, as well as emerging in the poll in the current image.
18、 如权利要求11至15中任一项所述的系统,其特征在于,所述数量确定模块所确定的当前图像中的人数仅包括:在连续N帧图像中均出现的人头的数量,其中,N为大于等于2的正整数;和/或,所确定的当前图像中的人数仅为预设计数子区域的位置、尺寸和形状内的人数。 18. The system of claim 11 to 15 according to any one of claims, wherein said number to determine the number of the current image block includes only determined: the number of consecutive N frames appearing in both images of the head, wherein, N is a positive integer greater than or equal to 2; and / or number of the current image of only the determined preset count sub-area location, size and number of the shape.
19、 如权利要求14所述的系统,其特征在于,所述数量确定模块所确定的当前图像中的人数仅包括:在连续N帧图像中均出现、且在连续N帧图像中的所述相似性总合大于预设第二阈值的人头的数量,其中,N为大于等于2的正整数。 19. The system of claim 14, wherein said quantity is determined the number of the current image block includes only determined: N successive frames are present in the image, and the image in successive frames of N the total number of combined similarity head greater than a preset second threshold, wherein, N is a positive integer greater than or equal to 2.
20、如权利要求11至15中任一项所述的系统,其特征在于,所述数量确定模块进一步根据所述运动估计模块得到的平移矢量速度,分别确定当前图像中在不同运动方向的人数。 20. The system of claim 11 to 15 according to any one of claims, wherein said determination module is further in accordance with the number of the speed of the translational motion vector estimation module obtained were determined in a number of different current image in the direction of movement .
CN 200910076256 2009-01-07 2009-01-07 Demographic method and system based on video monitoring CN101477641A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200910076256 CN101477641A (en) 2009-01-07 2009-01-07 Demographic method and system based on video monitoring

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200910076256 CN101477641A (en) 2009-01-07 2009-01-07 Demographic method and system based on video monitoring

Publications (1)

Publication Number Publication Date
CN101477641A true CN101477641A (en) 2009-07-08

Family

ID=40838350

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200910076256 CN101477641A (en) 2009-01-07 2009-01-07 Demographic method and system based on video monitoring

Country Status (1)

Country Link
CN (1) CN101477641A (en)

Cited By (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101794382A (en) * 2010-03-12 2010-08-04 华中科技大学 Method for counting passenger flow of buses in real time
CN101847206A (en) * 2010-04-21 2010-09-29 北京交通大学 Pedestrian traffic statistical method and system based on traffic monitoring facilities
CN101872414A (en) * 2010-02-10 2010-10-27 杭州海康威视软件有限公司 People flow rate statistical method and system capable of removing false targets
CN101872422A (en) * 2010-02-10 2010-10-27 杭州海康威视软件有限公司 People flow rate statistical method and system capable of precisely identifying targets
CN101872431A (en) * 2010-02-10 2010-10-27 杭州海康威视软件有限公司 People flow rate statistical method and system applicable to multi-angle application scenes
CN102063613A (en) * 2010-12-28 2011-05-18 北京智安邦科技有限公司 People counting method and device based on head recognition
WO2011097795A1 (en) * 2010-02-10 2011-08-18 杭州海康威视软件有限公司 Method and system for population flow statistics
CN102324016A (en) * 2011-05-27 2012-01-18 殷绪成 Statistical method for high-density crowd flow
CN102364944A (en) * 2011-11-22 2012-02-29 电子科技大学 Video monitoring method for preventing gathering of people
GB2483916A (en) * 2010-09-27 2012-03-28 Vivid Intelligent Solutions Ltd Counting individuals entering/leaving an area by classifying characteristics
CN103049787A (en) * 2011-10-11 2013-04-17 汉王科技股份有限公司 People counting method and system based on head and shoulder features
CN103077423A (en) * 2011-10-25 2013-05-01 中国科学院深圳先进技术研究院 Crowd quantity estimating, local crowd clustering state and crowd running state detection method based on video stream
CN103150552A (en) * 2013-02-06 2013-06-12 湖北微驾技术有限公司 Driving training management method based on people counting
CN103474010A (en) * 2013-09-22 2013-12-25 广州中国科学院软件应用技术研究所 Video analysis-based intelligent playing method and device of outdoor advertisement
CN103646254A (en) * 2013-12-19 2014-03-19 北方工业大学 High-density pedestrian detection method
CN103839308A (en) * 2012-11-26 2014-06-04 中兴通讯股份有限公司 Population obtaining method, device and system
CN104063692A (en) * 2014-06-30 2014-09-24 武汉烽火众智数字技术有限责任公司 Method and system for pedestrian positioning detection
CN104123776A (en) * 2014-07-31 2014-10-29 上海汇纳信息科技股份有限公司 Object statistical method and system based on images
CN105631515A (en) * 2014-09-30 2016-06-01 广达电脑股份有限公司 People counting system
CN105809183A (en) * 2014-12-31 2016-07-27 深圳中兴力维技术有限公司 Video-based human head tracking method and device thereof
CN106372566A (en) * 2015-07-23 2017-02-01 深圳市飞思未来云媒体科技有限公司 Digital signage-based emergency evacuation system and method
CN107292297A (en) * 2017-08-09 2017-10-24 电子科技大学 Video vehicle flow detection method based on deep learning and overlapping ratio tracking

Cited By (33)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8798327B2 (en) 2010-02-10 2014-08-05 Hangzhou Hikvision Digital Technology Co., Ltd. Method and system for people flow statistics
CN101872414B (en) 2010-02-10 2012-07-25 杭州海康威视软件有限公司 People flow rate statistical method and system capable of removing false targets
CN101872414A (en) * 2010-02-10 2010-10-27 杭州海康威视软件有限公司 People flow rate statistical method and system capable of removing false targets
CN101872422A (en) * 2010-02-10 2010-10-27 杭州海康威视软件有限公司 People flow rate statistical method and system capable of precisely identifying targets
CN101872431A (en) * 2010-02-10 2010-10-27 杭州海康威视软件有限公司 People flow rate statistical method and system applicable to multi-angle application scenes
EP2535843A4 (en) * 2010-02-10 2016-12-21 Hangzhou Hikvision Digital Tec Method and system for population flow statistics
WO2011097795A1 (en) * 2010-02-10 2011-08-18 杭州海康威视软件有限公司 Method and system for population flow statistics
CN101794382A (en) * 2010-03-12 2010-08-04 华中科技大学 Method for counting passenger flow of buses in real time
CN101847206A (en) * 2010-04-21 2010-09-29 北京交通大学 Pedestrian traffic statistical method and system based on traffic monitoring facilities
CN101847206B (en) 2010-04-21 2012-08-08 北京交通大学 Pedestrian traffic statistical method and system based on traffic monitoring facilities
GB2483916A (en) * 2010-09-27 2012-03-28 Vivid Intelligent Solutions Ltd Counting individuals entering/leaving an area by classifying characteristics
CN102063613A (en) * 2010-12-28 2011-05-18 北京智安邦科技有限公司 People counting method and device based on head recognition
CN102063613B (en) 2010-12-28 2012-12-05 北京智安邦科技有限公司 People counting method and device based on head recognition
CN102324016A (en) * 2011-05-27 2012-01-18 殷绪成 Statistical method for high-density crowd flow
CN103049787A (en) * 2011-10-11 2013-04-17 汉王科技股份有限公司 People counting method and system based on head and shoulder features
CN103049787B (en) * 2011-10-11 2015-11-25 汉王科技股份有限公司 Based on the number of features the head and shoulders of statistical methods and systems
CN103077423A (en) * 2011-10-25 2013-05-01 中国科学院深圳先进技术研究院 Crowd quantity estimating, local crowd clustering state and crowd running state detection method based on video stream
CN103077423B (en) * 2011-10-25 2015-09-30 中国科学院深圳先进技术研究院 Based on the estimated number of people in the video stream, the local population and crowded state running state detection method
CN102364944A (en) * 2011-11-22 2012-02-29 电子科技大学 Video monitoring method for preventing gathering of people
US9824460B2 (en) 2012-11-26 2017-11-21 Xi'an Zhongxing New Software Co.Ltd. Method, apparatus and system for acquiring headcount
CN103839308A (en) * 2012-11-26 2014-06-04 中兴通讯股份有限公司 Population obtaining method, device and system
CN103150552A (en) * 2013-02-06 2013-06-12 湖北微驾技术有限公司 Driving training management method based on people counting
CN103474010A (en) * 2013-09-22 2013-12-25 广州中国科学院软件应用技术研究所 Video analysis-based intelligent playing method and device of outdoor advertisement
CN103646254A (en) * 2013-12-19 2014-03-19 北方工业大学 High-density pedestrian detection method
CN103646254B (en) * 2013-12-19 2017-01-25 北方工业大学 A high-density pedestrian detection method
CN104063692A (en) * 2014-06-30 2014-09-24 武汉烽火众智数字技术有限责任公司 Method and system for pedestrian positioning detection
CN104123776A (en) * 2014-07-31 2014-10-29 上海汇纳信息科技股份有限公司 Object statistical method and system based on images
CN104123776B (en) * 2014-07-31 2017-03-01 上海汇纳信息科技股份有限公司 Image of an object-based statistical method and system
CN105631515A (en) * 2014-09-30 2016-06-01 广达电脑股份有限公司 People counting system
CN105631515B (en) * 2014-09-30 2018-03-23 广达电脑股份有限公司 Flow counting system
CN105809183A (en) * 2014-12-31 2016-07-27 深圳中兴力维技术有限公司 Video-based human head tracking method and device thereof
CN106372566A (en) * 2015-07-23 2017-02-01 深圳市飞思未来云媒体科技有限公司 Digital signage-based emergency evacuation system and method
CN107292297A (en) * 2017-08-09 2017-10-24 电子科技大学 Video vehicle flow detection method based on deep learning and overlapping ratio tracking

Similar Documents

Publication Publication Date Title
CN101142593B (en) Method of tracking objects in a video sequence
US7801330B2 (en) Target detection and tracking from video streams
CA2692424C (en) System and process for detecting, tracking and counting human objects of interest
Gutchess et al. A background model initialization algorithm for video surveillance
US7167576B2 (en) Method and apparatus for measuring dwell time of objects in an environment
Ihaddadene et al. Real-time crowd motion analysis
US7796780B2 (en) Target detection and tracking from overhead video streams
Davis et al. A two-stage template approach to person detection in thermal imagery
US8139817B2 (en) Face image log creation
JP3812985B2 (en) Automatic monitoring equipment
US20050244033A1 (en) System and method for assuring high resolution imaging of distinctive characteristics of a moving object
Dick et al. Issues in automated visual surveillance
Xing et al. Multi-object tracking through occlusions by local tracklets filtering and global tracklets association with detection responses
JPWO2010098024A1 (en) Person tracking device and person tracking program
Albiol et al. Video analysis using corner motion statistics
US20070098222A1 (en) Scene analysis
US20060083423A1 (en) Method and apparatus for object normalization using object classification
US7787656B2 (en) Method for counting people passing through a gate
EP1426898A2 (en) Human detection through face detection and motion detection
US8345921B1 (en) Object detection with false positive filtering
US7110569B2 (en) Video based detection of fall-down and other events
US20060170769A1 (en) Human and object recognition in digital video
US8837776B2 (en) Rule-based combination of a hierarchy of classifiers for occlusion detection
US7646401B2 (en) Video-based passback event detection
US7003135B2 (en) System and method for rapidly tracking multiple faces

Legal Events

Date Code Title Description
C06 Publication
C10 Request of examination as to substance
C41 Transfer of the right of patent application or the patent right
COR Bibliographic change or correction in the description

Free format text: CORRECT: ADDRESS; FROM: 100083 HAIDIAN, BEIJING TO: 550081 GUIYANG, GUIZHOU PROVINCE

ASS Succession or assignment of patent right

Owner name: GUIYANG VIMICRO ELECTRONICS CO., LTD.

Free format text: FORMER OWNER: BEIJING VIMICRO CORPORATION

Effective date: 20121106

C12 Rejection of an application for a patent