[go: up one dir, main page]

CN114445992A - A real-time video surveillance method - Google Patents

A real-time video surveillance method Download PDF

Info

Publication number
CN114445992A
CN114445992A CN202210134815.3A CN202210134815A CN114445992A CN 114445992 A CN114445992 A CN 114445992A CN 202210134815 A CN202210134815 A CN 202210134815A CN 114445992 A CN114445992 A CN 114445992A
Authority
CN
China
Prior art keywords
pixel
edge
gradient
picture
frame
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210134815.3A
Other languages
Chinese (zh)
Inventor
朱金荣
朱颖
夏长权
时壮壮
徐思韵
邓小颖
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yangzhou University
Original Assignee
Yangzhou University
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 Yangzhou University filed Critical Yangzhou University
Priority to CN202210134815.3A priority Critical patent/CN114445992A/en
Publication of CN114445992A publication Critical patent/CN114445992A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G08SIGNALLING
    • G08BSIGNALLING OR CALLING SYSTEMS; ORDER TELEGRAPHS; ALARM SYSTEMS
    • G08B13/00Burglar, theft or intruder alarms
    • G08B13/18Actuation by interference with heat, light, or radiation of shorter wavelength; Actuation by intruding sources of heat, light, or radiation of shorter wavelength
    • G08B13/189Actuation by interference with heat, light, or radiation of shorter wavelength; Actuation by intruding sources of heat, light, or radiation of shorter wavelength using passive radiation detection systems
    • G08B13/194Actuation by interference with heat, light, or radiation of shorter wavelength; Actuation by intruding sources of heat, light, or radiation of shorter wavelength using passive radiation detection systems using image scanning and comparing systems
    • G08B13/196Actuation by interference with heat, light, or radiation of shorter wavelength; Actuation by intruding sources of heat, light, or radiation of shorter wavelength using passive radiation detection systems using image scanning and comparing systems using television cameras
    • G08B13/19602Image analysis to detect motion of the intruder, e.g. by frame subtraction

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Image Analysis (AREA)

Abstract

本发明公开了一种实时视频监控方法,其包括采集原视频并过滤所述原视频中的声音,生成处理视频;将所述处理视频进行逐帧分解成图片集,对图片进行预处理,计算所述图片中图像边缘的像素;将所述视频中的运动物体进行检测,通过运动物体的位置,判断该帧图片画面是否异常;根据出现异常图片的帧数,判断是否需要报警。能够在进行实时视频记录的过程中对视频中的目标物行为进行检测判断,做出及时预警,对一些违规行为做出及时警示,起到防范于未然的作用。

Figure 202210134815

The invention discloses a real-time video monitoring method, which comprises collecting original video and filtering the sound in the original video to generate a processed video; decomposing the processed video frame by frame into a picture set, preprocessing the pictures, calculating Pixels at the edge of the image in the picture; detect the moving object in the video, and determine whether the frame of the picture is abnormal according to the position of the moving object; according to the number of frames in the abnormal picture, determine whether an alarm is required. In the process of real-time video recording, it can detect and judge the behavior of the target object in the video, make timely warning, and give timely warning to some violations, so as to prevent it from happening.

Figure 202210134815

Description

一种实时视频监控方法A real-time video surveillance method

技术领域technical field

本发明涉及实时视频监控技术领域,尤其涉及一种实时视频监控方法。The invention relates to the technical field of real-time video monitoring, in particular to a real-time video monitoring method.

背景技术Background technique

近年来在当今社会,随着迅速发展的科学技术以及人们内心安全意识的提高,监控系统在生活中各个领域的使用正在逐渐普及,它已能够广泛被人们应用于安防、通信和交通等行业。不仅应用,而且逐渐发展至其他公共行业。视频监控现已应用于社区超市,火车站,大型购物中心,银行和其他相关场所等对安全至关重要的情况,视频监控该系统具备的优是界面简洁、成本较低、操作便捷,使得无需耗费较多的人力资源或金钱即可让日常维护更加简易操作。In recent years, in today's society, with the rapid development of science and technology and the improvement of people's inner safety awareness, the use of monitoring systems in various fields of life is gradually popularizing, and it has been widely used in security, communication and transportation industries. Not only applied, but also gradually developed to other public industries. Video surveillance has been used in community supermarkets, railway stations, large shopping malls, banks and other related places where safety is critical. Routine maintenance can be made easier by consuming more human resources or money.

视频监控系统与人们的安全方面息息相关,如果发生盗窃,则警方只需回调当日监控视频就可以查明发生的具体情况,然后就可以根据视频监控进行推理与分析,最后成功破案,现有的视频监控系统只能进行视频记录,不能对视频中的目标物行为进行检测判断,不能做出及时预警,难以对一些违规行为做出及时警示,只能事后进行追溯,难以起到防范于未然的作用。The video surveillance system is closely related to people's safety. If theft occurs, the police only need to recall the surveillance video of the day to find out what happened, and then they can reason and analyze based on the video surveillance, and finally solve the case successfully. The monitoring system can only record video, cannot detect and judge the behavior of the target in the video, and cannot make timely warnings, and it is difficult to give timely warnings to some violations. .

发明内容SUMMARY OF THE INVENTION

本部分的目的在于概述本发明的实施例的一些方面以及简要介绍一些较佳实施例。在本部分以及本申请的说明书摘要和发明名称中可能会做些简化或省略以避免使本部分、说明书摘要和发明名称的目的模糊,而这种简化或省略不能用于限制本发明的范围。The purpose of this section is to outline some aspects of embodiments of the invention and to briefly introduce some preferred embodiments. Some simplifications or omissions may be made in this section and the abstract and title of the application to avoid obscuring the purpose of this section, abstract and title, and such simplifications or omissions may not be used to limit the scope of the invention.

鉴于上述现有存在的问题,提出了本发明。The present invention has been proposed in view of the above-mentioned existing problems.

因此,本发明解决的技术问题是:现有的视频监控系统只能进行视频记录,不能对视频中的目标物行为进行检测判断,不能做出及时预警,难以对一些违规行为做出及时警示,只能事后进行追溯,难以起到防范于未然的作用。Therefore, the technical problem solved by the present invention is: the existing video monitoring system can only perform video recording, cannot detect and judge the behavior of the target object in the video, cannot make timely warning, and is difficult to give timely warning to some violations, It can only be traced back after the event, and it is difficult to prevent it before it happens.

为解决上述技术问题,本发明提供如下技术方案:采集原视频并过滤所述原视频中的声音,生成处理视频;将所述处理视频进行逐帧分解成图片集,对图片进行预处理,计算所述图片中图像边缘的像素;将所述视频中的运动物体进行检测,通过运动物体的位置,判断该帧图片画面是否异常;根据出现异常图片的帧数,判断是否需要报警。In order to solve the above technical problems, the present invention provides the following technical solutions: collecting the original video and filtering the sound in the original video to generate a processed video; decomposing the processed video frame by frame into a picture set, preprocessing the pictures, calculating Pixels at the edge of the image in the picture; detect the moving object in the video, and determine whether the frame of the picture is abnormal according to the position of the moving object; according to the number of frames in the abnormal picture, determine whether an alarm is required.

作为本发明所述的实时视频监控方法的一种优选方案,其中:采集摄像头所拍摄的原视频,将原视频输入计算机中,通过高斯滤波器过滤原视频中的声音。As a preferred solution of the real-time video monitoring method of the present invention, the original video captured by the camera is collected, the original video is input into a computer, and the sound in the original video is filtered through a Gaussian filter.

作为本发明所述的实时视频监控方法的一种优选方案,其中:将所述处理视频进行逐帧分解成图片集,通过Canny算法对所述图片集中的图片进行平滑处理,计算所述图片中图像边缘的像素的梯度强度和方向,表达式如下:As a preferred solution of the real-time video monitoring method of the present invention, wherein: the processed video is decomposed into picture sets frame by frame, the pictures in the picture set are smoothed by the Canny algorithm, and the The gradient strength and direction of the pixels at the edge of the image are expressed as:

Figure BDA0003504048430000021
Figure BDA0003504048430000021

其中,σ表示是标准差,sigma=1.4,e表示像素,那么经历高斯滤波,e的亮度的值表达式如下:Among them, σ represents the standard deviation, sigma=1.4, and e represents the pixel, then after Gaussian filtering, the value of the brightness of e is expressed as follows:

Figure BDA0003504048430000022
Figure BDA0003504048430000022

其中,*表示卷积的符号,sum表示设定矩阵中所有元素之和。Among them, * represents the symbol of convolution, and sum represents the sum of all elements in the set matrix.

作为本发明所述的实时视频监控方法的一种优选方案,其中:所述像素的每个方向都可以由图像中的边缘所瞄准,通过Canny算法检测图像的垂直、水平和对角边缘这四个方向。通过代表边缘检测的垂直与水平方向的算子,如水平方向的Gx和垂直方向的Gy的所得出一阶导数值,可以推测出像素的方向theta和像素的梯度G:As a preferred solution of the real-time video monitoring method of the present invention, wherein: each direction of the pixel can be targeted by the edge in the image, and the four vertical, horizontal and diagonal edges of the image are detected by the Canny algorithm. direction. Through the operators representing the vertical and horizontal directions of edge detection, such as the first derivative values of G x in the horizontal direction and G y in the vertical direction, the direction theta of the pixel and the gradient G of the pixel can be inferred:

Figure BDA0003504048430000023
Figure BDA0003504048430000023

其中,G代表梯度强度,Gx代表x方向的梯度幅值,Gy代表y方向梯度的幅值,theta代表像素的方向,arctan为公式中应用到的反正切函数,x以及y方向的Sobel算子可以分别表示为:Among them, G represents the gradient strength, G x represents the gradient amplitude in the x direction, G y represents the gradient amplitude in the y direction, theta represents the direction of the pixel, arctan is the arc tangent function applied in the formula, and Sobel in the x and y directions The operators can be expressed as:

Figure BDA0003504048430000024
Figure BDA0003504048430000024

其中,Sx表示x方向的Sobel算子,用于检测边缘方向为y的方向,Sy表示y方向的Sobel算子,用于检测边缘方向为x的方向。Among them, Sx represents the Sobel operator in the x direction, which is used to detect the direction where the edge direction is y, and Sy represents the Sobel operator in the y direction, which is used to detect the direction where the edge direction is x.

作为本发明所述的实时视频监控方法的一种优选方案,其中:对边缘像素的非极大值抑制,比较是单个像素所拥有的梯度强度,将目前像素的梯度强度同一时刻和其它两个像素作类比,当目前像素的梯度强度大于其它两个像素,保存目前像素,将目前像素作为边缘,其关系表达式和非极大值抑制相关的伪代码如下:As a preferred solution of the real-time video monitoring method of the present invention, wherein: the non-maximum value suppression of edge pixels is compared to the gradient strength possessed by a single pixel, and the gradient strength of the current pixel at the same time and the other two Taking the pixel as an analogy, when the gradient strength of the current pixel is greater than the other two pixels, the current pixel is saved and the current pixel is used as the edge. The relational expression and the pseudocode related to non-maximum suppression are as follows:

Figure BDA0003504048430000031
Figure BDA0003504048430000031

其中,tan为正切函数,θ代表角度,theta是P的梯度方向,P代表像素,P1代表目前像素1,P2代表类比像素。Among them, tan is the tangent function, θ represents the angle, theta is the gradient direction of P, P represents the pixel, P1 represents the current pixel 1, and P2 represents the analog pixel.

作为本发明所述的实时视频监控方法的一种优选方案,其中:对边缘像素需要使用弱梯度值进行过滤,并保存某些边缘像素,具有高梯度值性质的,强边缘像素的梯度值高于所拟定好的高阈值,弱边缘像素的梯度值小于拟定好的高阈值并且大于拟定好的低阈值,当边缘像素的梯度值小于拟定好的低阈值,该像素就会被抑制,得出双阈值检测的伪代码,具体表达式如下:As a preferred solution of the real-time video monitoring method of the present invention, wherein: edge pixels need to be filtered with weak gradient values, and some edge pixels are saved, and those with high gradient value properties, strong edge pixels have high gradient values. For the proposed high threshold, the gradient value of the weak edge pixel is smaller than the proposed high threshold and greater than the proposed low threshold. When the gradient value of the edge pixel is less than the proposed low threshold, the pixel will be suppressed, and the result is The pseudo code of double threshold detection, the specific expression is as follows:

Figure BDA0003504048430000032
Figure BDA0003504048430000032

作为本发明所述的实时视频监控方法的一种优选方案,其中:运动物体的影像是位置在不同图像的帧中都不相同,通过图片集周围相邻的两帧图片之间所体现出的差异来计算并分析出所变化的像素,基于目标的运动伴随时间的改变而改变,体现出较强的连续性,图片里有关背景点的像素变化趋于零,在阈值判断的前提下进行处理,相减的两帧的帧数表示为第k帧以及第(k+1)帧,帧的图像可以表现为Ik(x,y)、Ik+1(x,y),同时差分图像表示为D(x,y),它的二值化阈值为T,则相对应的帧间差分法的公式如下:As a preferred solution of the real-time video monitoring method according to the present invention, wherein: the position of the image of the moving object is different in the frames of the different images, and the position of the image of the moving object is different in the frames of the different images. Differences to calculate and analyze the changed pixels, based on the movement of the target changes with the change of time, reflecting strong continuity, the pixel changes of the background points in the picture tend to zero, and the processing is performed under the premise of threshold judgment. The frame numbers of the two subtracted frames are expressed as the kth frame and the (k+1)th frame, and the images of the frames can be expressed as I k (x, y), I k+1 (x, y), and the differential image is expressed as is D(x,y), and its binarization threshold is T, the corresponding formula of the inter-frame difference method is as follows:

Figure BDA0003504048430000033
Figure BDA0003504048430000033

其中,Ix(x,y)表示第k帧图像,Ik+1(x,y)表示第(k+1)帧图像,T为二值化阈值,D(x,y)表示一个二值函数,255这个数值表明发生在两帧图像中的像素点产生了较为明显的变化,此时该像素点位于运动区域,0这个数值表明像素点几乎没有变化,代表的是背景区域,T代表拟定好的阈值。Among them, I x (x, y) represents the k-th frame image, I k+1 (x, y) represents the (k+1)-th frame image, T is the binarization threshold, and D(x, y) represents a binary Value function, the value of 255 indicates that the pixels in the two frames of images have undergone significant changes. At this time, the pixel is located in the motion area. The value of 0 indicates that the pixel has almost no change, representing the background area. T stands for the established threshold.

作为本发明所述的实时视频监控方法的一种优选方案,其中:阈值T取值的范围大小用于调节检测目标区域的灵敏度与准确度,当阈值T取值相对较小时,会使得某些噪声或者背景也被错误的当成运动目标,当阈值T取值较大时,会导致运动区域范围内的一小部分未被提取出来。As a preferred solution of the real-time video monitoring method of the present invention, the range of the threshold value T is used to adjust the sensitivity and accuracy of the detection target area. When the threshold value T is relatively small, some Noise or background is also mistakenly regarded as a moving target. When the threshold value T is large, a small part of the moving area will not be extracted.

作为本发明所述的实时视频监控方法的一种优选方案,其中:当图片画面中检测目标区域中出现异常,定义该图片为异常图片,预先设定异常图片连续出现的帧数,当异常图片出现次数大于所述帧数触发警报。As a preferred solution of the real-time video monitoring method of the present invention, wherein: when an abnormality occurs in the detection target area in the picture picture, the picture is defined as an abnormal picture, and the number of consecutive frames of the abnormal picture is preset. Occurrences greater than the number of frames trigger an alarm.

本发明的有益效果:能够在进行实时视频记录的过程中对视频中的目标物行为进行检测判断,做出及时预警,对一些违规行为做出及时警示,起到防范于未然的作用。The beneficial effects of the invention are: in the process of real-time video recording, the behavior of the target object in the video can be detected and judged, and a timely warning can be given, and some illegal behaviors can be given a timely warning, which plays a preventive role.

附图说明Description of drawings

为了更清楚地说明本发明实施例的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其它的附图。其中:In order to illustrate the technical solutions of the embodiments of the present invention more clearly, the following briefly introduces the accompanying drawings used in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings without any creative effort. in:

图1为本发明一个实施例提供的一种实时视频监控方法的基本流程示意图;1 is a schematic flowchart of a basic flow of a real-time video monitoring method provided by an embodiment of the present invention;

图2为本发明一个实施例提供的一种实时视频监控方法的图像处理图;2 is an image processing diagram of a real-time video monitoring method provided by an embodiment of the present invention;

图3为本发明一个实施例提供的一种实时视频监控方法误差比较图。FIG. 3 is an error comparison diagram of a real-time video monitoring method provided by an embodiment of the present invention.

具体实施方式Detailed ways

为使本发明的上述目的、特征和优能够更加明显易懂,下面结合说明书附图对本发明的具体实施方式做详细的说明,显然所描述的实施例是本发明的一部分实施例,而不是全部实施例。基于本发明中的实施例,本领域普通人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本发明的保护的范围。In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are a part of the embodiments of the present invention, not all of them. Example. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

在下面的描述中阐述了很多具体细节以便于充分理解本发明,但是本发明还可以采用其他不同于在此描述的其它方式来实施,本领域技术人员可以在不违背本发明内涵的情况下做类似推广,因此本发明不受下面公开的具体实施例的限制。Many specific details are set forth in the following description to facilitate a full understanding of the present invention, but the present invention can also be implemented in other ways different from those described herein, and those skilled in the art can do so without departing from the connotation of the present invention. Similar promotion, therefore, the present invention is not limited by the specific embodiments disclosed below.

其次,此处所称的“一个实施例”或“实施例”是指可包含于本发明至少一个实现方式中的特定特征、结构或特性。在本说明书中不同地方出现的“在一个实施例中”并非均指同一个实施例,也不是单独的或选择性的与其他实施例互相排斥的实施例。Second, reference herein to "one embodiment" or "an embodiment" refers to a particular feature, structure, or characteristic that may be included in at least one implementation of the present invention. The appearances of "in one embodiment" in various places in this specification are not all referring to the same embodiment, nor are they separate or selectively mutually exclusive from other embodiments.

本发明结合示意图进行详细描述,在详述本发明实施例时,为便于说明,表示器件结构的剖面图会不依一般比例作局部放大,而且示意图只是示例,其在此不应限制本发明保护的范围。此外,在实际制作中应包含长度、宽度及深度的三维空间尺寸。The present invention is described in detail with reference to the schematic diagrams. When describing the embodiments of the present invention in detail, for the convenience of explanation, the cross-sectional views showing the device structure will not be partially enlarged according to the general scale, and the schematic diagrams are only examples, which should not limit the protection of the present invention. scope. In addition, the three-dimensional spatial dimensions of length, width and depth should be included in the actual production.

同时在本发明的描述中,需要说明的是,术语中的“上、下、内和外”等指示的方位或位置关系为基于附图所示的方位或位置关系,仅是为了便于描述本发明和简化描述,而不是指示或暗示所指的装置或元件必须具有特定的方位、以特定的方位构造和操作,因此不能理解为对本发明的限制。此外,术语“第一、第二或第三”仅用于描述目的,而不能理解为指示或暗示相对重要性。At the same time, in the description of the present invention, it should be noted that the orientation or positional relationship indicated in terms such as "upper, lower, inner and outer" is based on the orientation or positional relationship shown in the accompanying drawings, which is only for the convenience of describing the present invention. The invention and simplified description do not indicate or imply that the device or element referred to must have a particular orientation, be constructed and operate in a particular orientation, and therefore should not be construed as limiting the invention. Furthermore, the terms "first, second or third" are used for descriptive purposes only and should not be construed to indicate or imply relative importance.

本发明中除非另有明确的规定和限定,术语“安装、相连、连接”应做广义理解,例如:可以是固定连接、可拆卸连接或一体式连接;同样可以是机械连接、电连接或直接连接,也可以通过中间媒介间接相连,也可以是两个元件内部的连通。对于本领域的普通技术人员而言,可以具体情况理解上述术语在本发明中的具体含义。Unless otherwise expressly specified and limited in the present invention, the term "installation, connection, connection" should be understood in a broad sense, for example: it may be a fixed connection, a detachable connection or an integral connection; it may also be a mechanical connection, an electrical connection or a direct connection. The connection can also be indirectly connected through an intermediate medium, or it can be the internal communication between two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood in specific situations.

实施例1Example 1

参照图1,为本发明的一个实施例,提供了一种实时视频监控方法,包括:Referring to FIG. 1, an embodiment of the present invention provides a real-time video monitoring method, including:

S1:采集原视频并过滤原视频中的声音,生成处理视频。S1: Capture the original video and filter the sound in the original video to generate a processed video.

首先要实现摄像头的调用得先安装硬件支持包,可以在matlab R2015a的开始菜单栏下的附加功能找到,否则将无法使用电脑自带摄像头或者其他摄像头。First of all, to realize the call of the camera, you must first install the hardware support package, which can be found in the additional functions under the start menu bar of matlab R2015a, otherwise you will not be able to use the computer's own camera or other cameras.

打开的”附加功能管理器”页面,有很多设备,不过我们需要再右上角的搜索框中,搜索”camera”,再点击搜索进入搜索页面。The "Additional Features Manager" page that opens has many devices, but we need to search for "camera" in the search box in the upper right corner, and then click Search to enter the search page.

搜索出15个结果,点击排名第一的标题就可以进入详情页。After 15 results are found, click on the top title to enter the details page.

点击右上角的安装,会提示选择”安装”和”仅下载”,选择安装,稍等片刻即可。Click Install in the upper right corner, you will be prompted to select "Install" and "Download Only", select Install, and wait for a while.

安装完成后,在matlab的app菜单下找到image acquisition,点进去就可以使用摄像头了,安装好要进入image acquisition中使用摄像头。After the installation is complete, find image acquisition under the app menu of matlab, click on it, and you can use the camera. After installation, you need to enter the image acquisition to use the camera.

采集摄像头所拍摄的原视频,将原视频输入计算机中,通过高斯滤波器过滤原视频中的声音。Capture the original video shot by the camera, input the original video into the computer, and filter the sound in the original video through a Gaussian filter.

在进行图像分析的处理过程中,能够影响设计的准确性和算法的有效性的是图像质量,所以对图像进行分析之前,需要对它进行一定的预处理。消除没有意义的信息,恢复有意义的信息,提高有效信息的检测性,极大程度的简化数据是图像预处理的主要目的,从而可以提高后续图像处理的可靠性。In the process of image analysis, it is the image quality that can affect the accuracy of the design and the effectiveness of the algorithm, so it needs to be preprocessed before the image is analyzed. Eliminating meaningless information, restoring meaningful information, improving the detection of effective information, and simplifying data to a great extent are the main purposes of image preprocessing, which can improve the reliability of subsequent image processing.

S2:将处理视频进行逐帧分解成图片集,对图片进行预处理,计算图片中图像边缘的像素。S2: Decompose the processed video frame by frame into a picture set, preprocess the picture, and calculate the pixels of the image edge in the picture.

在图像中找出具有个别使梯度幅值最大的像素点是该算法所具备的基本思想。检测阶跃边缘的大多数任务汇集在找到可以贴近图像的梯度数字。It is the basic idea of this algorithm to find out the pixels with the individual maximum gradient magnitude in the image. Most tasks in detecting step edges converge on finding gradient numbers that approximate the image.

在现实显示的图像之中,低通滤波器的平滑是摄像机光学系统以及电路系统原本就有的,所以,它的阶跃边缘一般来说陡立性不是很强。In the actual displayed image, the smoothing of the low-pass filter is inherent in the camera's optical system and circuit system, so its step edge is generally not very steep.

采用高斯滤波器来达成平滑图像的目的;计算梯度的幅值和方向,可以使用的方法是一阶偏导的有限差分;采用非极大值,这样可以对梯度幅值进行抑制;利用双阈值的算法,可以进行检测,同时采取边缘连接。Using Gaussian filter to achieve the purpose of smoothing the image; calculating the magnitude and direction of the gradient, the method that can be used is the finite difference of the first-order partial derivative; using a non-maximum value, which can suppress the gradient magnitude; using double thresholds An algorithm that can perform detection while taking edge connections.

通过Canny算法进行平滑滤波,边缘检测会带来不同的作用效果,为最大程度减少噪声对实验数据的影响,需要进行一定的操作来滤除这种噪声,当然也可以防止带来由此所引发的错误检测。为平滑所处理的图像,需要进行卷积,卷积的对象就是图像以及高斯滤波器,卷积后即可将图像平滑,而边缘检测器的噪声所带来的影响就可以大幅减少。将处理视频进行逐帧分解成图片集,通过Canny算法对图片集中的图片进行平滑处理,优化的部分是在最后一步采用抑制孤立的弱边缘的方法实现边缘检测,使得获得的图像边缘轮廓更加清晰,计算图片中图像边缘的像素的梯度强度和方向,表达式如下:Smooth filtering through Canny algorithm, edge detection will bring different effects, in order to minimize the impact of noise on experimental data, it is necessary to carry out certain operations to filter out this noise, of course, it can also prevent the error detection. In order to smooth the processed image, convolution needs to be performed. The objects of convolution are the image and the Gaussian filter. After convolution, the image can be smoothed, and the influence of the noise of the edge detector can be greatly reduced. The processed video is decomposed into a picture set frame by frame, and the pictures in the picture set are smoothed by the Canny algorithm. The optimized part is to use the method of suppressing the isolated weak edge to realize edge detection in the last step, so that the obtained image edge contour is clearer , calculate the gradient intensity and direction of the pixels at the edge of the image in the image, and the expressions are as follows:

Figure BDA0003504048430000061
Figure BDA0003504048430000061

其中,σ表示是标准差,sigma=1.4,e表示像素,那么经历高斯滤波,e的亮度的值表达式如下:Among them, σ represents the standard deviation, sigma=1.4, and e represents the pixel, then after Gaussian filtering, the value of the brightness of e is expressed as follows:

Figure BDA0003504048430000071
Figure BDA0003504048430000071

其中,*表示卷积的符号,sum表示设定矩阵中所有元素之和。Among them, * represents the symbol of convolution, and sum represents the sum of all elements in the set matrix.

像素的每个方向都可以由图像中的边缘所瞄准,通过Canny算法检测图像的垂直、水平和对角边缘这四个方向。通过代表边缘检测的垂直与水平方向的算子,如水平方向的Gx和垂直方向的Gy的所得出一阶导数值,可以推测出像素的方向theta和像素的梯度G:Each direction of the pixel can be targeted by the edge in the image, and the four directions of vertical, horizontal and diagonal edges of the image are detected by the Canny algorithm. Through the operators representing the vertical and horizontal directions of edge detection, such as the first derivative values of G x in the horizontal direction and G y in the vertical direction, the direction theta of the pixel and the gradient G of the pixel can be inferred:

Figure BDA0003504048430000072
Figure BDA0003504048430000072

其中,G代表梯度强度,Gx代表x方向的梯度幅值,Gy代表y方向梯度的幅值,theta代表像素的方向,arctan为公式中应用到的反正切函数,x以及y方向的Sobel算子可以分别表示为:Among them, G represents the gradient strength, G x represents the gradient amplitude in the x direction, G y represents the gradient amplitude in the y direction, theta represents the direction of the pixel, arctan is the arc tangent function applied in the formula, and Sobel in the x and y directions The operators can be expressed as:

Figure BDA0003504048430000073
Figure BDA0003504048430000073

其中,Sx表示x方向的Sobel算子,用于检测边缘方向为y的方向,Sy表示y方向的Sobel算子,用于检测边缘方向为x的方向。Among them, Sx represents the Sobel operator in the x direction, which is used to detect the direction where the edge direction is y, and Sy represents the Sobel operator in the y direction, which is used to detect the direction where the edge direction is x.

对边缘像素的非极大值抑制,比较是单个像素所拥有的梯度强度,将目前像素的梯度强度同一时刻和其它两个像素作类比,当目前像素的梯度强度大于其它两个像素,保存目前像素,将目前像素作为边缘,The non-maximum suppression of edge pixels is compared to the gradient strength of a single pixel, and the gradient strength of the current pixel is compared with the other two pixels at the same time. When the gradient strength of the current pixel is greater than the other two pixels, save the current pixel. pixel, using the current pixel as the edge,

非极大值抑制,它的效果体现在能够“瘦”边。对图像进行相关的计算,例如梯度计算之后,只是采用梯度值提取的边缘看起来依旧不是很清楚,依旧有些模糊看不清。为了将局部最大值外所有的梯度值抑制到零的程度,可以借用非极大值抑制的方法,具体步骤如下:Non-maximum suppression, its effect is reflected in the ability to "thin" sides. After performing related calculations on the image, such as gradient calculation, the edge extracted by the gradient value is still not very clear, and it is still somewhat blurred. In order to suppress all gradient values outside the local maximum to zero, the method of non-maximum suppression can be borrowed. The specific steps are as follows:

1)需要进行比较的一个是目前像素所拥有的梯度强度,另一个是与沿正负梯度方向上所拥有的两个像素的梯度强度。1) The one that needs to be compared is the gradient strength of the current pixel, and the other is the gradient strength of the two pixels along the positive and negative gradient directions.

2)将目前像素的梯度强度同一时刻和其它两个像素作类比,当发现目前像素的最大,那么当前像素点可以保存,并且可以作为边缘点,如果结果并非如此,那么当前像素点就被抑制。2) Compare the gradient intensity of the current pixel with the other two pixels at the same time. When the current pixel is found to be the largest, the current pixel can be saved and used as an edge point. If the result is not the same, then the current pixel is suppressed. .

一般为了计算的结果更加的精确,将线性插值的方法使用在超越梯度方向的两个邻近像素之间,这样可以获得需要比较的像素梯度。Generally, in order to obtain a more accurate calculation result, a linear interpolation method is used between two adjacent pixels beyond the gradient direction, so that the pixel gradients that need to be compared can be obtained.

经过上述步骤后,实际边缘可以用余下的像素来进行更准确地表现。但是,依旧有一些边缘像素,它们是由颜色和噪声变化所引起的。面对这些需要处理的杂散响应,边缘像素需要使用弱梯度值进行过滤,并保存某些边缘像素,具有高梯度值性质的。通常为了实现这个目的,一般使用高、低阈值。强边缘像素的定义是边缘像素的梯度值高于所拟定好的高阈值;弱边缘像素定义为边缘像素的梯度值小于拟定好的高阈值并且大于拟定好的低阈值;当边缘像素的梯度值小于拟定好的低阈值,该像素就会被抑制。输入图像的内容能够决定阈值的选择,其关系表达式和非极大值抑制相关的伪代码如下:After the above steps, the actual edge can be more accurately represented with the remaining pixels. However, there are still some edge pixels, which are caused by color and noise changes. Faced with these stray responses that need to be processed, edge pixels need to be filtered with weak gradient values, and some edge pixels with high gradient values are saved. Usually for this purpose, high and low thresholds are generally used. The definition of strong edge pixels is that the gradient value of edge pixels is higher than the proposed high threshold; weak edge pixels are defined as the gradient value of edge pixels is less than the proposed high threshold and greater than the proposed low threshold; when the gradient value of edge pixels Below the proposed low threshold, the pixel will be suppressed. The content of the input image can determine the choice of threshold, and the pseudocode related to the relational expression and non-maximum suppression is as follows:

Figure BDA0003504048430000081
Figure BDA0003504048430000081

其中,tan为正切函数,θ代表角度,theta是P的梯度方向,P代表像素,P1代表目前像素1,P2代表类比像素。Among them, tan is the tangent function, θ represents the angle, theta is the gradient direction of P, P represents the pixel, P1 represents the current pixel 1, and P2 represents the analog pixel.

S3:将视频中的运动物体进行检测,通过运动物体的位置,判断该帧图片画面是否异常。S3: Detect the moving object in the video, and determine whether the picture of the frame is abnormal through the position of the moving object.

背景差分法可以应用于静止摄像机的背景提取算法,需择取静止的景物作为参考背景,此时图像里的像素点皆对应一个关于背景的数值,背景值是相对不变的。将图像序列中每个点的背景值择取出来就是背景择取的目的。连续性是摄像机采集视频序列所拥有的特点。当运动目标没有出现在监控的场景内时,这个时刻所获取的连续帧就会发生不是很明显,几乎微弱的变化效果。但是当运动目标出现的时候,一直连续的帧和帧之间的变换就会变得鲜明。The background difference method can be applied to the background extraction algorithm of the still camera. It is necessary to select a still scene as the reference background. At this time, the pixels in the image all correspond to a value about the background, and the background value is relatively unchanged. The purpose of background selection is to select the background value of each point in the image sequence. Continuity is a feature of video sequences captured by cameras. When the moving target does not appear in the monitored scene, the continuous frames obtained at this moment will have an inconspicuous, almost faint change effect. But when moving objects appear, the constant frame-to-frame transitions become stark.

运动物体的影像是位置在不同图像的帧中都不相同,通过图片集周围相邻的两帧图片之间所体现出的差异来计算并分析出所变化的像素,基于目标的运动伴随时间的改变而改变,体现出较强的连续性,图片里有关背景点的像素变化趋于零,在阈值判断的前提下进行处理,相减的两帧的帧数表示为第k帧以及第(k+1)帧,帧的图像可以表现为Ik(x,y)、Ik+1(x,y),同时差分图像表示为D(x,y),它的二值化阈值为T,则相对应的帧间差分法的公式如下:The position of the moving object is different in different frames of the image. The changed pixels are calculated and analyzed by the difference between the two adjacent frames around the picture set. The movement of the object changes with time. However, the change reflects a strong continuity. The pixel changes of the relevant background points in the picture tend to be zero, and the processing is carried out under the premise of threshold judgment. The frame numbers of the two subtracted frames are expressed as the kth frame and (k+th) 1) Frame, the image of the frame can be expressed as I k (x, y), I k+1 (x, y), and the differential image is expressed as D(x, y), and its binarization threshold is T, then The corresponding formula of the inter-frame difference method is as follows:

Figure BDA0003504048430000091
Figure BDA0003504048430000091

其中,Ix(x,y)表示第k帧图像,Ik+1(x,y)表示第(k+1)帧图像,T为二值化阈值,D(x,y)表示一个二值函数,255这个数值表明发生在两帧图像中的像素点产生了较为明显的变化,此时该像素点位于运动区域,0这个数值表明像素点几乎没有变化,代表的是背景区域,T代表拟定好的阈值,阈值T取值的范围大小对检测目标区域的灵敏度与准确度起决定作用。当阈值T取值相对较小时,会使得某些噪声或者背景也被错误的当成运动目标,当阈值T取值较大时,会导致运动区域范围内的一小部分未被提取出来,所以要选择一个适当的阈值T。Among them, I x (x, y) represents the k-th frame image, I k+1 (x, y) represents the (k+1)-th frame image, T is the binarization threshold, and D(x, y) represents a binary Value function, the value of 255 indicates that the pixels in the two frames of images have undergone significant changes. At this time, the pixel is located in the motion area. The value of 0 indicates that the pixel has almost no change, representing the background area. T stands for The proposed threshold and the range of the threshold value T play a decisive role in the sensitivity and accuracy of detecting the target area. When the value of the threshold T is relatively small, some noises or backgrounds will be mistakenly regarded as moving targets. When the value of the threshold T is relatively large, a small part of the moving area will not be extracted. Choose an appropriate threshold T.

阈值T取值的范围大小用于调节检测目标区域的灵敏度与准确度,当阈值T取值相对较小时,会使得某些噪声或者背景也被错误的当成运动目标,当阈值T取值较大时,会导致运动区域范围内的一小部分未被提取出来。The range of the threshold value T is used to adjust the sensitivity and accuracy of the detection target area. When the threshold value T is relatively small, some noise or background will be mistakenly regarded as moving targets. When the threshold value T is large , a small part of the motion area is not extracted.

S4:根据出现异常图片的帧数,判断是否需要报警,当图片画面中检测目标区域中出现异常,定义该图片为异常图片,预先设定异常图片连续出现的帧数,当异常图片出现次数大于帧数触发警报,帧间差分法通常选取时间上连续的两帧,亦或是连续的三帧当做参与运算的图像,其总体优势是原理简单、计算方法简易、能够实时检测出监控区域内运动的像素。S4: According to the number of frames of abnormal pictures, determine whether an alarm is required. When there is an abnormality in the detection target area in the picture screen, define the picture as an abnormal picture, and preset the number of consecutive frames of abnormal pictures. When the number of abnormal pictures occurs is greater than The number of frames triggers the alarm. The inter-frame difference method usually selects two consecutive frames in time, or three consecutive frames as the images involved in the calculation. The overall advantage is that the principle is simple, the calculation method is simple, and the movement in the monitoring area can be detected in real time. of pixels.

实施例2Example 2

参照图2和3为本发明另一个实施例,该实施例不同于第一个实施例的是,提供了一种实时视频监控方法的验证测试,为对本方法中采用的技术效果加以验证说明,本实施例采用传统技术方案与本发明方法进行对比测试,以科学论证的手段对比试验结果,以验证本方法所具有的真实效果。2 and 3 are another embodiment of the present invention, this embodiment is different from the first embodiment in that a verification test of a real-time video monitoring method is provided, in order to verify the technical effect adopted in the method and explain, In this embodiment, the traditional technical solution and the method of the present invention are used to carry out a comparative test, and the test results are compared by means of scientific demonstration, so as to verify the real effect of the method.

在实时视频数据采集方面,本实验系统采用了笔记本自带的摄像头,并通过videoinput函数打开系统摄像头,利用videoTimerFcn函数获取视频流,同时借用avp函数完成实时语音报警功能播放。在运动目标的检测这方面,本系统采用了帧间差分法,该差分法简单易懂,适用于运动目标,能有效提高检测效率。该程序由一个整体的.m文件执行。当有物体经过摄像头时,figure界面周围变红,并及时发出语音报警,同时拍摄当前画面发送到紧急联系人的邮箱中,表示异常状态。如果没有目标经过摄像头监控范围,那么figure周围画面显示灰色,表示正常状态。In terms of real-time video data collection, this experimental system uses the camera that comes with the notebook, and uses the videoinput function to open the system camera, uses the videoTimerFcn function to obtain the video stream, and uses the avp function to complete the real-time voice alarm function playback. In the detection of moving targets, the system adopts the inter-frame difference method, which is simple and easy to understand, suitable for moving targets, and can effectively improve the detection efficiency. The program is executed by a monolithic .m file. When an object passes through the camera, the surrounding of the figure interface turns red, and a voice alarm is issued in time, and the current picture is captured and sent to the mailbox of the emergency contact, indicating an abnormal state. If no target passes through the monitoring range of the camera, the screen around the figure is grayed out, indicating a normal state.

为了确保检测目标区域的灵敏度与准确度,我们进行了多组实验,以便获取最佳运动参数阈值参数,如下表所示:In order to ensure the sensitivity and accuracy of detecting the target area, we conducted multiple sets of experiments in order to obtain the optimal motion parameter threshold parameters, as shown in the following table:

表1:静态背景下的图像平均误差值表。Table 1: Table of mean error values for images on static backgrounds.

Figure BDA0003504048430000101
Figure BDA0003504048430000101

表2:动态背景下的图像平均误差值表。Table 2: Table of image mean error values under dynamic background.

Figure BDA0003504048430000102
Figure BDA0003504048430000102

由于静态背景下的图像平均误差值小于0.05,而在动态背景下的图像平均误差值大0.05,所以选取0.05作为运动参数阈值比较合适,此时检测目标区域的灵敏度与准确度最佳。Since the average error value of the image under the static background is less than 0.05, and the average error value of the image under the dynamic background is larger than 0.05, it is more appropriate to select 0.05 as the motion parameter threshold. At this time, the sensitivity and accuracy of detecting the target area are the best.

经实验证明,运动参数阈值取值为0.05,声音阈值参数取值为1.0,每次触发图像的帧数取值为10时,系统运行效果最佳。该系统通过对原图像进行获取,采取Canny优化算法对原图像进行边缘检测,再进行帧间差分法。当结果大于某个特定值时,实时显示的画面周围变红并发出警报,在此基础上进行了两组动态环境监测实验,结果表明,该实时视频监控系统具有简洁明了的操作界面、较准的实时性、较高的安全性、较强的可靠性等优点,能够实时监测室内对应区域的运动目标的信息,做出及时预警,对一些违规行为做出及时警示,能够起到防范于未然的作用。Experiments show that the motion parameter threshold is 0.05, the sound threshold parameter is 1.0, and the system works best when the frame number of each trigger image is 10. The system acquires the original image, adopts the Canny optimization algorithm to detect the edge of the original image, and then performs the inter-frame difference method. When the result is greater than a certain value, the surrounding of the real-time display screen turns red and an alarm is issued. On this basis, two groups of dynamic environment monitoring experiments are carried out. The results show that the real-time video monitoring system has a simple and clear operation interface, accurate It has the advantages of real-time, high security, and strong reliability. It can monitor the information of moving targets in the corresponding indoor area in real time, make timely warnings, and give timely warnings to some violations, which can prevent them from happening. effect.

应当认识到,本发明的实施例可以由计算机硬件、硬件和软件的组合、或者通过存储在非暂时性计算机可读存储器中的计算机指令来实现或实施。所述方法可以使用标准编程技术-包括配置有计算机程序的非暂时性计算机可读存储介质在计算机程序中实现,其中如此配置的存储介质使得计算机以特定和预定义的方式操作——根据在具体实施例中描述的方法和附图。每个程序可以以高级过程或面向对象的编程语言来实现以与计算机系统通信。然而,若需要,该程序可以以汇编或机器语言实现。在任何情况下,该语言可以是编译或解释的语言。此外,为此目的该程序能够在编程的专用集成电路上运行。It should be appreciated that embodiments of the present invention may be implemented or implemented by computer hardware, a combination of hardware and software, or by computer instructions stored in non-transitory computer readable memory. The methods can be implemented in a computer program using standard programming techniques - including a non-transitory computer-readable storage medium configured with a computer program, wherein the storage medium so configured causes the computer to operate in a specific and predefined manner - according to the specific Methods and figures described in the Examples. Each program may be implemented in a high-level procedural or object-oriented programming language to communicate with a computer system. However, if desired, the program can be implemented in assembly or machine language. In any case, the language can be a compiled or interpreted language. Furthermore, the program can be run on a programmed application specific integrated circuit for this purpose.

此外,可按任何合适的顺序来执行本文描述的过程的操作,除非本文另外指示或以其他方式明显地与上下文矛盾。本文描述的过程(或变型和/或其组合)可在配置有可执行指令的一个或多个计算机系统的控制下执行,并且可作为共同地在一个或多个处理器上执行的代码(例如,可执行指令、一个或多个计算机程序或一个或多个应用)、由硬件或其组合来实现。所述计算机程序包括可由一个或多个处理器执行的多个指令。Furthermore, the operations of the processes described herein may be performed in any suitable order unless otherwise indicated herein or otherwise clearly contradicted by context. The processes (or variations and/or combinations thereof) described herein can be performed under the control of one or more computer systems configured with executable instructions, and as code that executes collectively on one or more processors (eg, , executable instructions, one or more computer programs or one or more applications), implemented in hardware, or a combination thereof. The computer program includes a plurality of instructions executable by one or more processors.

进一步,所述方法可以在可操作地连接至合适的任何类型的计算平台中实现,包括但不限于个人电脑、迷你计算机、主框架、工作站、网络或分布式计算环境、单独的或集成的计算机平台、或者与带电粒子工具或其它成像装置通信等等。本发明的各方面可以以存储在非暂时性存储介质或设备上的机器可读代码来实现,无论是可移动的还是集成至计算平台,如硬盘、光学读取和/或写入存储介质、RAM、ROM等,使得其可由可编程计算机读取,当存储介质或设备由计算机读取时可用于配置和操作计算机以执行在此所描述的过程。此外,机器可读代码,或其部分可以通过有线或无线网络传输。当此类媒体包括结合微处理器或其他数据处理器实现上文所述步骤的指令或程序时,本文所述的发明包括这些和其他不同类型的非暂时性计算机可读存储介质。当根据本发明所述的方法和技术编程时,本发明还包括计算机本身。计算机程序能够应用于输入数据以执行本文所述的功能,从而转换输入数据以生成存储至非易失性存储器的输出数据。输出信息还可以应用于一个或多个输出设备如显示器。在本发明优选的实施例中,转换的数据表示物理和有形的对象,包括显示器上产生的物理和有形对象的特定视觉描绘。Further, the methods may be implemented in any type of computing platform operably connected to a suitable, including but not limited to personal computer, minicomputer, mainframe, workstation, network or distributed computing environment, separate or integrated computers platform, or communicate with charged particle tools or other imaging devices, etc. Aspects of the invention may be implemented in machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated into a computing platform, such as a hard disk, an optically read and/or written storage medium, RAM, ROM, etc., such that it can be read by a programmable computer, when a storage medium or device is read by a computer, it can be used to configure and operate the computer to perform the processes described herein. Furthermore, the machine-readable code, or portions thereof, may be transmitted over wired or wireless networks. The invention described herein includes these and other various types of non-transitory computer-readable storage media when such media includes instructions or programs that implement the steps described above in conjunction with a microprocessor or other data processor. The invention also includes the computer itself when programmed according to the methods and techniques described herein. A computer program can be applied to input data to perform the functions described herein, transforming the input data to generate output data for storage to non-volatile memory. The output information can also be applied to one or more output devices such as a display. In a preferred embodiment of the invention, the transformed data represents physical and tangible objects, including specific visual depictions of physical and tangible objects produced on the display.

如在本申请所使用的,术语“组件”、“模块”、“系统”等等旨在指代计算机相关实体,该计算机相关实体可以是硬件、固件、硬件和软件的结合、软件或者运行中的软件。例如,组件可以是,但不限于是:在处理器上运行的处理、处理器、对象、可执行文件、执行中的线程、程序和/或计算机。作为示例,在计算设备上运行的应用和该计算设备都可以是组件。一个或多个组件可以存在于执行中的过程和/或线程中,并且组件可以位于一个计算机中以及/或者分布在两个或更多个计算机之间。此外,这些组件能够从在其上具有各种数据结构的各种计算机可读介质中执行。这些组件可以通过诸如根据具有一个或多个数据分组(例如,来自一个组件的数据,该组件与本地系统、分布式系统中的另一个组件进行交互和/或以信号的方式通过诸如互联网之类的网络与其它系统进行交互)的信号,以本地和/或远程过程的方式进行通信。As used in this application, the terms "component," "module," "system," etc. are intended to refer to a computer-related entity, which may be hardware, firmware, a combination of hardware and software, software, or running software. For example, a component can be, but is not limited to, a process running on a processor, a processor, an object, an executable, a thread in execution, a program, and/or a computer. As an example, both an application running on a computing device and the computing device may be components. One or more components can exist in a process and/or thread of execution, and a component can be localized on one computer and/or distributed between two or more computers. In addition, these components can execute from various computer readable media having various data structures thereon. These components can be implemented by, for example, having one or more data groupings (eg, data from one component interacting with another component in a local system, a distributed system, and/or in a signaling manner such as the Internet network to interact with other systems) to communicate locally and/or as remote processes.

应说明的是,以上实施例仅用以说明本发明的技术方案而非限制,尽管参照较佳实施例对本发明进行了详细说明,本领域的普通技术人员应当理解,可以对本发明的技术方案进行修改或者等同替换,而不脱离本发明技术方案的精神和范围,其均应涵盖在本发明的权利要求范围当中。It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be Modifications or equivalent substitutions without departing from the spirit and scope of the technical solutions of the present invention should be included in the scope of the claims of the present invention.

Claims (9)

1. A real-time video monitoring method, comprising:
collecting an original video and filtering sound in the original video to generate a processed video;
decomposing the processed video frame by frame into a picture set, preprocessing the picture, and calculating pixels at the edge of the picture;
detecting a moving object in the video, and judging whether the picture of the frame of picture is abnormal or not according to the position of the moving object;
and judging whether to alarm or not according to the number of the frames with the abnormal pictures.
2. The real-time video monitoring method of claim 1, wherein: the method comprises the steps of collecting an original video shot by a camera, inputting the original video into a computer, and filtering sound in the original video through a Gaussian filter.
3. The real-time video monitoring method of claim 2, wherein: decomposing the processed video frame by frame into a picture set, smoothing the pictures in the picture set by a Canny algorithm, and calculating the gradient strength and the direction of pixels at the edge of the image in the picture, wherein the expression is as follows:
Figure FDA0003504048420000011
where σ represents the standard deviation, sigma 1.4, and e represents the pixel, then the value of the luminance of e is expressed as follows after gaussian filtering:
Figure FDA0003504048420000012
where denotes the sign of the convolution and sum denotes the sum of all elements in the setting matrix.
4. The real-time video monitoring method of claim 3, wherein: each direction of the pixel may be represented by a graphThe edges in the image are aimed at, and the four directions of the vertical, horizontal and diagonal edges of the image are detected through the Canny algorithm. By operators representing vertical and horizontal directions of edge detection, e.g. G in horizontal directionxAnd G in the vertical directionyThe direction of the pixel theta and the gradient of the pixel G can be inferred by the resulting first derivative value:
Figure FDA0003504048420000013
wherein G represents gradient strength, GxMagnitude of gradient, G, representing the x-directionyRepresenting the magnitude of the gradient in the y-direction, theta representing the direction of the pixel, arctan being the arctan function applied in the formula, and Sobel operators in the x-and y-directions can be respectively expressed as:
Figure FDA0003504048420000021
wherein Sx represents a Sobel operator in the x direction for detecting the direction in which the edge direction is y, and Sy represents a Sobel operator in the y direction for detecting the direction in which the edge direction is x.
5. The real-time video monitoring method of claim 4, wherein: the non-maximum suppression of the edge pixel is compared with the gradient intensity of a single pixel, the gradient intensity of the current pixel is analogized with other two pixels at the same time, when the gradient intensity of the current pixel is greater than the gradient intensity of the other two pixels, the current pixel is stored, the current pixel is taken as the edge, and the relation expression and the pseudo code related to the non-maximum suppression are as follows:
Figure FDA0003504048420000022
GP1=(1-tan(θ))×E+tan(θ)×NE
Gp2=(1-tan(θ))×W+tan(θ)×SW
if Gp≥Gp1 and Gp≥Gp2
Gp may be an edge
else
Gp should be sup pressed
where tan is a tangent function, θ represents an angle, theta is a gradient direction of P, P represents a pixel, P1 represents a current pixel 1, and P2 represents an analog pixel.
6. The real-time video monitoring method of claim 5, wherein: filtering the edge pixels by using weak gradient values, storing some edge pixels, wherein the edge pixels have the property of high gradient values, the gradient value of a strong edge pixel is higher than a proposed high threshold, the gradient value of a weak edge pixel is smaller than the proposed high threshold and larger than a proposed low threshold, and when the gradient value of the edge pixel is smaller than the proposed low threshold, the pixel is suppressed to obtain a pseudo code of double-threshold detection, and the specific expression is as follows:
if Gp≥HighThreshold
Gp is an strong edge
else if Gp≥LowThreshold
Gp is an weak edge
else
Gp should be sup pressed。
7. the real-time video monitoring method of claim 6, wherein: the images of moving objects are different in position in frames of different images, changed pixels are calculated and analyzed through the difference shown between two adjacent frames of images around a picture set, the motion of a target is changed along with the change of time, strong continuity is shown, the pixel change of a background point in the images tends to zero, processing is carried out on the premise of threshold judgment, the frame number of the two subtracted frames is shown as the kth frame and the (k +1) th frame, and the images of the frames can be shown as Ik(x,y)、Ik+1(x, y) Simultaneous Difference imageDenoted as D (x, y) and its binary threshold value is T, the corresponding formula of the inter-frame difference method is as follows:
Figure FDA0003504048420000031
wherein, Ix(x, y) denotes a k-th frame image, Ik+1The (x, y) represents the (k +1) th frame image, T is a binarization threshold, D (x, y) represents a binary function, the number of 255 indicates that pixel points in the two frame images are changed obviously, the pixel points are located in a motion area at the moment, the number of 0 indicates that the pixel points are almost not changed, the pixel points represent a background area, and T represents a well-formulated threshold.
8. The real-time video monitoring method of claim 7, wherein: the range size of the threshold value T is used for adjusting the sensitivity and accuracy of the detection target area, when the threshold value T is relatively small, certain noise or background can be mistakenly used as a moving target, and when the threshold value T is large, a small part in the range of the moving area can be not extracted.
9. The real-time video monitoring method of claim 8, wherein: when the abnormality occurs in the detection target area in the picture, defining the picture as an abnormal picture, presetting the number of frames in which the abnormal picture continuously occurs, and triggering an alarm when the occurrence frequency of the abnormal picture is more than the number of the frames.
CN202210134815.3A 2022-02-14 2022-02-14 A real-time video surveillance method Pending CN114445992A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210134815.3A CN114445992A (en) 2022-02-14 2022-02-14 A real-time video surveillance method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210134815.3A CN114445992A (en) 2022-02-14 2022-02-14 A real-time video surveillance method

Publications (1)

Publication Number Publication Date
CN114445992A true CN114445992A (en) 2022-05-06

Family

ID=81372976

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210134815.3A Pending CN114445992A (en) 2022-02-14 2022-02-14 A real-time video surveillance method

Country Status (1)

Country Link
CN (1) CN114445992A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116883940A (en) * 2023-07-07 2023-10-13 中国南方电网有限责任公司超高压输电公司电力科研院 Electric power operation monitoring and alarming method and device and electric power operation auxiliary robot

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102254394A (en) * 2011-05-31 2011-11-23 西安工程大学 Antitheft monitoring method for poles and towers in power transmission line based on video difference analysis
CN109816674A (en) * 2018-12-27 2019-05-28 北京航天福道高技术股份有限公司 An edge extraction method of registration map based on Canny operator

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102254394A (en) * 2011-05-31 2011-11-23 西安工程大学 Antitheft monitoring method for poles and towers in power transmission line based on video difference analysis
CN109816674A (en) * 2018-12-27 2019-05-28 北京航天福道高技术股份有限公司 An edge extraction method of registration map based on Canny operator

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张春雨 等: "船舶运输智能交通系统运动目标自动识别方法", 《船舶科学技术》, vol. 43, no. 7, pages 354 - 356 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116883940A (en) * 2023-07-07 2023-10-13 中国南方电网有限责任公司超高压输电公司电力科研院 Electric power operation monitoring and alarming method and device and electric power operation auxiliary robot

Similar Documents

Publication Publication Date Title
US8294765B2 (en) Video image monitoring system
JP5241782B2 (en) Surveillance camera system having a camera abnormality detection device
CN106851049B (en) A method and device for scene change detection based on video analysis
JP2010009134A (en) Image processing system, image processing method, and program
CN102663869A (en) Indoor fire detection method based on video monitoring platform
US20110221895A1 (en) Detection of Movement of a Stationary Video Camera
JP2009005198A (en) Video surveillance system
CN101179713A (en) A single moving target detection method in complex background
CN104853151A (en) Large-space fire monitoring system based on video image
CN111582300A (en) High-dynamic target detection method based on event camera
CN104767911A (en) Image processing method and device
CN110913209B (en) Camera occlusion detection method, device, electronic device and monitoring system
CN106204653A (en) A kind of monitoring tracking and device
CN107085902A (en) A method and system for intelligent video multi-point monitoring
KR102159954B1 (en) Method for establishing region of interest in intelligent video analytics and video analysis apparatus using the same
CN106611165B (en) A car window detection method and device based on correlation filtering and color matching
JP2005510148A (en) Alarm generation method and security system via edge detection
CN110677619A (en) Intelligent monitoring video processing method
CN114445992A (en) A real-time video surveillance method
CN104657997B (en) Lens shift detection method and device
KR20190026625A (en) Image displaying method, Computer program and Recording medium storing computer program for the same
CN105913008A (en) Crowd exceptional event detection method based on hypothesis examination
CN114092884B (en) Camera lens shift detection method, device, electronic equipment and storage medium
WO2012081969A1 (en) A system and method to detect intrusion event
KR100920937B1 (en) Motion Detection and Image Storage Device and Method in Surveillance System

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20220506

RJ01 Rejection of invention patent application after publication