视频监控方法、视频监控系统以及计算机程序产品Video monitoring method, video monitoring system, and computer program product
技术领域Technical field
本公开涉及视频监控领域,更具体地,本公开涉及视频监控方法、视频监控系统以及计算机程序产品。The present disclosure relates to the field of video surveillance, and more particularly, to video surveillance methods, video surveillance systems, and computer program products.
背景技术Background technique
目前的视频监控往往依赖于工作人员人工的检测和处理。因此,虽然很多场景有摄像头覆盖,但是由于没有智能视频监控方法,所以需要大量人力来进行处理和监视。并且,当监控摄像头的覆盖规模变大后,很难高效地处理和反应一些突发事件。Current video surveillance often relies on manual detection and processing by staff. Therefore, although many scenes have camera coverage, since there is no intelligent video monitoring method, a large amount of manpower is required for processing and monitoring. Moreover, when the coverage of the surveillance camera becomes large, it is difficult to efficiently process and react to some emergencies.
智能视频监控可以根据摄像头的视频数据,自动地对场景中的人群密度做出估计,实时监控视频场景中的人流、车流量变化。智能监控有着非常广泛的应用环境,比如从城市安全的角度来讲,通过对人群密度的监控,在人群密度过大的时候可以给出报警,及时进行处理,避免一些可能的突发状况。对城市公路的车数进行统计,可以实时给出拥挤状况,给司机的出行提出建议。对商场的人流量统计,可以智能地给商家提供一些消费建议和分析。Intelligent video surveillance can automatically estimate the density of people in the scene according to the video data of the camera, and monitor the flow of people and traffic in the video scene in real time. Intelligent monitoring has a very wide application environment. For example, from the perspective of urban security, by monitoring the density of the crowd, when the crowd density is too large, an alarm can be given and processed in time to avoid some possible emergencies. Statistics on the number of cars on urban roads can give crowded status in real time and make recommendations for drivers' travel. For the traffic statistics of the mall, you can intelligently provide some consumer suggestions and analysis.
已知的智能人流监控方法主要有两种途径。第一种是依赖于行人检测算法,但是其对高密度人流区域或者遮挡比较严重的情况,统计数据不够精确,另外行人检测算法本身比较耗时,很难达到实时监控的目的。另一种途径是独立于行人,对当前图像提取一些特征(比如边缘,纹理等等),根据这些特征以及一些训练数据进行回归分析,从而得到当前区域的行人数量。此类方法的精度往往比较低。对行人密度比较大的时候,效果可以接受,但是当行人数目减少时,误差会很大。另外,单一回归的方法很难区分行人和车,所以应用场景很受限。There are two main approaches to the known intelligent flow monitoring methods. The first one relies on the pedestrian detection algorithm, but its statistical data is not accurate enough for high-density flow areas or occlusions. In addition, the pedestrian detection algorithm itself is time-consuming and difficult to achieve real-time monitoring. Another way is to extract some features (such as edges, textures, etc.) from the current image independently of the pedestrians, and perform regression analysis based on these features and some training data to obtain the number of pedestrians in the current region. The accuracy of such methods tends to be low. When the pedestrian density is relatively large, the effect is acceptable, but when the number of pedestrians decreases, the error will be large. In addition, the single regression method is difficult to distinguish between pedestrians and cars, so the application scenario is very limited.
发明内容Summary of the invention
鉴于上述问题而提出了本公开。本公开提供了一种基于深度视频的视频监控方法、视频监控系统以及计算机程序产品,其能实时地对当前场景中的人群密度、车流量、以及过线的人流数量进行准确的统计和分析。The present disclosure has been made in view of the above problems. The present disclosure provides a video monitoring method based on depth video, a video monitoring system, and a computer program product, which can accurately calculate and analyze the population density, the traffic volume, and the number of people flowing in the current scene in real time.
根据本公开的一个实施例,提供了一种视频监控方法,包括:获取经由
视频数据采集装置采集的视频数据;以及基于预先设置的场景信息和所述视频数据,执行与所述场景信息相对应的用于监控的场景中的监控对象的确定和统计。According to an embodiment of the present disclosure, a video monitoring method is provided, including: obtaining via
The video data collected by the video data collecting device; and based on the preset scene information and the video data, performing determination and statistics of the monitoring object in the scene for monitoring corresponding to the scene information.
此外,根据本公开的一个实施例的视频监控方法,其中预先设置所述场景信息包括:配置用于监控的场景,并且设置用于监控的场景中的监控区域和监控线。Further, a video monitoring method according to an embodiment of the present disclosure, wherein the setting of the scene information in advance includes configuring a scene for monitoring, and setting a monitoring area and a monitoring line in a scene for monitoring.
此外,根据本公开的一个实施例的视频监控方法,其中预先设置所述场景信息还包括:基于预定模型对所述监控区域中的每个像素点进行概率估计,以获取每个像素点的概率模型,用于确定所述视频数据中的前景数据和背景数据。Further, the video monitoring method according to an embodiment of the present disclosure, wherein the setting the scene information in advance further comprises: performing probability estimation on each pixel point in the monitoring area based on a predetermined model to acquire a probability of each pixel point a model for determining foreground data and background data in the video data.
此外,根据本公开的一个实施例的视频监控方法,其中预先设置所述场景信息还包括:标记所述监控区域中的多个第一类监控对象的位置,确定每个位置的第一类监控对象相对于所述监控区域的面积的权重。In addition, the video monitoring method according to an embodiment of the present disclosure, wherein the setting the scene information in advance further includes: marking a location of the plurality of first type monitoring objects in the monitoring area, and determining a first type of monitoring of each location The weight of the object relative to the area of the monitored area.
此外,根据本公开的一个实施例的视频监控方法,还包括:基于所述概率模型,确定所述监控区域中的前景区域和背景区域,并且去除所述前景区域中的阴影区域,以获得作为监控目标的监控前景区域。Further, the video monitoring method according to an embodiment of the present disclosure further includes determining a foreground area and a background area in the monitoring area based on the probability model, and removing a shadow area in the foreground area to obtain Monitor the foreground area of the target.
此外,根据本公开的一个实施例的视频监控方法,还包括:将所述监控前景区域分为多个监控前景子区域,所述多个监控前景子区域相互不连通。In addition, the video monitoring method according to an embodiment of the present disclosure further includes dividing the monitoring foreground area into a plurality of monitoring foreground sub-areas, wherein the plurality of monitoring foreground sub-areas are not connected to each other.
此外,根据本公开的一个实施例的视频监控方法,其中基于所述场景信息和所述视频数据,执行与所述场景信息相对应的用于监控的场景中的监控对象的确定和统计包括:对于所述多个监控前景子区域的每一个执行边缘检测,获取所述监控前景子区域的轮廓信息,如果所述轮廓信息满足预定轮廓条件,则确定对应于所述轮廓信息的监控对象为第二类监控对象。Further, a video monitoring method according to an embodiment of the present disclosure, wherein the determining and counting of the monitoring object in the scene for monitoring corresponding to the scene information is performed based on the scene information and the video data, including: Performing edge detection on each of the plurality of monitoring foreground sub-regions, acquiring contour information of the monitoring foreground sub-region, and if the contour information satisfies a predetermined contour condition, determining that the monitoring object corresponding to the contour information is The second type of monitoring object.
此外,根据本公开的一个实施例的视频监控方法,其中基于所述场景信息和所述视频数据,执行与所述场景信息相对应的用于监控的场景中的监控对象的确定和统计还包括:从所述多个监控前景子区域的每一个去除对应于所述第二类监控对象的第二区域,以获得对应于所述第一类监控对象的第一区域,基于所述第一区域的面积和对应于所述第一类监控对象的权重,确定所述多个监控前景子区域的每一个中所述第一类监控对象的第一数目。Further, a video monitoring method according to an embodiment of the present disclosure, wherein the determining and counting of the monitoring object in the scene for monitoring corresponding to the scene information is further performed based on the scene information and the video data, further including Removing a second region corresponding to the second type of monitoring object from each of the plurality of monitoring foreground sub-regions to obtain a first region corresponding to the first type of monitoring object, based on the first region The area and the weight corresponding to the first type of monitoring object determine a first number of the first type of monitoring objects in each of the plurality of monitoring foreground sub-areas.
此外,根据本公开的一个实施例的视频监控方法,还包括:在所述第一数目大于预定阈值时,生成警告信息。
Moreover, the video monitoring method according to an embodiment of the present disclosure further includes generating warning information when the first number is greater than a predetermined threshold.
此外,根据本公开的一个实施例的视频监控方法,其中基于所述场景信息和所述视频数据,执行与所述场景信息相对应的用于监控的场景中的监控对象的确定和统计还包括:对于垂直于所述监控线的第一方向,基于所述第一类监控对象在所述监控线上的移动速度,确定在预定时间间隔期间在所述第一方向上通过所述监控线的所述第一区域的面积,并且基于所述监控线上所述第一类监控对象的权重,确定在所述预定时间间隔期间在所述第一方向上通过所述监控线的所述第一类监控对象的数目。Further, a video monitoring method according to an embodiment of the present disclosure, wherein the determining and counting of the monitoring object in the scene for monitoring corresponding to the scene information is further performed based on the scene information and the video data, further including Determining, in a first direction perpendicular to the monitoring line, based on a moving speed of the first type of monitoring object on the monitoring line, passing the monitoring line in the first direction during a predetermined time interval An area of the first area, and based on a weight of the first type of monitoring object on the monitoring line, determining the first pass of the monitoring line in the first direction during the predetermined time interval The number of class monitoring objects.
根据本公开的另一个实施例,提供了一种视频监控系统,包括:处理器;存储器;和存储在所述存储器中的计算机程序指令,在所述计算机程序指令被所述处理器运行时执行以下步骤:获取经由视频数据采集装置采集的视频数据;以及基于预先设置的场景信息和所述视频数据,执行与所述场景信息相对应的用于监控的场景中的监控对象的确定和统计。In accordance with another embodiment of the present disclosure, a video surveillance system is provided, comprising: a processor; a memory; and computer program instructions stored in the memory, executed when the computer program instructions are executed by the processor The following steps: acquiring video data collected via the video data collecting device; and performing determination and statistics of the monitoring object in the scene for monitoring corresponding to the scene information based on the preset scene information and the video data.
此外,根据本公开的另一个实施例的视频监控系统,其中在所述计算机程序指令被所述处理器运行时执行预先设置所述场景信息的步骤,所述预先设置所述场景信息的步骤包括:配置用于监控的场景,并且设置用于监控的场景中的监控区域和监控线。Further, a video monitoring system according to another embodiment of the present disclosure, wherein the step of presetting the scene information is performed when the computer program instructions are executed by the processor, the step of presetting the scene information includes : Configure the scenario for monitoring and set the monitoring area and monitoring line in the scenario for monitoring.
此外,根据本公开的另一个实施例的视频监控系统,其中在所述计算机程序指令被所述处理器运行时执行预先设置所述场景信息的步骤还包括:基于预定模型对所述监控区域中的每个像素点进行概率估计,以获取每个像素点的概率模型,用于确定所述视频数据中的前景数据和背景数据。Further, a video monitoring system according to another embodiment of the present disclosure, wherein the step of performing the setting of the scene information in advance when the computer program instructions are executed by the processor further comprises: pairing the monitoring area based on a predetermined model Each pixel is subjected to probability estimation to obtain a probability model of each pixel for determining foreground data and background data in the video data.
此外,根据本公开的另一个实施例的视频监控系统,其中在所述计算机程序指令被所述处理器运行时执行配置预先设置所述场景信息的步骤还包括:标记所述监控区域中的多个第一类监控对象的位置,确定每个位置的第一类监控对象相对于所述监控区域的面积的权重。Further, a video monitoring system according to another embodiment of the present disclosure, wherein the step of performing configuration presetting the scene information when the computer program instructions are executed by the processor further comprises: marking a plurality of the monitoring areas The positions of the first type of monitoring objects determine the weight of the first type of monitoring objects of each location relative to the area of the monitoring area.
此外,根据本公开的另一个实施例的视频监控系统,其中在所述计算机程序指令被所述处理器运行时还执行以下步骤:基于所述概率模型,确定所述监控区域中的前景区域和背景区域,并且去除所述前景区域中的阴影区域,以获得作为监控目标的监控前景区域。Further, a video surveillance system according to another embodiment of the present disclosure, wherein when the computer program instructions are executed by the processor, the step of: determining a foreground region in the monitored area and based on the probability model A background area, and the shaded area in the foreground area is removed to obtain a monitoring foreground area as a monitoring target.
此外,根据本公开的另一个实施例的视频监控系统,其中在所述计算机程序指令被所述处理器运行时还执行以下步骤:将所述监控前景区域分为多个监控前景子区域,所述多个监控前景子区域相互不连通。
Further, a video surveillance system according to another embodiment of the present disclosure, wherein when the computer program instructions are executed by the processor, the step of: dividing the monitoring foreground area into a plurality of monitoring foreground sub-areas, The plurality of monitoring foreground sub-areas are not connected to each other.
此外,根据本公开的另一个实施例的视频监控系统,其中在所述计算机程序指令被所述处理器运行时执行基于所述场景信息和所述视频数据,执行所述场景中的监控对象的确定和统计的步骤包括:对于所述多个监控前景子区域的每一个执行边缘检测,获取所述监控前景子区域的轮廓信息,如果所述轮廓信息满足预定轮廓条件,则确定对应于所述轮廓信息的监控对象为第二类监控对象。Further, a video surveillance system according to another embodiment of the present disclosure, wherein when the computer program instructions are executed by the processor, performing monitoring based on the scene information and the video data, performing monitoring objects in the scene The determining and counting step includes: performing edge detection on each of the plurality of monitoring foreground sub-regions, acquiring contour information of the monitoring foreground sub-region, and determining, if the contour information meets a predetermined contour condition, corresponding to the The monitoring object of the contour information is the second type of monitoring object.
此外,根据本公开的另一个实施例的视频监控系统,其中在所述计算机程序指令被所述处理器运行时执行基于所述场景信息和所述视频数据,执行所述场景中的监控对象的确定和统计的步骤还包括:从所述多个监控前景子区域的每一个去除对应于所述第二类监控对象的第二区域,以获得对应于所述第一类监控对象的第一区域,基于所述第一区域的面积和对应于所述第一类监控对象的权重,确定所述多个监控前景子区域的每一个中所述第一类监控对象的第一数目。Further, a video surveillance system according to another embodiment of the present disclosure, wherein when the computer program instructions are executed by the processor, performing monitoring based on the scene information and the video data, performing monitoring objects in the scene The determining and counting step further includes: removing a second region corresponding to the second type of monitoring object from each of the plurality of monitoring foreground sub-regions to obtain a first region corresponding to the first type of monitoring object Determining, according to an area of the first area and a weight corresponding to the first type of monitoring object, a first number of the first type of monitoring objects in each of the plurality of monitoring foreground sub-areas.
此外,根据本公开的另一个实施例的视频监控系统,其中在所述计算机程序指令被所述处理器运行时还执行以下步骤:在所述第一数目大于预定阈值时,生成警告信息。Moreover, a video surveillance system in accordance with another embodiment of the present disclosure, wherein the computer program instructions, when executed by the processor, further perform the step of generating warning information when the first number is greater than a predetermined threshold.
此外,根据本公开的另一个实施例的视频监控系统,其中在所述计算机程序指令被所述处理器运行时执行基于所述场景信息和所述视频数据,执行与所述场景信息相对应的用于监控的场景中的监控对象的确定和统计的步骤还包括:对于垂直于所述监控线的第一方向,基于所述第一类监控对象在所述监控线上的移动速度,确定在预定时间间隔期间在所述第一方向上通过所述监控线的所述第一区域的面积,并且基于所述监控线上所述第一类监控对象的权重,确定在所述预定时间间隔期间在所述第一方向上通过所述监控线的所述第一类监控对象的数目。Further, a video monitoring system according to another embodiment of the present disclosure, wherein when the computer program instructions are executed by the processor, performing execution based on the scene information and the video data, corresponding to the scene information The determining and counting of the monitoring object in the monitored scenario further includes: determining, in the first direction perpendicular to the monitoring line, based on a moving speed of the first type of monitoring object on the monitoring line Determining an area of the first area of the monitoring line in the first direction during a predetermined time interval, and determining, during the predetermined time interval, based on a weight of the first type of monitoring object on the monitoring line The number of the first type of monitored objects passing the monitoring line in the first direction.
根据本公开的又一个实施例,提供了一种计算机程序产品,包括计算机可读存储介质,在所述计算机可读存储介质上存储了计算机程序指令,所述计算机程序指令在被计算机运行时执行以下步骤:获取经由视频数据采集装置采集的视频数据;以及基于预先设置的场景信息和所述视频数据,执行所述场景中的监控对象的确定和统计。According to still another embodiment of the present disclosure, a computer program product is provided, comprising a computer readable storage medium on which computer program instructions are stored, the computer program instructions being executed while being executed by a computer The following steps: acquiring video data collected via the video data collection device; and performing determination and statistics of the monitoring object in the scenario based on the preset scene information and the video data.
要理解的是,前面的一般描述和下面的详细描述两者都是示例性的,并且意图在于提供要求保护的技术的进一步说明。
It is to be understood that both the foregoing general description
附图说明DRAWINGS
通过结合附图对本发明实施例进行更详细的描述,本发明的上述以及其它目的、特征和优势将变得更加明显。附图用来提供对本发明实施例的进一步理解,并且构成说明书的一部分,与本发明实施例一起用于解释本发明,并不构成对本发明的限制。在附图中,相同的参考标号通常代表相同部件或步骤。The above as well as other objects, features and advantages of the present invention will become more apparent from the embodiments of the invention. The drawings are intended to provide a further understanding of the embodiments of the invention, In the figures, the same reference numerals generally refer to the same parts or steps.
图1是图示根据本发明实施例的视频监控方法的流程图。FIG. 1 is a flow chart illustrating a video monitoring method according to an embodiment of the present invention.
图2是图示根据本发明实施例的视频监控系统的功能性框图。2 is a functional block diagram illustrating a video surveillance system in accordance with an embodiment of the present invention.
图3是进一步图示根据本发明实施例的视频监控方法中设置场景信息的流程图。FIG. 3 is a flowchart further illustrating setting scene information in a video monitoring method according to an embodiment of the present invention.
图4是进一步图示根据本发明实施例的视频监控方法中视频数据的预处理的流程图。4 is a flow chart further illustrating pre-processing of video data in a video surveillance method in accordance with an embodiment of the present invention.
图5A到5C是图示根据本发明实施例的视频监控方法中视频数据的预处理的示意图。5A to 5C are diagrams illustrating preprocessing of video data in a video monitoring method according to an embodiment of the present invention.
图6是进一步图示根据本发明实施例的视频监控方法中监控对象的数量统计的流程图。FIG. 6 is a flow chart further illustrating the statistics of the number of monitored objects in the video monitoring method according to an embodiment of the present invention.
图7是图示根据本发明实施例的视频监控方法中监控对象的类型确定的示意图。FIG. 7 is a schematic diagram illustrating type determination of a monitoring object in a video monitoring method according to an embodiment of the present invention.
图8是进一步图示根据本发明实施例的视频监控方法中监控对象的流量统计的流程图。FIG. 8 is a flowchart further illustrating flow statistics of a monitoring object in a video monitoring method according to an embodiment of the present invention.
图9A和9B是图示根据本发明实施例的视频监控方法中监控对象的流量统计的示意图。9A and 9B are diagrams illustrating traffic statistics of a monitoring object in a video monitoring method according to an embodiment of the present invention.
图10是图示根据本发明实施例的视频监控系统的示意性框图。FIG. 10 is a schematic block diagram illustrating a video monitoring system according to an embodiment of the present invention.
具体实施方式detailed description
为了使得本发明的目的、技术方案和优点更为明显,下面将参照附图详细描述根据本发明的示例实施例。显然,所描述的实施例仅仅是本发明的一部分实施例,而不是本发明的全部实施例,应理解,本发明不受这里描述的示例实施例的限制。基于本公开中描述的本发明实施例,本领域技术人员在
没有付出创造性劳动的情况下所得到的所有其它实施例都应落入本发明的保护范围之内。In order to make the objects, the technical solutions and the advantages of the present invention more apparent, the exemplary embodiments according to the present invention will be described in detail below with reference to the accompanying drawings. It is apparent that the described embodiments are only a part of the embodiments of the present invention, and are not to be construed as limiting the embodiments of the invention. Based on the embodiments of the invention described in this disclosure, those skilled in the art are
All other embodiments obtained without creative efforts are intended to fall within the scope of the invention.
以下,将参考附图详细描述本发明的优选实施例。Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings.
图1是图示根据本发明实施例的视频监控方法的流程图。如图1所示,根据本发明实施例的视频监控方法包括以下步骤。FIG. 1 is a flow chart illustrating a video monitoring method according to an embodiment of the present invention. As shown in FIG. 1, a video monitoring method according to an embodiment of the present invention includes the following steps.
在步骤S101中,获取经由视频采集装置采集的视频数据。在本发明的一个实施例中,所述视频采集装置为能够获取被摄体的视频数据的摄像头(诸如RGB摄像机或深度摄像机)。所述视频采集装置以俯视角度安装固定。获取经由视频采集装置采集的视频数据包括但不限于,在由物理位置上分离配置的视频采集装置采集视频数据之后,经由有线或者无线方式,接收从所述视频采集装置发送的视频数据。可替代地,视频采集装置可以与视频监控系统中的其他模块或组件物理上位于同一位置甚至位于同一机壳内部,视频监控系统中的其他模块或组件经由内部总线接收从所述视频采集装置发送的视频数据。此后,处理进到步骤S102。In step S101, video data acquired via the video capture device is acquired. In one embodiment of the invention, the video capture device is a camera (such as an RGB camera or a depth camera) capable of acquiring video data of a subject. The video capture device is mounted and fixed in a plan view. Acquiring video data collected via the video capture device includes, but is not limited to, receiving video data transmitted from the video capture device via a wired or wireless method after the video capture device configured by the physical location is separately configured to acquire video data. Alternatively, the video capture device may be physically co-located with other modules or components in the video surveillance system or even within the same chassis, and other modules or components in the video surveillance system are received from the video capture device via the internal bus. Video data. Thereafter, the processing proceeds to step S102.
在步骤S102中,基于预先设置的场景信息和所述视频数据,执行与所述场景信息相对应的用于监控的场景中的监控对象的确定和统计。在本发明的一个实施例中,预先设置的场景信息包括但不限于要监控的场景中的兴趣区域(ROI)和兴趣线(LOI)。兴趣区域(ROI)是场景中需要进行人数(车辆数)统计的区域。兴趣线(LOI)是场景中需要进行人流量统计的虚拟线。以下,将参照附图进一步详细描述预先设置场景信息的处理,以及场景中的监控对象的确定和统计的处理。In step S102, based on the preset scene information and the video data, determination and statistics of monitoring objects in the scene for monitoring corresponding to the scene information are performed. In an embodiment of the present invention, the preset scene information includes, but is not limited to, a region of interest (ROI) and a line of interest (LOI) in a scene to be monitored. The area of interest (ROI) is the area in the scene where the number of people (number of vehicles) needs to be counted. The line of interest (LOI) is a virtual line in the scene that requires human traffic statistics. Hereinafter, the processing of setting the scene information in advance, and the processing of the determination and statistics of the monitoring object in the scene will be described in further detail with reference to the accompanying drawings.
上述根据本发明实施例的视频监控方法,能够基于预先设置的场景信息和视频数据实时地对当前场景中的人群密度、车流量、以及过线的人流数量进行准确的统计和分析。The video monitoring method according to the embodiment of the present invention can accurately perform statistics and analysis on the population density, the traffic volume, and the number of people flowing in the current scene based on the preset scene information and the video data in real time.
以下,将参照图2进一步描述执行上述视频监控方法的视频监控系统。Hereinafter, a video monitoring system that performs the above video monitoring method will be further described with reference to FIG.
图2是图示根据本发明实施例的视频监控系统的功能性框图。如图2所示,根据本发明实施例的视频监控系统20包括视频数据获取模块21、监控场景配置模块22、视频数据预处理模块23和监控对象统计模块24。所述视频数据获取模块21、监控场景配置模块22、视频数据预处理模块23和监控对象统计模块24例如可以由诸如硬件(服务器、专用计算机等)、软件、固件以及它们的任意可行的组合配置。
2 is a functional block diagram illustrating a video surveillance system in accordance with an embodiment of the present invention. As shown in FIG. 2, the video surveillance system 20 according to the embodiment of the present invention includes a video data acquisition module 21, a monitoring scenario configuration module 22, a video data preprocessing module 23, and a monitoring object statistics module 24. The video data obtaining module 21, the monitoring scene configuration module 22, the video data pre-processing module 23, and the monitoring object statistics module 24 may be configured, for example, by hardware (server, dedicated computer, etc.), software, firmware, and any feasible combination thereof. .
具体地,所述视频数据获取模块21用于获取视频数据。在本发明的一个实施例中,所述视频数据获取模块21可以是包括能够获取被摄体的视频数据的RGB摄像机的视频采集装置。在本发明的另一个实施例中,所述视频数据获取模块21可以包括能够获取被摄体的深度信息的深度相机(深度摄像机)的视频采集装置。所述视频数据获取模块21可以与其后的监控场景配置模块22、视频数据预处理模块23和监控对象统计模块24物理上分离,或者物理上位于同一位置甚至位于同一机壳内部。在所述视频数据获取模块21与其后的监控场景配置模块22、视频数据预处理模块23和监控对象统计模块24物理上分离的情况下,所述视频数据获取模块21进一步经由有线或者无线方式将所述视频采集装置获取的深度视频数据发送给其后的模块。在所述视频数据获取模块21与其后的监控场景配置模块22、视频数据预处理模块23和监控对象统计模块24物理上位于同一位置甚至位于同一机壳内部的情况下,所述视频数据获取模块21经由内部总线将所述视频采集装置获取的深度视频数据发送给其后的模块。所述视频数据可以是RGB彩色视频数据或者包括深度信息得RGBD视频数据。在经由有线或者无线方式或者经由内部总线发送所述视频数据之前,可以将其预定格式进行编码和压缩为视频数据包,以减少发送需要占用的通信量和带宽。Specifically, the video data acquiring module 21 is configured to acquire video data. In one embodiment of the present invention, the video data acquisition module 21 may be a video capture device including an RGB camera capable of acquiring video data of a subject. In another embodiment of the present invention, the video data acquisition module 21 may include a video capture device of a depth camera (depth camera) capable of acquiring depth information of a subject. The video data obtaining module 21 can be physically separated from the monitoring scene configuration module 22, the video data pre-processing module 23, and the monitoring object statistics module 24, or physically located at the same location or even inside the same chassis. In a case where the video data acquiring module 21 is physically separated from the monitoring scene configuration module 22, the video data pre-processing module 23, and the monitoring object statistics module 24, the video data acquiring module 21 further performs the wired or wireless manner. The depth video data acquired by the video capture device is sent to a subsequent module. In the case where the video data acquiring module 21 and the subsequent monitoring scene configuration module 22, the video data pre-processing module 23, and the monitoring object statistics module 24 are physically located at the same position or even inside the same casing, the video data acquiring module The depth video data acquired by the video capture device is sent to the subsequent module via the internal bus. The video data may be RGB color video data or RGBD video data including depth information. Before the video data is transmitted via wired or wireless means or via the internal bus, its predetermined format can be encoded and compressed into video data packets to reduce the amount of traffic and bandwidth required for transmission.
所述监控场景配置模块22配置用于监控的场景,并且设置用于监控的场景中的监控区域和监控线。具体地,根据本发明实施例的视频监控系统20的操作者在以俯视角度固定作为所述视频数据获取模块21之后,设置所述视频数据获取模块21拍摄的监控场景中的监控区域和监控线。在本发明的一个实施例中,所述监控区域是如上所述的要监控的场景中的兴趣区域(ROI),即场景中需要进行人数(车辆数)统计的区域。在本发明的一个实施例中,所述监控区域可以设置为所述视频数据获取模块21拍摄的整个监控场景中的所有区域,也可以设置为监控场景中的部分特定区域。所述监控线是如上所述的要监控的场景中的兴趣线(LOI),所述兴趣线(LOI)是场景中需要进行人流量统计的虚拟线,其可以是平行于监控场景中的地平面。在本发明的一个实施例中,所述监控线是监控场景中诸如出入口所在平面中的一条平行于地平面的直线,统计通过所述监控线的人流即获得出入所述出入口的人流量。The monitoring scenario configuration module 22 configures a scenario for monitoring, and sets a monitoring area and a monitoring line in the scenario for monitoring. Specifically, after the operator of the video monitoring system 20 according to the embodiment of the present invention is fixed as the video data acquiring module 21 in a plan view, the monitoring area and the monitoring line in the monitoring scene captured by the video data acquiring module 21 are set. . In an embodiment of the present invention, the monitoring area is an area of interest (ROI) in a scene to be monitored as described above, that is, an area in the scene where the number of people (number of vehicles) is required to be counted. In an embodiment of the present invention, the monitoring area may be set to all areas in the entire monitoring scene captured by the video data acquiring module 21, or may be set to monitor a part of the specific area in the scene. The monitoring line is a line of interest (LOI) in a scene to be monitored as described above, and the line of interest (LOI) is a virtual line in the scene that requires human traffic statistics, which may be parallel to the ground in the monitoring scene. flat. In an embodiment of the present invention, the monitoring line is a straight line parallel to the ground plane in a plane such as an entrance and exit in a monitoring scene, and statistics of the flow of people passing through the monitoring line to obtain the flow of people entering and leaving the entrance and exit.
进一步地,所述监控场景配置模块22基于预定模型对所述监控区域中
的每个像素点进行概率估计,以获取每个像素点的概率模型。在本发明的一个实施例中,所述监控场景配置模块22利用多高斯模型对单个像素进行概率估计,得到每个像素点的概率模型,以此模型来针对获取的视频数据判断前景数据和背景数据。在配置用于监控的场景之后,所述概率模型是视频数据是背景数据的概率。由于背景是相对固定的,前景是任意的,则不同于背景数据的即为前景数据。Further, the monitoring scenario configuration module 22 is configured in the monitoring area based on a predetermined model.
Probability estimation is performed for each pixel to obtain a probability model for each pixel. In an embodiment of the present invention, the monitoring scene configuration module 22 performs probability estimation on a single pixel by using a multi-Gaussian model to obtain a probability model of each pixel point, and uses the model to determine foreground data and background for the acquired video data. data. After configuring the scene for monitoring, the probability model is the probability that the video data is background data. Since the background is relatively fixed and the foreground is arbitrary, then the foreground data is different from the background data.
更进一步地,所述监控场景配置模块22标记所述监控区域中的多个第一类监控对象的位置,确定每个位置的第一类监控对象相对于所述监控区域的面积的权重。在本发明的实施例中,所述第一类监控对象可以为行人,下面将要描述的第二类监控对象则可以为车辆。在本发明的一个实施例中,在所述监控区域中根据获取的视频数据手动标记多个行人(第一类监控对象)的位置,通过回归算法,估算上述每个位置的行人的权重。也就是说,所述权重是一个行人在该位置在视频图像中所占据的面积。容易理解的是,所述权重是随着摄像机与场景的相对位置有关,实际上离摄像机越远,行人在图像上的占据的大小越小,因此给予此位置的权重越大。Further, the monitoring scenario configuration module 22 marks the locations of the plurality of first type of monitoring objects in the monitoring area, and determines the weight of the first type of monitoring objects of each location relative to the area of the monitoring area. In an embodiment of the present invention, the first type of monitoring object may be a pedestrian, and the second type of monitoring object to be described below may be a vehicle. In an embodiment of the present invention, the locations of the plurality of pedestrians (the first type of monitoring objects) are manually marked according to the acquired video data in the monitoring area, and the weights of the pedestrians in each of the above locations are estimated by a regression algorithm. That is, the weight is the area occupied by a pedestrian in the video image at that location. It is easy to understand that the weight is related to the relative position of the camera and the scene. Actually, the farther away from the camera, the smaller the size occupied by the pedestrian on the image, so the weight given to the position is larger.
所述视频数据预处理模块23对所述视频数据获取模块21所获取的视频数据执行视频数据的预处理。在本发明的一个实施例中,所述视频数据预处理模块23基于所述监控场景配置模块22确定的所述概率模型,确定所述监控区域中的前景区域和背景区域,并且去除所述前景区域中的阴影区域,以获得作为监控目标的监控前景区域。进一步地,所述视频数据预处理模块23将所述监控前景区域分为多个监控前景子区域,所述多个监控前景子区域相互不连通。The video data pre-processing module 23 performs pre-processing of the video data on the video data acquired by the video data acquiring module 21. In an embodiment of the present invention, the video data pre-processing module 23 determines the foreground area and the background area in the monitoring area based on the probability model determined by the monitoring scene configuration module 22, and removes the foreground. A shaded area in the area to obtain a monitored foreground area as a monitoring target. Further, the video data pre-processing module 23 divides the monitoring foreground area into a plurality of monitoring foreground sub-areas, and the plurality of monitoring foreground sub-areas are not connected to each other.
所述监控对象统计模块24基于所述监控场景配置模块22设置的所述场景信息和所述视频数据获取模块21获取的所述视频数据,执行所述场景中的监控对象的确定和统计。在本发明的一个实施例中,所述监控对象统计模块24对于所述视频数据预处理模块23获得的所述多个监控前景子区域的每一个执行边缘检测,获取所述监控前景子区域的轮廓信息。如果所述轮廓信息满足预定轮廓条件,则确定对应于所述轮廓信息的监控对象为第二类监控对象(车辆)。进一步地,所述监控对象统计模块24从所述多个监控前景子区域的每一个去除对应于所述第二类监控对象的第二区域,以获得对应于所述第一类监控对象(行人)的第一区域,基于所述第一区域的面积和对应于
所述第一类监控对象的所述监控场景配置模块22确定的权重,确定所述多个监控前景子区域的每一个中所述第一类监控对象的第一数目。更进一步地,在所述第一数目大于预定阈值时,所述监控对象统计模块24生成警告信息。在本发明的另一个实施例中,所述监控对象统计模块24对于所述监控场景配置模块22设置的所述监控线进行人流量的统计。所述监控对象统计模块24对于垂直于所述监控线的第一方向,基于所述第一类监控对象在所述监控线上的移动速度,确定在预定时间间隔期间在所述第一方向上通过所述监控线的所述第一区域的面积,并且基于所述监控线上所述第一类监控对象的权重,确定在所述预定时间间隔期间在所述第一方向上通过所述监控线的所述第一类监控对象的数目。The monitoring object statistic module 24 performs the determination and statistics of the monitoring object in the scenario based on the scenario information set by the monitoring scenario configuration module 22 and the video data acquired by the video data acquiring module 21. In an embodiment of the present invention, the monitoring object statistic module 24 performs edge detection on each of the plurality of monitoring foreground sub-regions obtained by the video data pre-processing module 23, and acquires the monitoring foreground sub-region. Contour information. If the profile information satisfies a predetermined profile condition, it is determined that the monitored object corresponding to the profile information is a second type of monitoring object (vehicle). Further, the monitoring object statistic module 24 removes a second region corresponding to the second type of monitoring object from each of the plurality of monitoring foreground sub-regions to obtain a monitoring object corresponding to the first category (pedestrian) a first region based on the area of the first region and corresponding to
The weight determined by the monitoring scenario configuration module 22 of the first type of monitoring object determines a first number of the first type of monitoring objects in each of the plurality of monitoring foreground sub-regions. Further, the monitoring object statistics module 24 generates warning information when the first number is greater than a predetermined threshold. In another embodiment of the present invention, the monitoring object statistics module 24 performs statistics on human traffic for the monitoring line set by the monitoring scenario configuration module 22. The monitoring object statistic module 24 determines, in a first direction perpendicular to the monitoring line, based on a moving speed of the first type of monitoring object on the monitoring line, in the first direction during a predetermined time interval. Determining, by the monitoring, the area of the first area of the monitoring line, and based on the weight of the first type of monitoring object on the monitoring line, passing the monitoring in the first direction during the predetermined time interval The number of said first type of monitored objects of the line.
以下,将进一步参照附图详细描述由根据本发明实施例的视频监控系统的各个模块执行的根据本发明实施例的视频监控方法的各个具体步骤流程。Hereinafter, various specific steps of the video monitoring method according to the embodiment of the present invention executed by the respective modules of the video monitoring system according to the embodiment of the present invention will be described in detail with reference to the accompanying drawings.
图3是进一步图示根据本发明实施例的视频监控方法中设置场景信息的流程图。如图3所示,根据本发明实施例的视频监控方法中设置场景信息的流程包括以下步骤。FIG. 3 is a flowchart further illustrating setting scene information in a video monitoring method according to an embodiment of the present invention. As shown in FIG. 3, the process of setting scene information in the video monitoring method according to the embodiment of the present invention includes the following steps.
在步骤S301中,配置视频数据采集装置。将作为所述视频采集装置的相机安装在需要监控的场景中。通常,相机的安装高度为2-3.5米,其视角为俯视地面。此后,处理进到步骤S302。In step S301, a video data collecting device is configured. A camera as the video capture device is installed in a scene to be monitored. Typically, the camera is mounted at a height of 2-3.5 meters and its viewing angle is looking down on the ground. Thereafter, the processing proceeds to step S302.
在步骤S302中,配置用于监控的场景,并且设置用于监控的场景中的监控区域和监控线。如上所述,所述监控区域是要监控的场景中需要进行人数(车辆数)统计的区域。在本发明的一个实施例中,所述监控区域可以设置为所述视频数据获取模块21拍摄的整个监控场景中的所有区域,也可以设置为监控场景中的部分特定区域。所述监控线是场景中需要进行人流量统计的虚拟线,其可以是平行于监控场景中的地平面。在本发明的一个实施例中,所述监控线是监控场景中诸如出入口所在平面中的一条平行于地平面的直线,统计通过所述监控线的人流即获得出入所述出入口的人流量。此后,处理进到步骤S303。In step S302, a scenario for monitoring is configured, and a monitoring area and a monitoring line in the scene for monitoring are set. As described above, the monitoring area is an area in the scene to be monitored in which the number of people (number of vehicles) needs to be counted. In an embodiment of the present invention, the monitoring area may be set to all areas in the entire monitoring scene captured by the video data acquiring module 21, or may be set to monitor a part of the specific area in the scene. The monitoring line is a virtual line in the scenario where human traffic statistics are required, which may be parallel to a ground plane in the monitoring scenario. In an embodiment of the present invention, the monitoring line is a straight line parallel to the ground plane in a plane such as an entrance and exit in a monitoring scene, and statistics of the flow of people passing through the monitoring line to obtain the flow of people entering and leaving the entrance and exit. Thereafter, the processing proceeds to step S303.
在步骤S303中,基于预定模型对监控区域中的每个像素点进行概率估计,以获取每个像素点的概率模型。在本发明的一个实施例中,利用多高斯模型对单个像素进行概率估计,得到每个像素点的概率模型,以此模型来针对获取的视频数据判断前景数据和背景数据。在配置用于监控的场景之后,
所述概率模型是视频数据是背景数据的概率。此后,处理进到步骤S304。In step S303, probability estimation is performed on each pixel point in the monitoring area based on the predetermined model to acquire a probability model of each pixel point. In one embodiment of the present invention, a multi-Gaussian model is used to estimate a probability of a single pixel, and a probability model of each pixel is obtained, and the foreground data and the background data are determined for the acquired video data. After configuring the scenario for monitoring,
The probability model is the probability that the video data is background data. Thereafter, the processing proceeds to step S304.
在步骤S304中,标记监控区域中的多个第一类监控对象的位置,确定每个位置的第一类监控对象相对于监控区域的面积的权重。在本发明的一个实施例中,在所述监控区域中根据获取的视频数据手动标记多个行人(第一类监控对象)的位置,通过回归算法,估算上述每个位置的行人的权重。也就是说,所述权重是一个行人在该位置在视频图像中所占据的面积。容易理解的是,所述权重是随着摄像机与场景的相对位置有关,实际上离摄像机越远,行人在图像上的占据的大小越小,因此给予此位置的权重越大。In step S304, the locations of the plurality of first type monitoring objects in the monitoring area are marked, and the weight of the area of the first type of monitoring objects of each location relative to the area of the monitoring area is determined. In an embodiment of the present invention, the locations of the plurality of pedestrians (the first type of monitoring objects) are manually marked according to the acquired video data in the monitoring area, and the weights of the pedestrians in each of the above locations are estimated by a regression algorithm. That is, the weight is the area occupied by a pedestrian in the video image at that location. It is easy to understand that the weight is related to the relative position of the camera and the scene. Actually, the farther away from the camera, the smaller the size occupied by the pedestrian on the image, so the weight given to the position is larger.
通过如上所述步骤S301到S304的设置场景信息的流程,在安装视频数据采集装置之后,即确定用于监控的监控区域和监控线、用于确定前景和背景的概率模型、以及第一类监控对象在监控区域中的面积权重。以上各个参数将用于此后基于视频数据的实时监控。After the video data collection device is installed by the process of setting the scene information in steps S301 to S304 as described above, the monitoring area and the monitoring line for monitoring, the probability model for determining the foreground and the background, and the first type of monitoring are determined. The area weight of the object in the monitoring area. The above parameters will be used for real-time monitoring based on video data thereafter.
图4是进一步图示根据本发明实施例的视频监控方法中视频数据的预处理的流程图。如图4所示,根据本发明实施例的视频监控方法中视频数据的预处理的流程包括以下步骤。4 is a flow chart further illustrating pre-processing of video data in a video surveillance method in accordance with an embodiment of the present invention. As shown in FIG. 4, the flow of preprocessing of video data in the video monitoring method according to an embodiment of the present invention includes the following steps.
在步骤S401中,基于概率模型,确定监控区域中的前景区域和背景区域。在获取用于监控的视频数据之后,利用在上述步骤S303中确定的概率模型,确定所述视频数据中的前景数据和背景数据,即监控区域中的前景区域和背景区域。此后,处理进到步骤S402。In step S401, a foreground area and a background area in the monitoring area are determined based on the probability model. After acquiring the video data for monitoring, the foreground data and the background data in the video data, that is, the foreground area and the background area in the monitoring area are determined using the probability model determined in the above step S303. Thereafter, the processing proceeds to step S402.
在步骤S402中,去除前景区域中的阴影区域,以获得作为监控目标的监控前景区域。在本发明的一个实施例中,如果监控区域中有阴影存在,则通过阴影检测方法清除前景区域中的阴影部分。所述阴影检测方法可以基于两种物理原理。一种物理原理是阴影部分中的光线亮度会比非阴影部分中的光线亮度更暗。另一种物理原理则是阴影部分会保存地面本身的纹理信息。通过阴影检测方法首先找到阴影部分,然后从前景区域中进行剔除。此后,处理进到步骤S403。In step S402, the shaded area in the foreground area is removed to obtain a monitored foreground area as a monitoring target. In one embodiment of the invention, if there is a shadow in the monitored area, the shaded portion in the foreground area is cleared by the shadow detection method. The shadow detection method can be based on two physical principles. One physical principle is that the brightness of the light in the shaded portion is darker than the brightness of the light in the non-shaded portion. Another physical principle is that the shaded portion preserves the texture information of the ground itself. The shadow detection method first finds the shadow portion and then culls it from the foreground region. Thereafter, the processing proceeds to step S403.
在步骤S403中,将监控前景区域分为多个监控前景子区域,多个监控前景子区域相互不连通。通过将监控前景区域分为多个监控前景子区域,多个监控前景子区域相互不连通,可以避免对大块前景区域的人数估计导致的误差。In step S403, the monitoring foreground area is divided into a plurality of monitoring foreground sub-areas, and the plurality of monitoring foreground sub-areas are not connected to each other. By dividing the monitoring foreground area into multiple monitoring foreground sub-areas, multiple monitoring foreground sub-areas are not connected to each other, and errors caused by estimating the number of people in the large foreground area can be avoided.
通过如上所述步骤S401到S403的视频数据的预处理的流程,将获取的
用于监控的视频数据预处理为用于进一步的统计分析。以下,将参照附图描述视频数据预处理的示意性效果。Obtained by the flow of preprocessing of the video data of steps S401 to S403 as described above
The video data for monitoring is pre-processed for further statistical analysis. Hereinafter, a schematic effect of video data pre-processing will be described with reference to the drawings.
图5A到5C是图示根据本发明实施例的视频监控方法中视频数据的预处理的示意图。5A to 5C are diagrams illustrating preprocessing of video data in a video monitoring method according to an embodiment of the present invention.
如图5A所示,基于概率模型,确定监控区域中的背景区域51。As shown in FIG. 5A, based on the probability model, the background area 51 in the monitoring area is determined.
进一步地,基于确定的背景区域51以及相应的阴影部分去除,执行前景区域的提取。如图5B所示,提取用于进一步视频监控统计分析的前景区域52。Further, extraction of the foreground region is performed based on the determined background region 51 and the corresponding shaded portion removal. As shown in Figure 5B, foreground area 52 for further video surveillance statistical analysis is extracted.
更进一步地,对前景区域52执行分块操作。如图5C所示,将提取的前景区域52分为多个监控前景子区域521、522和523。Further, a blocking operation is performed on the foreground area 52. As shown in FIG. 5C, the extracted foreground area 52 is divided into a plurality of monitoring foreground sub-areas 52 1 , 52 2 and 52 3 .
通过如图5A到5C所示的视频数据的预处理,获得的多个监控前景子区域521、522和523将用于监控对象的统计分析。Through the pre-processing of the video data as shown in Figures 5A through 5C, the plurality of monitored foreground sub-regions 52 1 , 52 2 and 52 3 obtained will be used for statistical analysis of the monitored objects.
图6是进一步图示根据本发明实施例的视频监控方法中监控对象的数量统计的流程图。如图6所示,根据本发明实施例的视频监控方法中监控对象的数量统计的流程包括以下步骤。FIG. 6 is a flow chart further illustrating the statistics of the number of monitored objects in the video monitoring method according to an embodiment of the present invention. As shown in FIG. 6, the flow of monitoring the number of objects in the video monitoring method according to the embodiment of the present invention includes the following steps.
在步骤S601中,对于多个监控前景子区域的每一个执行边缘检测,获取监控前景子区域的轮廓信息。在本发明的一个实施例中,可以应用诸如霍夫(Hough)变换的处理获得诸如多个监控前景子区域521、522和523的每个中的轮廓信息,即找出监控前景子区域中的线(line)。此后,处理进到步骤S602。In step S601, edge detection is performed for each of the plurality of monitoring foreground sub-regions, and contour information of the monitoring foreground sub-region is acquired. In an embodiment of the present invention, processing such as Hough transform may be applied to obtain contour information in each of a plurality of monitored foreground sub-regions 52 1 , 52 2 , and 52 3 , that is, to find a monitoring foreground. The line in the area. Thereafter, the processing proceeds to step S602.
在步骤S602中,轮廓信息满足预定轮廓条件?在本发明的一个实施例中,所述预定轮廓条件可以是监控前景子区域中监控对象的横线比例。假设监控场景中的行人(第一类监控对象)是站立的,因此行人身上的线主要是垂直于地面的直线,而车辆(第二类监控对象)因为车身上面的线条,会有较长的平行于地面的横线,从而可以根据监控对象的横线比例区分监控前景子区域中监控对象是行人(第一类监控对象)还是车辆(第二类监控对象)。如果在步骤S602中获得肯定结果,轮廓信息满足预定轮廓条件,即该轮廓信息显示轮廓具有较长的平行于地面的横线,则处理进到步骤S603。In step S602, the contour information satisfies the predetermined contour condition? In an embodiment of the invention, the predetermined contour condition may be a horizontal line ratio of the monitored object in the foreground sub-area. Assume that the pedestrians in the surveillance scene (the first type of monitoring objects) are standing, so the line on the pedestrian is mainly a straight line perpendicular to the ground, and the vehicle (the second type of monitoring object) has a longer line because of the line above the body. Parallel to the horizontal line of the ground, so that the monitoring object in the monitoring foreground sub-area can be classified as a pedestrian (a first type of monitoring object) or a vehicle (a second type of monitoring object) according to the horizontal line ratio of the monitoring object. If an affirmative result is obtained in step S602, the outline information satisfies a predetermined contour condition, that is, the outline information display outline has a longer horizontal line parallel to the ground, the processing proceeds to step S603.
在步骤S603中,确定对应于轮廓信息的监控对象为车辆(第二类监控对象)。进一步地,可以将监控对象的统计计数中第二类监控对象的数量相应地加1。此后,处理进到步骤S604。
In step S603, it is determined that the monitoring object corresponding to the contour information is the vehicle (the second type of monitoring object). Further, the number of the second type of monitoring objects in the statistical count of the monitoring object may be correspondingly increased by one. Thereafter, the process proceeds to step S604.
相反地,如果在步骤S602中获得否定结果,轮廓信息不满足预定轮廓条件,则处理直接进到步骤S604。Conversely, if a negative result is obtained in step S602, the outline information does not satisfy the predetermined contour condition, the process proceeds directly to step S604.
在步骤S604中,从多个监控前景子区域的每一个去除对应于第二类监控对象的第二区域,以获得对应于行人(第一类监控对象)的第一区域。此后,处理进到步骤S605。In step S604, the second region corresponding to the second type of monitoring object is removed from each of the plurality of monitoring foreground sub-regions to obtain a first region corresponding to the pedestrian (the first type of monitoring object). Thereafter, the process proceeds to step S605.
在步骤S605中,基于第一区域的面积和对应于第一类监控对象的权重,确定多个监控前景子区域的每一个中第一类监控对象的第一数目。如上所述,基于多个监控前景子区域的每一个的位置,根据在步骤S304中确定的相应权重,估算在该位置的每一个行人(第一类监控对象)占据的面积大小。将在步骤S604中获得的第一区域的面积比上每一个行人(第一类监控对象)占据的面积大小,即可以得到多个监控前景子区域的每一个中的行人(第一类监控对象)的第一数目。此后,处理进到步骤S606。In step S605, a first number of the first type of monitoring objects in each of the plurality of monitoring foreground sub-areas is determined based on the area of the first area and the weight corresponding to the first type of monitoring object. As described above, based on the position of each of the plurality of monitoring foreground sub-areas, the size of the area occupied by each pedestrian (the first type of monitoring object) at the position is estimated based on the respective weights determined in step S304. The area of the first area obtained in step S604 is larger than the area occupied by each pedestrian (the first type of monitoring object), that is, the pedestrian in each of the plurality of monitoring foreground sub-areas can be obtained (the first type of monitoring object) The first number. Thereafter, the processing proceeds to step S606.
在步骤S606中,判断在步骤S605中获得的第一数目是否大于预定阈值。所述预定阈值可以理解为存在安全隐患的人群密度。如果在步骤S606中获得肯定结果,即第一数目大于预定阈值,则处理进到步骤S607。In step S606, it is determined whether the first number obtained in step S605 is greater than a predetermined threshold. The predetermined threshold can be understood as the population density in the presence of a safety hazard. If a positive result is obtained in step S606, that is, the first number is greater than the predetermined threshold, the process proceeds to step S607.
在步骤S607中,生成警告信息。根据本发明实施例的视频监控系统的操作者可以根据该警告信息实时发现存在的安全隐患,以便及时采取相应的措施。In step S607, warning information is generated. The operator of the video monitoring system according to the embodiment of the present invention can discover the existing security risks in real time according to the warning information, so as to take corresponding measures in time.
相反地,如果在步骤S606中获得否定结果,即第一数目不大于预定阈值,则处理返回步骤S601,以便继续执行实时的视频监控过程。Conversely, if a negative result is obtained in step S606, that is, the first number is not greater than the predetermined threshold, the process returns to step S601 to continue the execution of the real-time video monitoring process.
图7是图示根据本发明实施例的视频监控方法中监控对象的类型确定的示意图。FIG. 7 is a schematic diagram illustrating type determination of a monitoring object in a video monitoring method according to an embodiment of the present invention.
如图7所示,在多个监控前景子区域521、522和523中,仅有多个监控前景子区域522的轮廓信息显示其具有较长的平行于地面的横线L2,可以将该监控前景子区域522确定为存在车辆(第二类监控对象)。监控前景子区域521和523的轮廓信息都显示其主要是垂直于地面的直线H1和H3,则可以将该监控前景子区域521和523确定为存在行人(第一类监控对象)。As shown in FIG. 7, among the plurality of monitoring foreground sub-regions 52 1 , 52 2 and 52 3 , only the contour information of the plurality of monitoring foreground sub-regions 52 2 shows that they have a longer horizontal line L 2 parallel to the ground. The monitoring foreground sub-area 52 2 can be determined as the presence vehicle (the second type of monitoring object). The contour information of the monitoring foreground sub-areas 52 1 and 52 3 are both displayed as straight lines H 1 and H 3 which are mainly perpendicular to the ground, and the monitoring foreground sub-areas 52 1 and 52 3 can be determined to be pedestrians (first type of monitoring) Object).
除了能够对于监控前景子区域中的行人和车辆的数目进行统计外,根据本发明实施例的视频监控方法还能够实现监控对象的流量统计。In addition to being able to monitor the number of pedestrians and vehicles in the foreground area, the video monitoring method according to an embodiment of the present invention can also implement traffic statistics of the monitored object.
图8是进一步图示根据本发明实施例的视频监控方法中监控对象的流量统计的流程图。如图8所示,根据本发明实施例的视频监控方法中监控对
象的流量统计的流程包括以下步骤。FIG. 8 is a flowchart further illustrating flow statistics of a monitoring object in a video monitoring method according to an embodiment of the present invention. As shown in FIG. 8, the monitoring pair in the video monitoring method according to the embodiment of the present invention
The flow of the flow statistics includes the following steps.
在步骤S801中,对于垂直于监控线的第一方向,确定第一类监控对象在监控线上的移动速度。此后,处理进到步骤S802。In step S801, for the first direction perpendicular to the monitoring line, the moving speed of the first type of monitoring object on the monitoring line is determined. Thereafter, the processing proceeds to step S802.
在步骤S802中,基于移动速度,确定在预定时间间隔期间在第一方向上通过监控线的第一区域的面积。此后,处理进到步骤S803。In step S802, based on the moving speed, an area of the first area that passes the monitoring line in the first direction during the predetermined time interval is determined. Thereafter, the processing proceeds to step S803.
在步骤S803中,基于监控线上第一类监控对象的权重,确定在预定时间间隔期间在第一方向上通过监控线的第一类监控对象的数目。具体地,根据监控场景中此监控线上确定的行人权重,可以估计出行人在此监控线上面行人的平均占据的面积大小。然后把从第一帧到当前帧经过监控线的人流量(即,通过监控线的第一区域的面积)加起来,除以监控线上面行人的平均占据的面积大小,即得到截至到当前时刻的预定时间间隔期间通过监控线的行人数量。In step S803, based on the weights of the first type of monitoring objects on the monitoring line, the number of first type of monitoring objects that pass the monitoring line in the first direction during the predetermined time interval is determined. Specifically, according to the row human rights determined on the monitoring line in the monitoring scenario, the average size of the pedestrians on the monitoring line can be estimated. Then, the flow of people passing through the monitoring line from the first frame to the current frame (that is, the area of the first area passing through the monitoring line) is added up, divided by the average occupied area of the pedestrian above the monitoring line, that is, up to the current time. The number of pedestrians passing through the monitoring line during the scheduled time interval.
图9A和9B是图示根据本发明实施例的视频监控方法中监控对象的流量统计的示意图。9A and 9B are diagrams illustrating traffic statistics of a monitoring object in a video monitoring method according to an embodiment of the present invention.
如图9A所示,中间帧中的粗实线为监控线91。由椭圆圈代表的行人(第一类监控对象)在各个时刻在两个方向上(从右向左和从左向右)通过所述监控线91。As shown in FIG. 9A, the thick solid line in the intermediate frame is the monitor line 91. The pedestrian (the first type of monitoring object) represented by the elliptical circle passes through the monitoring line 91 in two directions (from right to left and from left to right) at respective times.
如图9B所示,例如仅考虑从右向左的第一方向,并且仅示意性示出一个行人。行人通过所述监控线91时存在一定的速度,当通过所述监控线91的速度越快,则会产生一个越宽的长方形,该长方形的长度则跟行人身体的宽度有关。如图9B中所示,对于时间t-4到t,求和所有长方形的面积即为在该时间段期间通过的总流量面积。结合在所述监控线91处的行人权重,可以确定该时间段期间通过的行人流量。As shown in FIG. 9B, for example, only the first direction from right to left is considered, and only one pedestrian is schematically shown. When the pedestrian passes the monitoring line 91, there is a certain speed. When the speed of passing through the monitoring line 91 is faster, a wider rectangle is generated, and the length of the rectangle is related to the width of the pedestrian body. As shown in Figure 9B, for time t-4 to t, the area of all rectangles is summed to be the total flow area that passes during that time period. In conjunction with the line of human rights at the monitoring line 91, the pedestrian flow passed during the time period can be determined.
图10是图示根据本发明实施例的视频监控系统的示意性框图。如图10所示,根据本发明实施例的视频监控系统10包括:处理器101、存储器102、以及在所述存储器102的中存储的计算机程序指令103。FIG. 10 is a schematic block diagram illustrating a video monitoring system according to an embodiment of the present invention. As shown in FIG. 10, a video surveillance system 10 in accordance with an embodiment of the present invention includes a processor 101, a memory 102, and computer program instructions 103 stored in the memory 102.
所述计算机程序指令103在所述处理器101运行时可以实现根据本发明实施例的视频监控系统的各个功能模块的功能,并且/或者可以执行根据本发明实施例的视频监控方法的各个步骤。The computer program instructions 103 may, when the processor 101 is running, implement the functions of the various functional modules of the video surveillance system in accordance with an embodiment of the present invention, and/or may perform various steps of the video surveillance method in accordance with an embodiment of the present invention.
具体地,在所述计算机程序指令103被所述处理器101运行时执行以下步骤:获取经由视频数据采集装置采集的视频数据;以及基于预先设置的场
景信息和所述视频数据,执行与所述场景信息相对应的用于监控的场景中的监控对象的确定和统计。Specifically, when the computer program instructions 103 are executed by the processor 101, the following steps are performed: acquiring video data collected via the video data collecting device; and based on a preset field
The scene information and the video data perform determination and statistics of monitoring objects in the scene for monitoring corresponding to the scene information.
此外,在所述计算机程序指令103被所述处理器101运行时执行预先设置所述场景信息的步骤,所述预先设置所述场景信息的步骤包括:配置用于监控的场景,并且设置用于监控的场景中的监控区域和监控线。Further, the step of setting the scene information in advance when the computer program instructions 103 are executed by the processor 101, the step of setting the scene information in advance includes: configuring a scene for monitoring, and setting for Monitoring area and monitoring line in the monitored scene.
此外,在所述计算机程序指令103被所述处理器101运行时执行预先设置所述场景信息的步骤还包括:基于预定模型对所述监控区域中的每个像素点进行概率估计,以获取每个像素点的概率模型,用于确定所述视频数据中的前景数据和背景数据。Further, the step of performing the setting of the scene information in advance when the computer program instructions 103 are executed by the processor 101 further comprises: performing probability estimation on each pixel point in the monitoring area based on a predetermined model to acquire each A probability model of pixels for determining foreground data and background data in the video data.
此外,在所述计算机程序指令103被所述处理器101运行时执行配置预先设置所述场景信息的步骤还包括:标记所述监控区域中的多个第一类监控对象的位置,确定每个位置的第一类监控对象相对于所述监控区域的面积的权重。Further, the step of performing configuration to pre-set the scene information when the computer program instructions 103 are executed by the processor 101 further includes: marking locations of the plurality of first-class monitoring objects in the monitoring area, determining each The weight of the first type of monitored object of the location relative to the area of the monitored area.
此外,在所述计算机程序指令103被所述处理器101运行时还执行以下步骤:基于所述概率模型,确定所述监控区域中的前景区域和背景区域,并且去除所述前景区域中的阴影区域,以获得作为监控目标的监控前景区域。Further, when the computer program instructions 103 are executed by the processor 101, the following steps are further performed: determining a foreground area and a background area in the monitoring area based on the probability model, and removing a shadow in the foreground area Area to obtain a monitoring foreground area as a monitoring target.
此外,在所述计算机程序指令103被所述处理器101运行时还执行以下步骤:将所述监控前景区域分为多个监控前景子区域,所述多个监控前景子区域相互不连通。Further, when the computer program instructions 103 are executed by the processor 101, the following steps are further performed: dividing the monitoring foreground area into a plurality of monitoring foreground sub-areas, the plurality of monitoring foreground sub-areas not communicating with each other.
此外,在所述计算机程序指令103被所述处理器101运行时执行基于所述场景信息和所述视频数据,执行所述场景中的监控对象的确定和统计的步骤包括:对于所述多个监控前景子区域的每一个执行边缘检测,获取所述监控前景子区域的轮廓信息,如果所述轮廓信息满足预定轮廓条件,则确定对应于所述轮廓信息的监控对象为第二类监控对象。Further, when the computer program instructions 103 are executed by the processor 101, performing the determining and counting of the monitored objects in the scene based on the scene information and the video data includes: for the plurality of Monitoring each of the foreground sub-areas to perform edge detection, acquiring contour information of the monitoring foreground sub-area, and if the contour information satisfies a predetermined contour condition, determining that the monitoring object corresponding to the contour information is a second type of monitoring object.
此外,在所述计算机程序指令103被所述处理器101运行时执行基于所述场景信息和所述视频数据,执行所述场景中的监控对象的确定和统计的步骤还包括:从所述多个监控前景子区域的每一个去除对应于所述第二类监控对象的第二区域,以获得对应于所述第一类监控对象的第一区域,基于所述第一区域的面积和对应于所述第一类监控对象的权重,确定所述多个监控前景子区域的每一个中所述第一类监控对象的第一数目。Further, when the computer program instructions 103 are executed by the processor 101, the step of performing determination and statistics of monitoring objects in the scene based on the scene information and the video data further includes: from the plurality of Each of the monitoring foreground sub-areas removes a second area corresponding to the second type of monitoring object to obtain a first area corresponding to the first type of monitoring object, based on an area of the first area and corresponding to The weight of the first type of monitoring object determines a first number of the first type of monitoring objects in each of the plurality of monitoring foreground sub-areas.
此外,在所述计算机程序指令103被所述处理器101运行时还执行以下
步骤:在所述第一数目大于预定阈值时,生成警告信息。Furthermore, the following is also performed when the computer program instructions 103 are executed by the processor 101
Step: Generate warning information when the first number is greater than a predetermined threshold.
此外,在所述计算机程序指令103被所述处理器101运行时执行基于所述场景信息和所述视频数据,执行所述场景中的监控对象的确定和统计的步骤还包括:对于垂直于所述监控线的第一方向,基于所述第一类监控对象在所述监控线上的移动速度,确定在预定时间间隔期间在所述第一方向上通过所述监控线的所述第一区域的面积,并且基于所述监控线上所述第一类监控对象的权重,确定在所述预定时间间隔期间在所述第一方向上通过所述监控线的所述第一类监控对象的数目。Further, when the computer program instructions 103 are executed by the processor 101, performing the step of performing determination and counting of monitoring objects in the scene based on the scene information and the video data further includes: Determining, in a first direction of the monitoring line, determining, by the moving speed of the first type of monitoring object on the monitoring line, the first area passing through the monitoring line in the first direction during a predetermined time interval Area of the first type, and based on the weight of the first type of monitoring object on the monitoring line, determining the number of the first type of monitoring objects passing the monitoring line in the first direction during the predetermined time interval .
根据本发明实施例的视频监控系统中的各模块可以通过根据本发明实施例的视频监控系统中的处理器运行在存储器中存储的计算机程序指令来实现,或者可以在根据本发明实施例的计算机程序产品的计算机可读存储介质中存储的计算机指令被计算机运行时实现。Modules in a video surveillance system in accordance with embodiments of the present invention may be implemented by computer programs stored in a memory in a video surveillance system in accordance with an embodiment of the present invention, or may be in a computer in accordance with an embodiment of the present invention The computer instructions stored in the computer readable storage medium of the program product are implemented by the computer when executed.
所述计算机可读存储介质可以是一个或多个计算机可读存储介质的任意组合,例如一个计算机可读存储介质包含用于随机地生成动作指令序列的计算机可读的程序代码,另一个计算机可读存储介质包含用于进行人脸活动识别的计算机可读的程序代码。The computer readable storage medium can be any combination of one or more computer readable storage media, for example, a computer readable storage medium includes computer readable program code for randomly generating a sequence of action instructions, and another computer can The read storage medium contains computer readable program code for performing face activity recognition.
所述计算机可读存储介质例如可以包括智能电话的存储卡、平板电脑的存储部件、个人计算机的硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM)、便携式紧致盘只读存储器(CD-ROM)、USB存储器、或者上述存储介质的任意组合。The computer readable storage medium may include, for example, a memory card of a smart phone, a storage component of a tablet, a hard disk of a personal computer, a random access memory (RAM), a read only memory (ROM), an erasable programmable read only memory. (EPROM), Portable Compact Disk Read Only Memory (CD-ROM), USB memory, or any combination of the above storage media.
在上面详细描述的本发明的示例实施例仅仅是说明性的,而不是限制性的。本领域技术人员应该理解,在不脱离本发明的原理和精神的情况下,可对这些实施例进行各种修改,组合或子组合,并且这样的修改应落入本发明的范围内。
The exemplary embodiments of the invention are described above in detail and are not intended to be limiting. It will be understood by those skilled in the art that various modifications, combinations or sub-combinations of the embodiments may be made without departing from the spirit and scope of the invention.