[go: up one dir, main page]

CN112287805B - Method and device for detecting moving object, readable storage medium and electronic equipment - Google Patents

Method and device for detecting moving object, readable storage medium and electronic equipment Download PDF

Info

Publication number
CN112287805B
CN112287805B CN202011160883.4A CN202011160883A CN112287805B CN 112287805 B CN112287805 B CN 112287805B CN 202011160883 A CN202011160883 A CN 202011160883A CN 112287805 B CN112287805 B CN 112287805B
Authority
CN
China
Prior art keywords
frame image
image
current frame
motion
detected
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.)
Active
Application number
CN202011160883.4A
Other languages
Chinese (zh)
Other versions
CN112287805A (en
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.)
Horizon Shanghai Artificial Intelligence Technology Co Ltd
Original Assignee
Horizon Shanghai Artificial Intelligence Technology Co Ltd
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 Horizon Shanghai Artificial Intelligence Technology Co Ltd filed Critical Horizon Shanghai Artificial Intelligence Technology Co Ltd
Priority to CN202011160883.4A priority Critical patent/CN112287805B/en
Publication of CN112287805A publication Critical patent/CN112287805A/en
Application granted granted Critical
Publication of CN112287805B publication Critical patent/CN112287805B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/20Analysis of motion
    • G06T7/254Analysis of motion involving subtraction of images
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/25Determination of region of interest [ROI] or a volume of interest [VOI]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/40Scenes; Scene-specific elements in video content
    • G06V20/41Higher-level, semantic clustering, classification or understanding of video scenes, e.g. detection, labelling or Markovian modelling of sport events or news items
    • G06V20/42Higher-level, semantic clustering, classification or understanding of video scenes, e.g. detection, labelling or Markovian modelling of sport events or news items of sport video content
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V2201/00Indexing scheme relating to image or video recognition or understanding
    • G06V2201/07Target detection

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Image Analysis (AREA)

Abstract

本公开提供了一种运动物体的检测方法,包括:基于当前帧图像与前一帧图像,确定所述当前帧图像与所述前一帧图像的帧间差分信息;基于所述当前帧图像以及当前帧图像之前预定数量的历史帧图像,确定多帧图像集合;基于所述多帧图像集合中各帧图像的所述帧间差分信息,在所述当前帧图像中确定第一运动区域;基于所述第一运动区域,确定至少一个预定尺度的被检测区域;基于所述当前帧图像中的所述被检测区域,确定所述被检测区域中的运动目标物。本公开提供的技术方案针对第一运动区域进行图像缩放处理和运动目标物检测,能够减少运动物体检测过程中的计算量,提高计算效率。

The present disclosure provides a method for detecting a moving object, including: determining inter-frame difference information between the current frame image and the previous frame image based on the current frame image and the previous frame image; determining a multi-frame image set based on the current frame image and a predetermined number of historical frame images before the current frame image; determining a first moving area in the current frame image based on the inter-frame difference information of each frame image in the multi-frame image set; determining at least one detected area of a predetermined scale based on the first moving area; and determining a moving target in the detected area based on the detected area in the current frame image. The technical solution provided by the present disclosure performs image scaling processing and moving target detection on the first moving area, which can reduce the amount of calculation in the moving object detection process and improve calculation efficiency.

Description

运动物体的检测方法、装置、可读存储介质及电子设备Moving object detection method, device, readable storage medium and electronic device

技术领域Technical Field

本公开涉及图像处理领域,尤其涉及一种运动物体的检测方法、装置、可读存储介质及电子设备。The present disclosure relates to the field of image processing, and in particular to a moving object detection method, device, readable storage medium and electronic device.

背景技术Background Art

传统的图像金字塔算法对输入图像做降采样处理,然后基于降采样的结果进行图像识别。由于对运动目标物进行检测的模块(例如能够执行神经网络运算的SOC芯片)所支持的尺度是固定的,但是片上系统(SOC)芯片事先并不知道目标物体的尺度,因此会将每一层的金字塔结果通过片上系统中用于对运动目标物进行检测的硬件模块来检测,由对运动目标物进行检测的模块依据所支持的尺度确定其中的一帧进行运动目标物的检测。在大图像尺度的场景下,这种方法存在的问题就是计算量较大,需要对输入的每一帧图像做多层金字塔处理,同时要达到每秒30帧图像或60帧图像甚至更高的处理帧图像率,对片上系统(SOC)芯片的算力和带宽都提出了较高的要求。在实际应用中,尤其在安防监控等领域,多帧图像连续图像的背景是基本相同的,在某种程度上,可以认为只有小部分区域的图像是变化的,如果每一帧图像都进行重复处理,会造成带宽和算力的大量浪费。The traditional image pyramid algorithm downsamples the input image and then performs image recognition based on the downsampled result. Since the scale supported by the module for detecting moving objects (such as the SOC chip that can perform neural network operations) is fixed, but the system on chip (SOC) chip does not know the scale of the target object in advance, the pyramid result of each layer will be detected by the hardware module for detecting moving objects in the system on chip, and the module for detecting moving objects will determine one of the frames for detecting moving objects based on the supported scale. In the scenario of large image scale, the problem of this method is that the amount of calculation is large. It is necessary to perform multi-layer pyramid processing on each input frame image, and at the same time, to achieve a processing frame image rate of 30 frames per second or 60 frames per second or even higher, the computing power and bandwidth of the system on chip (SOC) chip are put forward. In practical applications, especially in the fields of security monitoring, the background of multiple frames of continuous images is basically the same. To some extent, it can be considered that only a small part of the image area is changing. If each frame of the image is repeatedly processed, it will cause a lot of waste of bandwidth and computing power.

发明内容Summary of the invention

为了解决上述技术问题,提出了本公开。本公开的实施例提供了一种运动物体的检测方法、装置、可读存储介质及电子设备,基于第一运动区域的被检测区域进行运动目标物的检测,避免了在图像中位于第一运动区域之外的区域进行运动物体的检测,因此大大减少了运动物体检测过程中的计算量,提高了计算效率。In order to solve the above technical problems, the present disclosure is proposed. The embodiments of the present disclosure provide a moving object detection method, device, readable storage medium and electronic device, which detect moving targets based on the detected area of the first motion area, avoid detecting moving objects in areas outside the first motion area in the image, thereby greatly reducing the amount of calculation in the moving object detection process and improving the calculation efficiency.

根据本公开的一个方面,提供了一种运动物体的检测方法,包括:According to one aspect of the present disclosure, a method for detecting a moving object is provided, comprising:

基于当前帧图像与前一帧图像,确定所述当前帧图像与所述前一帧图像的帧间差分信息;Based on the current frame image and the previous frame image, determining inter-frame difference information between the current frame image and the previous frame image;

基于所述当前帧图像以及当前帧图像之前预定数量的历史帧图像,确定多帧图像集合;Determine a set of multiple frame images based on the current frame image and a predetermined number of historical frame images before the current frame image;

基于所述多帧图像集合中各帧图像的所述帧间差分信息,在所述当前帧图像中确定第一运动区域;Determining a first motion region in the current frame image based on the inter-frame difference information of each frame image in the multi-frame image set;

基于所述第一运动区域,确定至少一个预定尺度的被检测区域;Based on the first motion area, determining at least one detected area of a predetermined size;

基于所述当前帧图像中的所述被检测区域,确定所述被检测区域中的运动目标物。Based on the detected area in the current frame image, a moving target in the detected area is determined.

根据本公开的第二方面,提供了一种运动物体的检测装置,包括:According to a second aspect of the present disclosure, there is provided a moving object detection device, comprising:

差分信息获取模块:用于基于当前帧图像与前一帧图像,确定所述当前帧图像与所述前一帧图像的帧间差分信息;The differential information acquisition module is used to determine the inter-frame differential information between the current frame image and the previous frame image based on the current frame image and the previous frame image;

多帧图像集合确定模块:用于基于所述当前帧图像以及所述当前帧图像之前预定数量的帧图像,确定多帧图像集合;A multi-frame image set determination module: used to determine a multi-frame image set based on the current frame image and a predetermined number of frame images before the current frame image;

运动区域获取模块:用于基于所述多帧图像集合中各帧图像的所述帧间差分信息,在所述当前帧图像中确定第一运动区域;A motion region acquisition module: used to determine a first motion region in the current frame image based on the inter-frame difference information of each frame image in the multi-frame image set;

尺度转换模块:用于基于所述第一运动区域,确定至少一个预定尺度的被检测区域;A scale conversion module: used to determine at least one detected area of a predetermined scale based on the first motion area;

运动目标物检测模块:用于基于所述当前帧图像中的所述被检测区域,确定所述被检测区域中的运动目标物。The moving target detection module is used to determine the moving target in the detected area based on the detected area in the current frame image.

根据本公开的第三方面,提供了一种计算机可读存储介质,所述存储介质存储有计算机程序,所述计算机程序用于执行上述任一所述的运动物体的检测方法。According to a third aspect of the present disclosure, a computer-readable storage medium is provided, wherein the storage medium stores a computer program, and the computer program is used to execute any of the above-mentioned moving object detection methods.

根据本公开的第四方面,提供了一种电子设备,所述电子设备包括:According to a fourth aspect of the present disclosure, an electronic device is provided, the electronic device comprising:

处理器;processor;

用于存储所述处理器可执行指令的存储器;a memory for storing instructions executable by the processor;

所述处理器,用于从所述存储器中读取所述可执行指令,并执行所述指令以实现上述任一所述的运动物体的检测方法。The processor is used to read the executable instructions from the memory and execute the instructions to implement any of the above-mentioned moving object detection methods.

在本公开的上述四个技术方案中,通过对多帧图像集合中的差分信息,判断当前帧图像中的第一运动区域,然后依据第一运动区域进行计算,得到预定尺度的被检测区域,并依据被检测区域对运动目标物进行检测,在本公开中,对第一运动区域进行缩放和检测,由于第一运动区域之外的部分不参与计算,从而,大幅减少计算被检测区域的计算量,提高计算效率。In the above four technical solutions disclosed in the present invention, the first motion area in the current frame image is determined by the differential information in the multi-frame image set, and then calculations are performed based on the first motion area to obtain a detected area of a predetermined scale, and the moving target is detected based on the detected area. In the present invention, the first motion area is scaled and detected. Since the part outside the first motion area does not participate in the calculation, the calculation amount of the detected area is greatly reduced, thereby improving the calculation efficiency.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

通过结合附图对本公开实施例进行更详细的描述,本公开的上述以及其他目的、特征和优势将变得更加明显。附图用来提供对本公开实施例的进一步理解,并且构成说明书的一部分,与本公开实施例一起用于解释本公开,并不构成对本公开的限制。在附图中,相同的参考标号通常代表相同部件或步骤。The above and other purposes, features and advantages of the present disclosure will become more apparent by describing the embodiments of the present disclosure in more detail in conjunction with the accompanying drawings. The accompanying drawings are used to provide a further understanding of the embodiments of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the present disclosure and do not constitute a limitation of the present disclosure. In the drawings, the same reference numerals generally represent the same components or steps.

图1是本公开一示例性实施例提供的运动物体检测方法的流程示意图。FIG. 1 is a schematic flow chart of a moving object detection method provided by an exemplary embodiment of the present disclosure.

图2是本公开另一示例性实施例提供的运动物体检测方法的差分信息确认的流程示意图。FIG. 2 is a schematic diagram of a flow chart of differential information confirmation of a moving object detection method provided by another exemplary embodiment of the present disclosure.

图3是本公开另一示例性实施例提供的运动物体检测方法的第一运动区域确认的流程示意图。FIG. 3 is a schematic diagram of a flow chart of first motion region confirmation in a moving object detection method provided by another exemplary embodiment of the present disclosure.

图4是本公开另一示例性实施例提供的运动物体检测方法的第一运动区域确认的流程示意图。FIG. 4 is a schematic diagram of a flow chart of first motion region confirmation in a moving object detection method provided by another exemplary embodiment of the present disclosure.

图5是本公开另一示例性实施例提供的运动物体检测方法的第二运动区域合并的流程示意图。FIG. 5 is a schematic diagram of a flow chart of second motion region merging of a moving object detection method provided by another exemplary embodiment of the present disclosure.

图6是本公开另一示例性实施例提供的运动物体检测方法的第二运动区域合并的流程示意图。FIG. 6 is a schematic diagram of a flow chart of second motion region merging of a moving object detection method provided by another exemplary embodiment of the present disclosure.

图7是本公开另一示例性实施例提供的运动物体检测方法的被检测参考图像确定的流程示意图。FIG. 7 is a schematic diagram of a flow chart of determining a detected reference image in a moving object detection method provided by another exemplary embodiment of the present disclosure.

图8是本公开另一示例性实施例提供的运动物体检测方法的参考图像确定的流程示意图。FIG. 8 is a schematic diagram of a flow chart of reference image determination in a moving object detection method provided by another exemplary embodiment of the present disclosure.

图9是本公开一示例性实施例提供的运动物体检测装置的示意图。FIG. 9 is a schematic diagram of a moving object detection device provided by an exemplary embodiment of the present disclosure.

图10是本公开另一示例性实施例提供的运动物体检测装置的差分信息获取模块的示意图。FIG. 10 is a schematic diagram of a differential information acquisition module of a moving object detection device provided by another exemplary embodiment of the present disclosure.

图11是本公开另一示例性实施例提供的运动物体检测装置的第一运动区域获取模块的示意图。FIG. 11 is a schematic diagram of a first motion region acquisition module of a moving object detection device provided by another exemplary embodiment of the present disclosure.

图12是本公开另一示例性实施例提供的运动物体检测装置的第一运动区域子模块的示意图。FIG. 12 is a schematic diagram of a first motion region submodule of a moving object detection device provided by another exemplary embodiment of the present disclosure.

图13是本公开另一示例性实施例提供的运动物体检测装置的第一合并子单元的示意图。FIG. 13 is a schematic diagram of a first merging subunit of a moving object detection device provided by another exemplary embodiment of the present disclosure.

图14是本公开另一示例性实施例提供的运动物体检测装置的第一运动区域确定单元的示意图。FIG. 14 is a schematic diagram of a first motion region determining unit of a moving object detection device provided by another exemplary embodiment of the present disclosure.

图15是本公开另一示例性实施例提供的运动物体检测装置的参考图像目标物确定各模块示意图。FIG. 15 is a schematic diagram of various modules for determining a reference image target object in a moving object detection device provided by another exemplary embodiment of the present disclosure.

图16是本公开另一示例性实施例提供的运动物体检测装置的参考图像确定模块的示意图。FIG. 16 is a schematic diagram of a reference image determination module of a moving object detection device provided by another exemplary embodiment of the present disclosure.

图17是本公开一示例性实施例提供的电子设备的结构图。FIG. 17 is a structural diagram of an electronic device provided by an exemplary embodiment of the present disclosure.

具体实施方式DETAILED DESCRIPTION

下面,将参考附图详细地描述根据本公开的示例实施例。显然,所描述的实施例仅仅是本公开的一部分实施例,而不是本公开的全部实施例,应理解,本公开不受这里描述的示例实施例的限制。Below, the exemplary embodiments according to the present disclosure will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all the embodiments of the present disclosure, and it should be understood that the present disclosure is not limited to the exemplary embodiments described here.

申请概述Application Overview

对于运动物体的检测,尤其是采用神经网络对视频中的画面的运动物体进行检测的过程中,由于图像采集模块的传感器的分辨率不同或者拍摄物体的远近不同会导致对物体的成像大小不同,通常需要将图像采集模块采集到的视频中的画面每帧图像进行缩放形成指定尺度的图像后再对运动物体进行检测。For the detection of moving objects, especially in the process of detecting moving objects in the video using neural networks, due to the different resolutions of the sensors of the image acquisition module or the different distances of the photographed objects, the imaging sizes of the objects will be different. It is usually necessary to scale each frame of the video captured by the image acquisition module to form an image of a specified scale before detecting the moving objects.

本公开的技术方案中,首先通过将当前帧图像与前一帧图像进行差值计算得到帧间差分信息,然后将当前帧图像之前的多个历史帧图像确定一个多帧图像集合,然后再依据该多帧图像集合的帧间差分信息确定一个第一运动区域,在后续进行图像识别的过程中,对当前帧图像的第一运动区域进行缩放得到预定尺度的被检测区域,基于该被检测区域确定运动目标物。在本公开中,对第一运动区域进行缩放,第一运动区域之外的部分不参与计算,因此大大减小图像缩放尺度过程中计算量,进而大大提高计算效率。In the technical solution disclosed in the present invention, first, the inter-frame difference information is obtained by performing a difference calculation between the current frame image and the previous frame image, and then a multi-frame image set is determined by multiple historical frame images before the current frame image, and then a first motion area is determined based on the inter-frame difference information of the multi-frame image set. In the subsequent image recognition process, the first motion area of the current frame image is scaled to obtain a detected area of a predetermined scale, and a moving target is determined based on the detected area. In the present invention, the first motion area is scaled, and the part outside the first motion area does not participate in the calculation, thereby greatly reducing the amount of calculation in the image scaling process, thereby greatly improving the calculation efficiency.

示例性方法Exemplary Methods

图1是本公开一示例性实施例提供的一种运动物体的检测方法,包括:FIG1 is a moving object detection method provided by an exemplary embodiment of the present disclosure, comprising:

步骤101,基于当前帧图像与当前帧图像的前一帧图像,确定所述当前帧图像与所述前一帧图像的帧间差分信息;Step 101, based on a current frame image and a previous frame image of the current frame image, determining inter-frame difference information between the current frame image and the previous frame image;

在一些实施例中,当前帧图像是指图像处理过程中正在被处理的一帧图像的图像;前一帧图像是指在当前帧图像之前并且与当前帧图像相邻的一帧图像;帧间差分信息是指将当前帧图像与前一帧图像进行差分计算得到的差值图像以及差值图像中各像素的亮度或灰度信息。In some embodiments, the current frame image refers to an image frame being processed during the image processing process; the previous frame image refers to an image frame that is before the current frame image and adjacent to the current frame image; the inter-frame difference information refers to the difference image obtained by performing a difference calculation between the current frame image and the previous frame image and the brightness or grayscale information of each pixel in the difference image.

步骤102,基于所述当前帧图像以及当前帧图像之前预定数量的历史帧图像,确定多帧图像集合;Step 102, determining a multi-frame image set based on the current frame image and a predetermined number of historical frame images before the current frame image;

在一些实施例中,历史帧图像是指在当前帧图像之前的多帧图像,在一些优选的实施例中,历史帧图像是指在当前帧图像之前的连续的多帧图像;多帧图像集合是指包括了在当前帧图像之前的多帧图像的集合。历史帧图像的数量可以依据视频处理过程中对实时性的要求进行选用,例如,当实时性较高时,用一帧图像历史帧图像,当实时性要求较低时,可以选用两帧图像或三帧图像历史帧图像。在实际实现过程中,还可以依据片上系统(SOC)芯片的带宽进行历史帧图像数量的设置,例如,当片上系统(SOC)芯片对带宽比较敏感,则可以设置历史帧图像为一帧图像,每一帧图像都会计算并更新运动区域,当片上系统(SOC)芯片有充分带宽时,则可以计算连续多帧图像累计的差分结果。In some embodiments, the historical frame image refers to multiple frame images before the current frame image. In some preferred embodiments, the historical frame image refers to multiple frame images before the current frame image; a multi-frame image set refers to a set of multiple frame images before the current frame image. The number of historical frame images can be selected according to the real-time requirements in the video processing process. For example, when the real-time requirements are high, one frame of historical frame images is used. When the real-time requirements are low, two or three frames of historical frame images can be selected. In the actual implementation process, the number of historical frame images can also be set according to the bandwidth of the system on chip (SOC) chip. For example, when the system on chip (SOC) chip is sensitive to bandwidth, the historical frame image can be set to one frame image. Each frame image will calculate and update the motion area. When the system on chip (SOC) chip has sufficient bandwidth, the differential result accumulated by the continuous multiple frames of images can be calculated.

步骤103,基于所述多帧图像集合中各帧图像的所述帧间差分信息,在所述当前帧图像中确定第一运动区域;Step 103, determining a first motion region in the current frame image based on the inter-frame difference information of each frame image in the multi-frame image set;

在一些实施例中,帧间差分信息是指将当前帧图像与前一帧图像进行差分计算得到的差值图像以及差值图像中各像素的亮度或灰度信息。在多帧图像集合中的多个连续的帧间差分信息进行累加,得到多个连续的帧间差分信息的累加结果。当在该累加结果中,特定的像素点的累加结果超过指定的阈值时,在多帧图像集合中的最后一帧图像中的对应像素点被认为是运动像素点,该运动像素点以及在该运动像素点周围预定距离中的各个像素点集合所在的位置为第一运动区域。由于在对多帧图像集合的帧间差分信息进行累加时,会将多帧图像的运动像素进行累加,得到的结果中包含了每帧图像中的运动像素,因此,会导致累加的结果中将运动目标物沿其运动方向产生鬼影,因此,前一步骤中的多帧图像集合中的帧图像的数量例如可以选取为不大于3的数量,以避免鬼影的产生。In some embodiments, the inter-frame difference information refers to the difference image obtained by performing a difference calculation between the current frame image and the previous frame image, and the brightness or grayscale information of each pixel in the difference image. Multiple continuous inter-frame difference information in a multi-frame image set is accumulated to obtain a cumulative result of multiple continuous inter-frame difference information. When the cumulative result of a specific pixel point exceeds a specified threshold in the cumulative result, the corresponding pixel point in the last frame image in the multi-frame image set is considered to be a moving pixel point, and the position of the moving pixel point and each pixel point set within a predetermined distance around the moving pixel point is the first motion area. Since the moving pixels of the multi-frame images are accumulated when the inter-frame difference information of the multi-frame image set is accumulated, the obtained result includes the moving pixels in each frame image, so that the moving target object will be ghosted along its moving direction in the accumulated result. Therefore, the number of frame images in the multi-frame image set in the previous step can be selected as a number not greater than 3, for example, to avoid the generation of ghosts.

步骤104,基于所述第一运动区域,确定至少一个预定尺度的被检测区域;Step 104, determining at least one detected area of a predetermined size based on the first motion area;

在一些实施例中,对第一运动区域进行缩放,得到至少一个预定尺度的被检测区域,在后续的处理过程中,将上述至少一个预定尺度的被检测区域送入对运动目标物进行检测的模块,对运动目标物进行检测的模块可以是SOC芯片、FPGA芯片以及ASIC芯片等,例如能够执行神经网络运算的SOC芯片。上述的预定尺度是由对运动目标物进行检测的模块所支持的尺度确定的,对于被检测区域的数量,是由第一运动区域的尺度以及对运动目标物进行检测的模块所支持的尺度确定的。In some embodiments, the first motion region is scaled to obtain at least one detected region of a predetermined scale. In the subsequent processing, the at least one detected region of a predetermined scale is sent to a module for detecting moving targets. The module for detecting moving targets may be a SOC chip, an FPGA chip, an ASIC chip, etc., such as a SOC chip capable of performing neural network operations. The predetermined scale is determined by the scale supported by the module for detecting moving targets, and the number of detected regions is determined by the scale of the first motion region and the scale supported by the module for detecting moving targets.

步骤105,基于所述当前帧图像中的所述被检测区域,确定所述被检测区域中的运动目标物。Step 105: Determine a moving target in the detected area based on the detected area in the current frame image.

在一些实施例中,被检测区域是当前帧图像中具备运动目标物的部分图像,基于被检测区域进行运动目标物的检测,能够减少计算量,同时还能够确保检测的准确性。运动目标物是是指在当前帧图像与当前帧图像之前的前一帧图像中发生位置变化的物体,例如,行进中的车辆、奔跑中的动物或者行走中的人物等。In some embodiments, the detected area is a portion of the current frame image that has a moving target. Detecting the moving target based on the detected area can reduce the amount of calculation while ensuring the accuracy of the detection. A moving target refers to an object that has changed position between the current frame image and the previous frame image before the current frame image, such as a moving vehicle, a running animal, or a walking person.

在本公开的技术方案中,通过对多帧图像集合中的差分信息,判断当前帧图像中的第一运动区域,然后依据第一运动区域进行计算,得到预定尺度的被检测区域,并依据被检测区域对运动目标物进行检测,由于被检测区域是当前帧图像中的局部图像,因此,针对被检测区域进行计算,能够大幅减少计算被检测区域的计算量,提高计算效率。In the technical solution disclosed in the present invention, the first motion area in the current frame image is determined by the differential information in the multi-frame image set, and then calculations are performed based on the first motion area to obtain a detected area of a predetermined scale, and the moving target is detected based on the detected area. Since the detected area is a local image in the current frame image, calculations are performed on the detected area, which can greatly reduce the amount of calculations of the detected area and improve calculation efficiency.

如图2所示,在上述图1的实施例基础上,步骤101还可以包括如下的步骤:As shown in FIG. 2 , based on the embodiment of FIG. 1 , step 101 may further include the following steps:

步骤1011,基于所述当前帧图像与所述前一帧图像对应的像素值,确定预定颜色空间中预定颜色通道的对应的像素差分值;Step 1011, determining a corresponding pixel difference value of a predetermined color channel in a predetermined color space based on the pixel values corresponding to the current frame image and the previous frame image;

在一些实施例中,每帧图像在预定颜色空间中预定颜色通道都具有像素值,在计算像素差分值时,将当前帧图像与前一帧图像在预定颜色空间中预定颜色通道的像素值进行差分,即得到像素差分值。以当前帧图像和前一帧图像在YUV空间中计算为例,将当前帧图像在YUV空间中的Y通道的像素值与前一帧图像YUV空间中的Y通道的像素值进行差分,即得到了当前帧图像与前一帧图像在Y通道的像素差分值。In some embodiments, each frame image has a pixel value in a predetermined color channel in a predetermined color space, and when calculating the pixel difference value, the pixel value of the predetermined color channel in the predetermined color space of the current frame image is differentiated from that of the previous frame image, so as to obtain the pixel difference value. Taking the calculation of the current frame image and the previous frame image in the YUV space as an example, the pixel value of the Y channel of the current frame image in the YUV space is differentiated from the pixel value of the Y channel of the previous frame image in the YUV space, so as to obtain the pixel difference value of the Y channel of the current frame image and the previous frame image.

以当前帧图像和前一帧图像在YUV空间中计算为例,其计算过程如下:Taking the calculation of the current frame image and the previous frame image in YUV space as an example, the calculation process is as follows:

对于Y通道对应的像素差分值计算公式如下:The calculation formula for the pixel difference value corresponding to the Y channel is as follows:

|Y(x,y,t)–Y(x,y,t-1)|;|Y(x,y,t)–Y(x,y,t-1)|;

对于U通道对应的像素差分值计算公式如下:The calculation formula for the pixel difference value corresponding to the U channel is as follows:

|U(x,y,t)–U(x,y,t-1)|;|U(x,y,t)–U(x,y,t-1)|;

对于V通道对应的像素差分值计算公式如下:The calculation formula for the pixel difference value corresponding to the V channel is as follows:

|V(x,y,t)–V(x,y,t-1)|;|V(x,y,t)–V(x,y,t-1)|;

其中,x,y为图像的坐标;t,t-1为当前帧图像和前一帧图像的帧图像数;Y,U,V分别表示三个通道,具体地,Y(x,y,t)表示当前帧图像在YUV空间中的Y通道中坐标为(x,y)处的像素值。Among them, x, y are the coordinates of the image; t, t-1 are the frame image numbers of the current frame image and the previous frame image; Y, U, and V represent three channels respectively. Specifically, Y(x, y, t) represents the pixel value at the coordinate (x, y) in the Y channel of the current frame image in the YUV space.

本领域技术人员应当能够理解,上述仅以YUV空间中计算过程为例,在计算过程中,还可以在RGB,HSV或HSL空间中计算。Those skilled in the art should be able to understand that the above only takes the calculation process in the YUV space as an example, and during the calculation process, calculation can also be performed in the RGB, HSV or HSL space.

步骤1012,基于所述像素差分值和预定的权重值,确定所述帧间差分信息。Step 1012: Determine the inter-frame difference information based on the pixel difference value and a predetermined weight value.

在一些实施例中,像素差分值为上一步骤中计算出的预定的颜色空间中预定颜色通道的像素差分值,将上述的差分值依据预先确定的权重值进行加权计算,得到帧间差分信息。上述的权重值依据视频中的画面需要关注的运动目标物以及视频中的画面的背景进行设定,例如,视频中的画面需要关注的运动目标物的信息主要集中在Y通道中,此时,对Y通道的信息识别要求较高,将Y通道对应的权重值设置为较高的权重值,此时,Y通道的像素差分值会对帧间差分信息形成较大的影响,有利于对Y通道的信息进行识别。又例如,视频中的画面的背景的信息主要集中在V通道中,此时,在检测过程中,不需要对背景的信息进行关注,因此,对V通道的信息识别要求较高,将V通道对应的权重值设置为较高的权重值,此时,V通道的像素差分值会对帧间差分信息形成的影响较小,有利于对Y通道和V通道的信息进行识别。In some embodiments, the pixel difference value is the pixel difference value of the predetermined color channel in the predetermined color space calculated in the previous step, and the above-mentioned difference value is weighted and calculated according to the predetermined weight value to obtain the inter-frame difference information. The above-mentioned weight value is set according to the moving target that needs to be paid attention to in the video picture and the background of the picture in the video. For example, the information of the moving target that needs to be paid attention to in the video picture is mainly concentrated in the Y channel. At this time, the information recognition requirement for the Y channel is relatively high. The weight value corresponding to the Y channel is set to a relatively high weight value. At this time, the pixel difference value of the Y channel will have a relatively large impact on the inter-frame difference information, which is conducive to the identification of the information of the Y channel. For another example, the background information of the picture in the video is mainly concentrated in the V channel. At this time, during the detection process, it is not necessary to pay attention to the background information. Therefore, the information recognition requirement for the V channel is relatively high. The weight value corresponding to the V channel is set to a relatively high weight value. At this time, the pixel difference value of the V channel will have a relatively small impact on the inter-frame difference information, which is conducive to the identification of the information of the Y channel and the V channel.

仍以当前帧图像和前一帧图像在YUV空间中计算为例,其计算过程如下:Still taking the calculation of the current frame image and the previous frame image in the YUV space as an example, the calculation process is as follows:

D(x,y,t)=((|Y(x,y,t)–Y(x,y,t-1)|<<W0)+D(x,y,t)=((|Y(x,y,t)–Y(x,y,t-1)|<<W0)+

(|U(x,y,t)–U(x,y,t-1)|<<W1)+(|U(x,y,t)–U(x,y,t-1)|<<W1)+

(|V(x,y,t)–V(x,y,t-1)|<<W2))(|V(x,y,t)–V(x,y,t-1)|<<W2))

其中,W0+W1+W2=100%。Among them, W0+W1+W2=100%.

在上述的公式中,D(x,y,t)表示当前帧图像在坐标(x,y)处的像素的帧间差分信息;Y(x,y,t)表示当前帧图像在YUV空间中Y通道的坐标(x,y)处的像素差分值,Y(x,y,t-1),U(x,y,t),U(x,y,t-1),V(x,y,t),V(x,y,t-1)同理;W0,W1和W2表示在三个颜色通道中像素差分值的权重值。在一些实施例中,上述的权重值依据视频中的画面需要关注的运动目标物以及视频中的画面的背景进行设定,例如,视频中的画面需要关注的运动目标物的信息主要集中在Y通道中,此时,对Y通道的信息识别要求较高,将Y通道对应的权重值设置为较高的权重值,此时,Y通道的像素差分值会对帧间差分信息形成较大的影响,有利于对Y通道的信息进行识别。又例如,视频中的画面的背景的信息主要集中在V通道中,此时,在检测过程中,不需要对背景的信息进行关注,因此,对V通道的信息识别要求较高,将V通道对应的权重值设置为较高的权重值,此时,V通道的像素差分值会对帧间差分信息形成的影响较小,有利于对Y通道和V通道的信息进行识别。In the above formula, D(x, y, t) represents the inter-frame differential information of the pixel at the coordinate (x, y) of the current frame image; Y(x, y, t) represents the pixel differential value at the coordinate (x, y) of the Y channel in the YUV space of the current frame image, and the same applies to Y(x, y, t-1), U(x, y, t), U(x, y, t-1), V(x, y, t), and V(x, y, t-1); W0, W1, and W2 represent the weight values of the pixel differential values in the three color channels. In some embodiments, the above weight values are set according to the moving target that needs to be paid attention to in the video and the background of the video. For example, the information of the moving target that needs to be paid attention to in the video is mainly concentrated in the Y channel. At this time, the information recognition requirements for the Y channel are relatively high, and the weight value corresponding to the Y channel is set to a higher weight value. At this time, the pixel differential value of the Y channel will have a greater impact on the inter-frame differential information, which is conducive to the recognition of the information of the Y channel. For another example, the background information of the picture in the video is mainly concentrated in the V channel. At this time, during the detection process, there is no need to pay attention to the background information. Therefore, the information recognition requirements for the V channel are relatively high. The weight value corresponding to the V channel is set to a higher weight value. At this time, the pixel differential value of the V channel will have less impact on the formation of inter-frame differential information, which is conducive to the recognition of information from the Y channel and the V channel.

采用上述实施例中的方式进行帧间差分信息的确认,可以对所有颜色通道的像素差分值进行关注,从而,使计算结果对运动物体的灰度敏感。当然,在某些场景下,例如,为了适应信号灯等场景,也可以只关注YUV中的一个或多个分量,从而使计算结果对图像中物体颜色变化敏感。By using the method in the above embodiment to confirm the inter-frame difference information, the pixel difference values of all color channels can be paid attention to, so that the calculation result is sensitive to the grayscale of the moving object. Of course, in some scenarios, for example, in order to adapt to the scene of traffic lights, it is also possible to only pay attention to one or more components in YUV, so that the calculation result is sensitive to the color change of the object in the image.

如图3所示,在图1所示的实施例的基础上,上述的步骤103还可以包括如下的步骤:As shown in FIG3 , based on the embodiment shown in FIG1 , the above step 103 may further include the following steps:

步骤1031,将多帧图像集合中各帧图像的帧间差分信息进行累加,确定多帧图像集合的累加差分信息;Step 1031, accumulating the inter-frame difference information of each frame image in the multi-frame image set to determine the accumulated difference information of the multi-frame image set;

在一些实施例中,对多帧图像集合各帧图像的帧间差分信息进行累加,将累加的结果作为多帧图像集合的累加差分信息;该差分信息在后续将用于判断当前帧图像的第一运动区域。差分信息的具体计算公式如下:In some embodiments, the inter-frame differential information of each frame image of the multi-frame image set is accumulated, and the accumulated result is used as the accumulated differential information of the multi-frame image set; the differential information will be used to determine the first motion area of the current frame image later. The specific calculation formula of the differential information is as follows:

C(x,y,Δt)=D(x,y,t1)+D(x,y,t1+1)+…+D(x,y,t2);C(x,y,Δt)=D(x,y,t1)+D(x,y,t1+1)+…+D(x,y,t2);

其中,C(x,y,Δt)表示累加在(x,y)点的像素差分值累加结果;D(x,y,t1)表示t1帧图像在(x,y)处的像素差分值。Among them, C(x, y, Δt) represents the accumulated result of the pixel difference value at the point (x, y); D(x, y, t1) represents the pixel difference value of the t1 frame image at (x, y).

步骤1032,基于所述累加差分信息与预定阈值比较结果,确定所述当前帧图像中的运动像素点;Step 1032, determining the moving pixel points in the current frame image based on the comparison result between the accumulated difference information and a predetermined threshold;

在一些实施例中,预定阈值是依据采集图像的传感器的杂散噪声设定的,传感器的杂散噪声越大,将该预定阈值设定通常也越大,其目的是为了滤除杂散噪声导致的识别错误。例如,两帧图像实质上是相同的,当阈值设定过小时,由于传感器杂散噪声的影响,导致在两帧图像上识别出了运动区域。In some embodiments, the predetermined threshold is set based on the stray noise of the sensor that collects the image. The greater the stray noise of the sensor, the greater the predetermined threshold is usually set, and the purpose is to filter out recognition errors caused by stray noise. For example, two frames of images are substantially the same. When the threshold is set too small, due to the influence of the stray noise of the sensor, the motion area is recognized in the two frames of images.

步骤1033,基于所述当前帧图像中的所述运动像素点,确定所述当前帧图像的第一运动区域。Step 1033: Determine a first motion region of the current frame image based on the motion pixel points in the current frame image.

在一些实施例中,将当前帧图像中所有像素点的累加差分信息确定后,筛选出累加差分信息大于预定阈值的像素,即筛选出运动像素点,运动像素点所占的位置即为第一运动区域。通常情况下,为了确保运动目标的完整,还会将运动像素点周围一定距离内的像素点也作为第一运动区域内的像素值。In some embodiments, after the accumulated differential information of all pixels in the current frame image is determined, pixels whose accumulated differential information is greater than a predetermined threshold are screened out, that is, moving pixels are screened out, and the positions occupied by the moving pixels are the first moving area. Usually, in order to ensure the integrity of the moving target, the pixels within a certain distance around the moving pixels are also taken as the pixel values in the first moving area.

在上述的实施例中,对多帧图像集合中的帧间差分信息进行累加,并依据该累加结果识别运动像素点,在多帧图像集合中,对当前帧进行运动区域的识别,从而能够减少运动区域识别的计算量以及后续运动目标物检测的计算量,大大提高识别运动物体的效率。In the above-mentioned embodiment, the inter-frame differential information in a multi-frame image set is accumulated, and the moving pixels are identified based on the accumulated results. In the multi-frame image set, the moving area of the current frame is identified, thereby reducing the computational complexity of the moving area identification and the subsequent moving target detection, thereby greatly improving the efficiency of identifying moving objects.

如图4所示,在图3所示的实施例的基础上,步骤1033还可以包括如下步骤:As shown in FIG. 4 , based on the embodiment shown in FIG. 3 , step 1033 may further include the following steps:

步骤10331,基于所述运动像素点和预定距离,确定与所述运动像素点的距离在所述预定距离范围内的像素点集合;Step 10331, based on the moving pixel point and the predetermined distance, determining a set of pixel points whose distances from the moving pixel point are within the predetermined distance range;

在一些实施例中,预定距离是依据每一帧图像的场景设定的。例如,当每一帧图像的场景中的目标物都比较大时,将预定距离设定的较大,当每一帧图像中的场景中的目标物都比较小时,将预定距离设定的较小。像素点集合包括了运动像素点以及与运动像素点距离小于预定距离的像素点。该设定的目的是为了使运动目标物的整体都被包含在第一运动区域内,例如,当某一运动目标物的局部发生了运动时,将运动像素点作为运动区域显然是不能将该运动目标物全部包括在第一运动区域内的,但是,通过设置合理的预定距离,将运动像素点周围预定距离内的像素点也作为像素点集合的元素确定第一运动区域时,通常能够将运动目标物包括在第一运动区域内。In some embodiments, the predetermined distance is set based on the scene of each frame of image. For example, when the target objects in the scene of each frame of image are relatively large, the predetermined distance is set to be larger, and when the target objects in the scene of each frame of image are relatively small, the predetermined distance is set to be smaller. The pixel point set includes moving pixels and pixels whose distance from the moving pixels is less than the predetermined distance. The purpose of this setting is to include the entire moving target object in the first moving area. For example, when a part of a moving target object moves, it is obviously impossible to include the entire moving target object in the first moving area by using the moving pixels as the moving area. However, by setting a reasonable predetermined distance and determining the first moving area by using the pixels within the predetermined distance around the moving pixels as elements of the pixel point set, the moving target object can usually be included in the first moving area.

步骤10332,基于所述像素点集合,确定所述第一运动区域。Step 10332: determine the first motion area based on the pixel point set.

在一些实施例中,将运动像素点在当前帧图像中所占的位置以及运动像素点周围预定距离内的像素点的在图像中所占的位置进行合并,得到第一运动区域。例如,当预定距离设置为16个像素点时,此时,一个运动像素点所确定的第一运动区域的尺度为32*32的第一运动区域。此时,第一运动区域既包含了运动像素点,也包含了运动像素点周围预定距离内的像素点。In some embodiments, the position of the moving pixel in the current frame image and the position of the pixel within a predetermined distance around the moving pixel in the image are merged to obtain the first motion region. For example, when the predetermined distance is set to 16 pixels, the scale of the first motion region determined by a moving pixel is a 32*32 first motion region. At this time, the first motion region includes both the moving pixel and the pixel within a predetermined distance around the moving pixel.

采用上述实施例中的技术方案,将运动像素点及运动像素点周围预定距离内的像素点所占当前帧图像的位置作为第一运动区域,能够确保将运动目标物的整体都包含在第一运动区域内,有利于后续对第一运动区域中运动目标物的识别。By adopting the technical solution in the above embodiment, the position of the moving pixel point and the pixel points within a predetermined distance around the moving pixel point in the current frame image is taken as the first moving area, which can ensure that the entire moving target is included in the first moving area, which is facilitating the subsequent identification of the moving target in the first moving area.

如图5所示,在上述图4所示的实施例的基础上,步骤10332还可以包括如下的步骤:As shown in FIG. 5 , based on the embodiment shown in FIG. 4 , step 10332 may further include the following steps:

步骤103321,基于所述像素点集合,确定第二运动区域;Step 103321, determining a second motion area based on the pixel point set;

在一些实施例中,每一个运动像素点都能够确定一个像素点集合,每一个像素集合的各个像素点占的位置合并即为第二运动区域;由于每一个第二运动区域中不仅包含运动像素点,还包含运动像素点周围预定距离内的像素点。当两个运动像素点的距离小于预定距离时,两个运动像素点所对应的像素点集合确定的第二运动区域不可避免的会出现重合的像素点。In some embodiments, each moving pixel point can determine a pixel point set, and the positions occupied by each pixel point in each pixel point set are combined to form the second moving area; since each second moving area includes not only the moving pixel point, but also the pixels within a predetermined distance around the moving pixel point, when the distance between two moving pixels is less than the predetermined distance, the second moving area determined by the pixel point sets corresponding to the two moving pixels will inevitably have overlapping pixels.

步骤103322,基于两个以上的所述第二运动区域所具有的重合的像素点,将两个以上的所述第二运动区域合并为第一运动区域。Step 103322: Based on the overlapping pixels of the two or more second motion regions, merge the two or more second motion regions into a first motion region.

在一些实施例中,当两个第二运动区域具有重合的像素点时,表面其中一个运动像素点在另一个运动像素点对应的第二运动区域之内,此时,可以将两个运动像素点认为是同一个运动目标物所具有的两个运动像素点,因此,将两个第二运动区域合并为第一运动区域,从而能够确保同一个运动目标物不被分割,便于后续的运动目标物的识别。In some embodiments, when two second motion areas have overlapping pixels, one of the motion pixels is within the second motion area corresponding to the other motion pixel. At this time, the two motion pixels can be considered as two motion pixels of the same moving target. Therefore, the two second motion areas are merged into the first motion area, thereby ensuring that the same moving target is not divided, which facilitates the subsequent identification of the moving target.

如图6所示,在上述图4所示的实施例的基础上,步骤10332还可以包括如下的步骤:As shown in FIG. 6 , based on the embodiment shown in FIG. 4 , step 10332 may further include the following steps:

步骤103321,基于所述像素点集合,确定第二运动区域;Step 103321, determining a second motion area based on the pixel point set;

在一些实施例中,每一个运动像素点都能够确定一个像素点集合,每一个像素集合的各个像素点占的位置合并即为第二运动区域。当相邻的两个第二运动区域的距离较小时,通常可以认为两个第二运动区域为同一个目标物上的运动区域。In some embodiments, each moving pixel can determine a pixel set, and the positions occupied by each pixel in each pixel set are combined to form a second moving area. When the distance between two adjacent second moving areas is small, the two second moving areas can usually be considered to be moving areas on the same target object.

步骤103323,基于相邻的两个所述第二运动区域的距离,确定相邻的两个所述第二运动区域的合并结果;Step 103323, determining a merging result of two adjacent second motion regions based on a distance between the two adjacent second motion regions;

在一些实施例中,当运动目标物的其中一部分与背景区域的图像相近时,会导致同一运动目标物识别出的两个第二运动区域之间不连续,此时,为了确保将同一个运动目标物的划分在同一个第一运动区域内,依据相邻的两个第二运动区域的距离判断是否将两个第二运动区域进行合并。当距离小于一个特定的距离时,将两个第二运动区域进行合并,当距离不小于一个特定的距离时,将两个第二运动区域分别作为两个第一运动区域。上述的特定距离可以根据视频中的画面的场景设定,也可以根据需要识别的运动目标物设定。In some embodiments, when a part of a moving target is close to the image of a background area, it will cause discontinuity between the two second motion areas identified for the same moving target. At this time, in order to ensure that the same moving target is divided into the same first motion area, whether to merge the two second motion areas is determined based on the distance between the two adjacent second motion areas. When the distance is less than a specific distance, the two second motion areas are merged. When the distance is not less than a specific distance, the two second motion areas are respectively used as two first motion areas. The above-mentioned specific distance can be set according to the scene of the picture in the video, and can also be set according to the moving target that needs to be identified.

步骤103324,基于所述合并结果,将距离符合预设条件的相邻的两个所述第二运动区域合并为第一运动区域。Step 103324: Based on the merging result, two adjacent second motion areas whose distances meet a preset condition are merged into a first motion area.

在一些实施例中,上述的预定条件例如可以为两个第二运动区域的距离小于特定距离。基于上述的步骤,将当前帧图像中距离小于特定距离的两个第二运动区域合并为第一运动区域。在设置上述特定距离时,需要依据视频中的画面的场景设定,也可以根据需要识别的运动目标物设定,例如,当运动目标物在视频图像中占的比例较大时,可以将特定距离设置的较大,又例如,当视频中的画面的场景颜色较为单一时,可以将特定距离设置的较小。将当前帧图像中的距离小于特定距离的两个第二运动区域合并的的目的是为了确保将同一个运动目标物划分在同一个第一运动区域之内,特定距离如果设置过小,可能会造成完整的运动物体被分割,导致后续模块无法正确识别;特定距离如果设置过大,会导致第一运动区域的尺度较大,后续对第一运动区域的缩放以及对被检测区域的识别的计算量会增加。In some embodiments, the above-mentioned predetermined condition may be, for example, that the distance between the two second motion areas is less than a specific distance. Based on the above steps, the two second motion areas in the current frame image whose distance is less than the specific distance are merged into the first motion area. When setting the above-mentioned specific distance, it is necessary to set it according to the scene of the picture in the video, and it can also be set according to the moving target to be identified. For example, when the moving target occupies a large proportion in the video image, the specific distance can be set to a larger value. For example, when the scene color of the picture in the video is relatively single, the specific distance can be set to a smaller value. The purpose of merging the two second motion areas whose distance in the current frame image is less than the specific distance is to ensure that the same moving target is divided into the same first motion area. If the specific distance is set too small, the complete moving object may be segmented, resulting in the inability of subsequent modules to correctly identify it; if the specific distance is set too large, the scale of the first motion area will be larger, and the subsequent scaling of the first motion area and the calculation amount of the recognition of the detected area will increase.

如图7所示,在上述图1所示的实施例的基础上,所述方法还包括如下步骤:As shown in FIG. 7 , based on the embodiment shown in FIG. 1 , the method further includes the following steps:

步骤106,基于所述当前帧图像与预定条件的比较结果,确定参考图像;Step 106, determining a reference image based on a comparison result between the current frame image and a predetermined condition;

在一些实施例中,视频中的画面表达的是背景缓慢变化的场景,此时,需要间隔性的将参考图像,有助于系统对缓慢变化背景的掌握。预定条件可以依据视频中的画面的背景确定,也可以依据视频中的画面的运动目标物确定,例如,可以依据视频中的画面的背景变化速度,每间隔固定数量的历史帧图像即选取当前帧图像作为参考图像,当视频中的画面的背景变化速度较快时,间隔的历史帧图像数量较少,当视频中的画面的背景变化速度较慢时,间隔的历史帧图像数量较多。也可以依据第一运动区域所占当前帧图像的比例确定是否将当前帧图像作为参考图像。In some embodiments, the picture in the video expresses a scene with a slowly changing background. In this case, reference images need to be used at intervals to help the system grasp the slowly changing background. The predetermined condition can be determined based on the background of the picture in the video, or it can be determined based on the moving target of the picture in the video. For example, the current frame image can be selected as the reference image every fixed number of historical frame images based on the background change speed of the picture in the video. When the background change speed of the picture in the video is fast, the number of historical frame images at intervals is small, and when the background change speed of the picture in the video is slow, the number of historical frame images at intervals is large. It is also possible to determine whether to use the current frame image as a reference image based on the proportion of the first motion area in the current frame image.

步骤107,对所述参考图像逐次进行降采样处理,得到至少一个预定尺度的被检测参考图像;Step 107, downsampling the reference image one by one to obtain at least one detected reference image of a predetermined scale;

在一些实施例中,参考图像同样受限于对运动目标物进行检测的模块(例如能够执行神经网络运算的SOC芯片)所支持的尺度,因此,需要对参考图像进行至少一次降采样,得到至少一个预定尺度的被检测参考图像。由于单次降采样所能得到的图像尺度最小为原始图像尺度的1/2,因此,当参考图像的尺度与预定尺度相差较大时,需要对参考图像进行多次降采样,每次降采样得到一帧预定尺度的被检测参考图像,直到得到运动目标物进行检测的模块所支持的尺度的被检测参考图像,因此,被检测参考图像的数量需要由对运动目标物进行检测的模块所支持的尺度以及参考图像的尺度来确定。预定尺度可以由对运动目标物进行检测的模块所支持的尺度来确定。In some embodiments, the reference image is also limited by the scale supported by the module for detecting moving objects (e.g., a SOC chip capable of performing neural network operations). Therefore, the reference image needs to be downsampled at least once to obtain at least one detected reference image of a predetermined scale. Since the minimum image scale that can be obtained by a single downsampling is 1/2 of the original image scale, when the scale of the reference image differs greatly from the predetermined scale, the reference image needs to be downsampled multiple times, and each downsampling obtains a frame of a detected reference image of a predetermined scale until a detected reference image of a scale supported by the module for detecting moving objects is obtained. Therefore, the number of detected reference images needs to be determined by the scale supported by the module for detecting moving objects and the scale of the reference image. The predetermined scale can be determined by the scale supported by the module for detecting moving objects.

步骤108,基于所述至少一个预定尺度的被检测参考图像,确定所述参考图像中的所述运动目标物。Step 108: Determine the moving target in the reference image based on the detected reference image of the at least one predetermined scale.

在一些实施例中,在得到被检测参考图像后,将被检测参考图像送入到用于对运动目标物进行检测的模块中,例如能够执行神经网络运算的SOC芯片。利用该模块对参考图像中的运动目标物进行检测。In some embodiments, after obtaining the detected reference image, the detected reference image is sent to a module for detecting moving objects, such as a SOC chip capable of performing neural network operations. The module is used to detect moving objects in the reference image.

在上述的实施例中,通过间隔的选取参考图像,能够识别到视频中的画面的背景变化,从而消除到背景变化对于运动目标物识别的影响。例如,随着时间的变化,太阳升起和落下引起的光照变化会影响视频中的画面各帧图像的亮度,采用本实施例的方式,能够消除由于背景亮度变化对运动物体识别的影响。In the above-mentioned embodiment, by selecting reference images at intervals, the background changes of the video can be identified, thereby eliminating the influence of the background changes on the recognition of moving objects. For example, as time changes, the illumination changes caused by the rising and setting of the sun will affect the brightness of each frame of the video. By adopting the method of this embodiment, the influence of the background brightness changes on the recognition of moving objects can be eliminated.

在上述图7所示的实施例的基础上,步骤106包括:基于所述当前帧图像与前一所述参考图像间隔的帧图像的数量,确定参考图像。Based on the embodiment shown in FIG. 7 , step 106 includes: determining a reference image based on the number of frame images between the current frame image and the previous reference image.

在一些实施例中,上述的参考图像的确定方式是一种静态的确定方式,其具体的方式是每间隔固定的帧图像数即取出一帧图像作为参考图像,例如将参考图像称为A帧图像,将第一运动区域进行缩放的帧图像称为B帧图像,通过设置周期T,每隔一个T周期,周期性的将参考图像缩放得到的被检测参考图像送入运动目标物识别模块做处理。例如,以帧率为50Hz的视频为例,当T为100毫秒时,即,每间隔100毫秒即将一帧帧图像作为参考图像,此时,参考图像和对第一运动区域进行缩放的帧图像的排列顺序为ABBBBABBBB。由于在同一个视频中,帧图像率是固定的,即每一帧图像所占的时间时固定的,占用的时间时固定的,规定了固定的周期即确定了间隔的帧图像数。当然,也可以采用直接设置固定的间隔帧图像数,例如设定每间隔3帧图像即获取一帧图像作为参考图像,此时,全图缩放的帧图像和第一运动区域缩放的帧图像排列将如下:ABBBABBB。In some embodiments, the above-mentioned method of determining the reference image is a static determination method, and the specific method is to take out a frame image as a reference image at every fixed number of frame images. For example, the reference image is called an A frame image, and the frame image that scales the first motion area is called a B frame image. By setting a period T, the reference image is periodically scaled to obtain the detected reference image every T period and sent to the moving target recognition module for processing. For example, taking a video with a frame rate of 50Hz as an example, when T is 100 milliseconds, that is, a frame image is taken as a reference image at every 100 millisecond interval. At this time, the arrangement order of the reference image and the frame image that scales the first motion area is ABBBBABBBB. Since in the same video, the frame image rate is fixed, that is, the time occupied by each frame image is fixed, and the fixed period is specified to determine the number of frame images at the interval. Of course, you can also directly set a fixed number of interval frame images, for example, set it to obtain a frame image as a reference image every 3 frames. At this time, the frame images of the full image zoom and the frame images of the first motion area zoom will be arranged as follows: ABBBABBB.

采用本实施例的方式设置参考图像,能够消除背景环境缓慢变化所造成的影响,有利于对移动目标物的精准识别。By setting the reference image in the manner of this embodiment, the influence caused by the slow changes in the background environment can be eliminated, which is conducive to the accurate recognition of the moving target object.

如图8所示,在上述图7所示的实施例的基础上,步骤106还可以包括如下步骤:As shown in FIG8 , based on the embodiment shown in FIG7 , step 106 may further include the following steps:

步骤1061,确定所述当前帧图像中的第一运动区域所占所述当前帧图像的比例;Step 1061, determining the proportion of the first motion region in the current frame image to the current frame image;

在一些实施例中,当第一运动区域所占当前帧图像的比例是指第一运动区域中的像素数量与当前帧图像中所有像素数量的比值。在一些实施例中,第一运动区域可以有多个,当第一运动区域具有多个时,该比例是指多个第一运动区域中的像素数量之和与当前帧图像中所有像素数量的比值。In some embodiments, the ratio of the first motion region to the current frame image refers to the ratio of the number of pixels in the first motion region to the number of all pixels in the current frame image. In some embodiments, there may be multiple first motion regions. When there are multiple first motion regions, the ratio refers to the ratio of the sum of the number of pixels in the multiple first motion regions to the number of all pixels in the current frame image.

步骤1062,基于所述比例以及预定阈值范围的比较结果,确定参考图像。Step 1062: Determine a reference image based on the comparison result of the ratio and a predetermined threshold range.

在一些实施例中,当检测到的运动区域超过全图的一定比例,自动将全图进行缩放后送入运动目标物检测模块做处理,运动区域的比例可以根据不同的应用场景配置。例如,在人流、车流或动物活动比较密集的场景下,将该比例设置的较小,有助于对视频中的画面的活动细节进行识别,此时,A帧图像和B帧图像的比例是动态变化的。例如,第一帧图像、第四帧图像至第六帧图像以及第十二帧图像的第一运动区域所占比例超过全图的一定比例时,将第一帧图像、第四帧图像至第六帧图像以及第十二帧图像作为参考帧,而其他帧图像的第一运动区域不超过全图一定比例,对第一运动区域进行缩放,从而,参考图像和对第一运动区域进行缩放的帧图像的排列顺序如下:ABBAAABBBBBABB。In some embodiments, when the detected motion area exceeds a certain proportion of the whole image, the whole image is automatically scaled and sent to the motion target detection module for processing, and the proportion of the motion area can be configured according to different application scenarios. For example, in a scene with dense flow of people, vehicles or animals, setting the proportion to be smaller helps to identify the moving details of the picture in the video. At this time, the proportion of the A frame image and the B frame image changes dynamically. For example, when the proportion of the first motion area of the first frame image, the fourth frame image to the sixth frame image and the twelfth frame image exceeds a certain proportion of the whole image, the first frame image, the fourth frame image to the sixth frame image and the twelfth frame image are used as reference frames, and the first motion area of other frame images does not exceed a certain proportion of the whole image, and the first motion area is scaled, so that the reference image and the frame image for scaling the first motion area are arranged in the following order: ABBAAABBBBBABB.

采用本实施例的技术方案,能够依据当前帧图像中运动目标物的比例确定参考图像,从而,能够充分识别视频中的画面运动目标物的活动细节。By adopting the technical solution of this embodiment, the reference image can be determined according to the proportion of the moving target in the current frame image, so that the activity details of the moving target in the video can be fully recognized.

本领域技术人员应当理解,上述静态和动态的两种设置参考图像的方式可以进行切换。例如,检测单位时间内的运动像素点的比例(或者绝对数量),当比例较低时,设置为静态方式选取参考图像。又例如,根据场景,规定夜晚为静态方式选取参考图像,白天为动态方式选取参考图像。Those skilled in the art should understand that the above two methods of setting reference images, static and dynamic, can be switched. For example, the ratio (or absolute number) of moving pixels per unit time is detected. When the ratio is low, the reference image is selected in a static manner. For another example, according to the scene, it is specified that the reference image is selected in a static manner at night and in a dynamic manner during the day.

在上述图7所示的实施例基础上,步骤107之后还可以包括如下的步骤:Based on the embodiment shown in FIG. 7 above, the following steps may be further included after step 107:

基于所述当前帧图像的所述被检测区域以及在所述当前帧图像之前的一帧图像所述参考图像的所述被检测参考图像,确定所述当前帧图像对应的预定尺度的被检测图像。Based on the detected area of the current frame image and the detected reference image of the reference image of a frame image before the current frame image, a detected image of a predetermined scale corresponding to the current frame image is determined.

在一些实施例中,本步骤可以通过两种方式实现,其中一种如下:根据第一运动运动区域的坐标,得到运动区域相对于图像起始点的位置,该相对位置可以换算成相对图像起点的地址偏移。该方式将第一运动区域的缩放结果,即至少一个预定尺度的被检测区域存储至存储单元中,当对运动目标物进行检测的模块需要当前帧图像的全图的缩放结果时,可以将被检测区域和当前帧图像之前的一帧参考图像的缩放结果,即至少一帧被检测参考图像同时读出,根据第一运动区域的地址偏移,将被检测参考图像和被检测区域求和,求和的结果即为当前帧图像的全图的缩放结果。第二种如下:如果对运动目标物进行检测的模块需要直接得到当前帧图像的全图缩放结果,而不是通过存储单元中转,可以在被检测区域的计算过程中,同时将存储单元中保存的之前的被检测参考图像读出,根据当前图像像素是否是运动区域来判断是将被检测区域与之前的被检测参考图像求和输出给后续处理模块还是将存储单元中的之前的被检测参考图像输出给后续处理模块,如果该像素在第一运动区域中,则将被检测区域和之前的被检测参考图像求和输出给后续模块,否则,直接将之前的被检测参考图像输出给后续模块处理。这种处理将当前帧图像中的运动区域的所得到的预定尺度的被检测区域传送至对运动目标物进行检测的模块,省去了预定尺度的被检测区域存入存储单元和从存储单元读出的过程,因此可以大大缩减图像处理的时延。In some embodiments, this step can be implemented in two ways, one of which is as follows: according to the coordinates of the first motion motion area, the position of the motion area relative to the starting point of the image is obtained, and the relative position can be converted into an address offset relative to the starting point of the image. This method stores the scaling result of the first motion area, that is, at least one detected area of a predetermined scale, in a storage unit. When the module for detecting the moving target needs the scaling result of the entire image of the current frame image, the scaling result of the detected area and a frame of reference image before the current frame image, that is, at least one frame of detected reference image, can be read out at the same time. According to the address offset of the first motion area, the detected reference image and the detected area are summed, and the summed result is the scaling result of the entire image of the current frame image. The second is as follows: if the module for detecting moving targets needs to directly obtain the full image scaling result of the current frame image instead of transferring it through a storage unit, the previously detected reference image stored in the storage unit can be read out during the calculation process of the detected area, and whether the detected area and the previously detected reference image are summed and output to the subsequent processing module or the previously detected reference image in the storage unit is output to the subsequent processing module is determined based on whether the current image pixel is a moving area. If the pixel is in the first moving area, the detected area and the previously detected reference image are summed and output to the subsequent module, otherwise, the previously detected reference image is directly output to the subsequent module for processing. This processing transmits the detected area of the predetermined scale obtained in the moving area of the current frame image to the module for detecting moving targets, eliminating the process of storing the detected area of the predetermined scale in the storage unit and reading it out from the storage unit, thereby greatly reducing the delay of image processing.

示例性装置Exemplary Devices

图9是本公开一示例性实施例提供的一种运动物体的检测装置,包括:FIG9 is a moving object detection device provided by an exemplary embodiment of the present disclosure, comprising:

差分信息获取模块901,用户基于当前帧图像与当前帧图像的前一帧图像,确定所述当前帧图像与所述前一帧图像的帧间差分信息;The difference information acquisition module 901, the user determines the inter-frame difference information between the current frame image and the previous frame image based on the current frame image and the previous frame image of the current frame image;

在一些实施例中,当前帧图像是指图像处理过程中正在被处理的一帧图像的图像;前一帧图像是指在当前帧图像之前并且与当前帧图像相邻的一帧图像;帧间差分信息是指将当前帧图像与前一帧图像进行差分计算得到的差值图像以及差值图像中各像素的亮度或灰度信息。In some embodiments, the current frame image refers to an image frame being processed during the image processing process; the previous frame image refers to an image frame that is before the current frame image and adjacent to the current frame image; the inter-frame difference information refers to the difference image obtained by performing a difference calculation between the current frame image and the previous frame image and the brightness or grayscale information of each pixel in the difference image.

多帧图像集合确定模块902,用于基于所述当前帧图像以及当前帧图像之前预定数量的历史帧图像,确定多帧图像集合;A multi-frame image set determination module 902, configured to determine a multi-frame image set based on the current frame image and a predetermined number of historical frame images before the current frame image;

在一些实施例中,历史帧图像是指在当前帧图像之前的多帧图像,在一些优选的实施例中,历史帧图像是指在当前帧图像之前的连续的多帧图像;多帧图像集合是指包括了在当前帧图像之前的多帧图像的集合。历史帧图像的数量可以依据视频处理过程中对实时性的要求进行选用,例如,当实时性较高时,用一帧图像历史帧图像,当实时性要求较低时,可以选用两帧图像或三帧图像历史帧图像。在实际实现过程中,还可以依据片上系统(SOC)的带宽进行历史帧图像数量的设置,例如,当片上系统(SOC)对带宽比较敏感,则可以设置历史帧图像为一帧图像,每一帧图像都会计算并更新运动区域,当片上系统(SOC)有充分带宽时,则可以计算连续多帧图像累计的差分结果。In some embodiments, the historical frame image refers to multiple frame images before the current frame image. In some preferred embodiments, the historical frame image refers to multiple frame images before the current frame image; a multi-frame image set refers to a set including multiple frame images before the current frame image. The number of historical frame images can be selected according to the real-time requirements in the video processing process. For example, when the real-time requirements are high, one frame of historical frame images is used. When the real-time requirements are low, two or three frames of historical frame images can be selected. In the actual implementation process, the number of historical frame images can also be set according to the bandwidth of the system on chip (SOC). For example, when the system on chip (SOC) is sensitive to bandwidth, the historical frame image can be set to one frame image. Each frame image will calculate and update the motion area. When the system on chip (SOC) has sufficient bandwidth, the differential result accumulated by the continuous multiple frames of images can be calculated.

第一运动区域获取模块903,用于基于所述多帧图像集合中各帧图像的所述帧间差分信息,在所述当前帧图像中确定第一运动区域;A first motion region acquisition module 903, configured to determine a first motion region in the current frame image based on the inter-frame difference information of each frame image in the multi-frame image set;

在一些实施例中,帧间差分信息是指将当前帧图像与前一帧图像进行差分计算得到的差值图像以及差值图像中各像素的亮度或灰度信息。在多帧图像集合中的多个连续的帧间差分信息进行累加,得到多个连续的帧间差分信息的累加结果。当在该累加结果中,特定的像素点的累加结果超过指定的阈值时,在多帧图像集合中的最后一帧图像中的对应像素点被认为是运动像素点,该运动像素点以及在该运动像素点周围预定距离中的各个像素点集合所在的位置为第一运动区域。由于在对多帧图像集合的帧间差分信息进行累加时,会将多帧图像的运动像素进行累加,得到的结果中包含了每帧图像中的运动像素,因此,会导致累加的结果中将运动目标物沿其运动方向产生鬼影,因此,前一步骤中的多帧图像集合中的帧图像的数量例如可以选取为不大于3的数量,以避免鬼影的产生。In some embodiments, the inter-frame difference information refers to the difference image obtained by performing a difference calculation between the current frame image and the previous frame image, and the brightness or grayscale information of each pixel in the difference image. Multiple continuous inter-frame difference information in a multi-frame image set is accumulated to obtain a cumulative result of multiple continuous inter-frame difference information. When the cumulative result of a specific pixel point exceeds a specified threshold in the cumulative result, the corresponding pixel point in the last frame image in the multi-frame image set is considered to be a moving pixel point, and the position of the moving pixel point and each pixel point set within a predetermined distance around the moving pixel point is the first motion area. Since the moving pixels of the multi-frame images are accumulated when the inter-frame difference information of the multi-frame image set is accumulated, the obtained result includes the moving pixels in each frame image, so that the moving target object will be ghosted along its moving direction in the accumulated result. Therefore, the number of frame images in the multi-frame image set in the previous step can be selected as a number not greater than 3, for example, to avoid the generation of ghosts.

尺度转换模块904,用于基于所述第一运动区域,确定至少一个预定尺度的被检测区域;A scale conversion module 904 is used to determine at least one detected area of a predetermined scale based on the first motion area;

在一些实施例中,对第一运动区域进行缩放,得到至少一个预定尺度的被检测区域,在后续的处理过程中,将上述至少一个预定尺度的被检测区域送入对运动目标物进行检测的模块,对运动目标物进行检测的模块可以是SOC芯片、FPGA芯片以及ASIC芯片等,例如能够执行神经网络运算的SOC芯片。上述的预定尺度是由对运动目标物进行检测的模块所支持的尺度确定的,对于被检测区域的数量,是由第一运动区域的尺度以及对运动目标物进行检测的模块所支持的尺度确定的。In some embodiments, the first motion region is scaled to obtain at least one detected region of a predetermined scale. In the subsequent processing, the at least one detected region of a predetermined scale is sent to a module for detecting moving targets. The module for detecting moving targets may be a SOC chip, an FPGA chip, an ASIC chip, etc., such as a SOC chip capable of performing neural network operations. The predetermined scale is determined by the scale supported by the module for detecting moving targets, and the number of detected regions is determined by the scale of the first motion region and the scale supported by the module for detecting moving targets.

运动目标物检测模块905,基于所述当前帧图像中的所述被检测区域,确定所述被检测区域中的运动目标物。The moving object detection module 905 determines the moving object in the detected area based on the detected area in the current frame image.

在一些实施例中,被检测区域是当前帧图像中具备运动目标物的部分图像,基于被检测区域进行运动目标物的检测,能够减少计算量,同时还能够确保检测的准确性。运动目标物是是指在当前帧图像与当前帧图像之前的前一帧图像中发生位置变化的物体,例如,行进中的车辆、奔跑中的动物或者行走中的人物等。In some embodiments, the detected area is a portion of the current frame image that has a moving target. Detecting the moving target based on the detected area can reduce the amount of calculation while ensuring the accuracy of the detection. A moving target refers to an object that has changed position between the current frame image and the previous frame image before the current frame image, such as a moving vehicle, a running animal, or a walking person.

在本公开的技术方案中,通过对多帧图像集合中的差分信息,判断当前帧图像中的第一运动区域,然后依据第一运动区域进行计算,得到预定尺度的被检测区域,并依据被检测区域对运动目标物进行检测,由于被检测区域是当前帧图像中的局部图像,因此,针对被检测区域进行计算,能够大幅减少计算被检测区域的计算量,提高计算效率。In the technical solution disclosed in the present invention, the first motion area in the current frame image is determined by the differential information in the multi-frame image set, and then calculations are performed based on the first motion area to obtain a detected area of a predetermined scale, and the moving target is detected based on the detected area. Since the detected area is a local image in the current frame image, calculations are performed on the detected area, which can greatly reduce the amount of calculations of the detected area and improve calculation efficiency.

如图10所示,在上述图9的实施例基础上,差分信息获取模块901还可以包括如下的子模块:As shown in FIG. 10 , based on the embodiment of FIG. 9 , the differential information acquisition module 901 may further include the following submodules:

像素差分子模块9011,用于基于所述当前帧图像与所述前一帧图像对应的像素值,确定预定颜色空间中预定颜色通道的对应的像素差分值;A pixel difference submodule 9011 is used to determine a corresponding pixel difference value of a predetermined color channel in a predetermined color space based on the pixel values corresponding to the current frame image and the previous frame image;

在一些实施例中,每帧图像在预定颜色空间中预定颜色通道都具有像素值,在计算像素差分值时,将当前帧图像与前一帧图像在预定颜色空间中预定颜色通道的像素值进行差分,即得到像素差分值。以当前帧图像和前一帧图像在YUV空间中计算为例,将当前帧图像在YUV空间中的Y通道的像素值与前一帧图像YUV空间中的Y通道的像素值进行差分,即得到了当前帧图像与前一帧图像在Y通道的像素差分值。In some embodiments, each frame image has a pixel value in a predetermined color channel in a predetermined color space, and when calculating the pixel difference value, the pixel value of the predetermined color channel in the predetermined color space of the current frame image is differentiated from that of the previous frame image, so as to obtain the pixel difference value. Taking the calculation of the current frame image and the previous frame image in the YUV space as an example, the pixel value of the Y channel of the current frame image in the YUV space is differentiated from the pixel value of the Y channel of the previous frame image in the YUV space, so as to obtain the pixel difference value of the Y channel of the current frame image and the previous frame image.

以当前帧图像和前一帧图像在YUV空间中计算为例,其计算过程如下:Taking the calculation of the current frame image and the previous frame image in YUV space as an example, the calculation process is as follows:

对于Y通道对应的像素差分值计算公式如下:The calculation formula for the pixel difference value corresponding to the Y channel is as follows:

|Y(x,y,t)–Y(x,y,t-1)|;|Y(x,y,t)–Y(x,y,t-1)|;

对于U通道对应的像素差分值计算公式如下:The calculation formula for the pixel difference value corresponding to the U channel is as follows:

|U(x,y,t)–U(x,y,t-1)|;|U(x,y,t)–U(x,y,t-1)|;

对于V通道对应的像素差分值计算公式如下:The calculation formula for the pixel difference value corresponding to the V channel is as follows:

|V(x,y,t)–V(x,y,t-1)|;|V(x,y,t)–V(x,y,t-1)|;

其中,x,y为图像的坐标;t,t-1为当前帧图像和前一帧图像的帧图像数;Y,U,V分别表示三个通道,具体地,Y(x,y,t)表示当前帧图像在YUV空间中的Y通道中坐标为(x,y)处的像素值。Among them, x, y are the coordinates of the image; t, t-1 are the frame image numbers of the current frame image and the previous frame image; Y, U, and V represent three channels respectively. Specifically, Y(x, y, t) represents the pixel value at the coordinate (x, y) in the Y channel of the current frame image in the YUV space.

本领域技术人员应当能够理解,上述仅以YUV空间中计算过程为例,在计算过程中,还可以在RGB,HSV或HSL空间中计算。Those skilled in the art should be able to understand that the above only takes the calculation process in the YUV space as an example, and during the calculation process, calculation can also be performed in the RGB, HSV or HSL space.

帧间差分子模块9012,用于基于所述像素差分值和预定的权重值,确定所述帧间差分信息。The inter-frame difference submodule 9012 is used to determine the inter-frame difference information based on the pixel difference value and a predetermined weight value.

在一些实施例中,像素差分值为上一步骤中计算出的预定的颜色空间中预定颜色通道的像素差分值,将上述的差分值依据预先确定的权重值进行加权计算,得到帧间差分信息。上述的权重值依据视频中的画面需要关注的运动目标物以及视频中的画面的背景进行设定,例如,视频中的画面需要关注的运动目标物的信息主要集中在Y通道中,此时,对Y通道的信息识别要求较高,将Y通道对应的权重值设置为较高的权重值,此时,Y通道的像素差分值会对帧间差分信息形成较大的影响,有利于对Y通道的信息进行识别。又例如,视频中的画面的背景的信息主要集中在V通道中,此时,在检测过程中,不需要对背景的信息进行关注,因此,对V通道的信息识别要求较高,将V通道对应的权重值设置为较高的权重值,此时,V通道的像素差分值会对帧间差分信息形成的影响较小,有利于对Y通道和V通道的信息进行识别。In some embodiments, the pixel difference value is the pixel difference value of the predetermined color channel in the predetermined color space calculated in the previous step, and the above-mentioned difference value is weighted and calculated according to the predetermined weight value to obtain the inter-frame difference information. The above-mentioned weight value is set according to the moving target that needs to be paid attention to in the video picture and the background of the picture in the video. For example, the information of the moving target that needs to be paid attention to in the video picture is mainly concentrated in the Y channel. At this time, the information recognition requirement for the Y channel is relatively high. The weight value corresponding to the Y channel is set to a relatively high weight value. At this time, the pixel difference value of the Y channel will have a relatively large impact on the inter-frame difference information, which is conducive to the identification of the information of the Y channel. For another example, the background information of the picture in the video is mainly concentrated in the V channel. At this time, during the detection process, it is not necessary to pay attention to the background information. Therefore, the information recognition requirement for the V channel is relatively high. The weight value corresponding to the V channel is set to a relatively high weight value. At this time, the pixel difference value of the V channel will have a relatively small impact on the inter-frame difference information, which is conducive to the identification of the information of the Y channel and the V channel.

仍以当前帧图像和前一帧图像在YUV空间中计算为例,其计算过程如下:Still taking the calculation of the current frame image and the previous frame image in the YUV space as an example, the calculation process is as follows:

D(x,y,t)=((|Y(x,y,t)–Y(x,y,t-1)|<<W0)+D(x,y,t)=((|Y(x,y,t)–Y(x,y,t-1)|<<W0)+

(|U(x,y,t)–U(x,y,t-1)|<<W1)+(|U(x,y,t)–U(x,y,t-1)|<<W1)+

(|V(x,y,t)–V(x,y,t-1)|<<W2))(|V(x,y,t)–V(x,y,t-1)|<<W2))

其中,W0+W1+W2=100%。Among them, W0+W1+W2=100%.

在上述的公式中,D(x,y,t)表示当前帧图像在坐标(x,y)处的像素的帧间差分信息;Y(x,y,t)表示当前帧图像在YUV空间中Y通道的坐标(x,y)处的像素差分值,Y(x,y,t-1),U(x,y,t),U(x,y,t-1),V(x,y,t),V(x,y,t-1)同理;W0,W1和W2表示在三个颜色通道中像素差分值的权重值。在一些实施例中,上述的权重值依据视频中的画面需要关注的运动目标物以及视频中的画面的背景进行设定,例如,视频中的画面需要关注的运动目标物的信息主要集中在Y通道中,此时,对Y通道的信息识别要求较高,将Y通道对应的权重值设置为较高的权重值,此时,Y通道的像素差分值会对帧间差分信息形成较大的影响,有利于对Y通道的信息进行识别。又例如,视频中的画面的背景的信息主要集中在V通道中,此时,在检测过程中,不需要对背景的信息进行关注,因此,对V通道的信息识别要求较高,将V通道对应的权重值设置为较高的权重值,此时,V通道的像素差分值会对帧间差分信息形成的影响较小,有利于对Y通道和V通道的信息进行识别。In the above formula, D(x, y, t) represents the inter-frame differential information of the pixel at the coordinate (x, y) of the current frame image; Y(x, y, t) represents the pixel differential value at the coordinate (x, y) of the Y channel in the YUV space of the current frame image, and the same applies to Y(x, y, t-1), U(x, y, t), U(x, y, t-1), V(x, y, t), and V(x, y, t-1); W0, W1, and W2 represent the weight values of the pixel differential values in the three color channels. In some embodiments, the above weight values are set according to the moving target that needs to be paid attention to in the video and the background of the video. For example, the information of the moving target that needs to be paid attention to in the video is mainly concentrated in the Y channel. At this time, the information recognition requirements for the Y channel are relatively high, and the weight value corresponding to the Y channel is set to a higher weight value. At this time, the pixel differential value of the Y channel will have a greater impact on the inter-frame differential information, which is conducive to the recognition of the information of the Y channel. For another example, the background information of the picture in the video is mainly concentrated in the V channel. At this time, during the detection process, there is no need to pay attention to the background information. Therefore, the information recognition requirements for the V channel are relatively high. The weight value corresponding to the V channel is set to a higher weight value. At this time, the pixel differential value of the V channel will have less impact on the formation of inter-frame differential information, which is conducive to the recognition of information from the Y channel and the V channel.

采用上述实施例中的方式进行帧间差分信息的确认,可以对所有颜色通道的像素差分值进行关注,从而,使计算结果对运动物体的灰度敏感。当然,在某些场景下,例如,为了适应信号灯等场景,也可以只关注YUV中的一个或多个分量,从而使计算结果对图像中物体颜色变化敏感。By using the method in the above embodiment to confirm the inter-frame difference information, the pixel difference values of all color channels can be paid attention to, so that the calculation result is sensitive to the grayscale of the moving object. Of course, in some scenarios, for example, in order to adapt to the scene of traffic lights, it is also possible to only pay attention to one or more components in YUV, so that the calculation result is sensitive to the color change of the object in the image.

如图11所示,在图9所示的实施例的基础上,上述的第一运动区域获取模块903还可以包括如下的子模块:As shown in FIG. 11 , based on the embodiment shown in FIG. 9 , the first motion region acquisition module 903 may further include the following submodules:

差分累加子模块9031,用于将多帧图像集合中各帧图像的帧间差分信息进行累加,确定多帧图像集合的累加差分信息;The difference accumulation submodule 9031 is used to accumulate the inter-frame difference information of each frame image in the multi-frame image set to determine the accumulated difference information of the multi-frame image set;

在一些实施例中,对多帧图像集合各帧图像的帧间差分信息进行累加,将累加的结果作为多帧图像集合的累加差分信息;该差分信息在后续将用于判断当前帧图像的第一运动区域。差分信息的具体计算公式如下:In some embodiments, the inter-frame differential information of each frame image of the multi-frame image set is accumulated, and the accumulated result is used as the accumulated differential information of the multi-frame image set; the differential information will be used to determine the first motion area of the current frame image later. The specific calculation formula of the differential information is as follows:

C(x,y,Δt)=D(x,y,t1)+D(x,y,t1+1)+…+D(x,y,t2);C(x,y,Δt)=D(x,y,t1)+D(x,y,t1+1)+…+D(x,y,t2);

其中,C(x,y,Δt)表示累加在(x,y)点的像素差分值累加结果;D(x,y,t1)表示t1帧图像在(x,y)处的像素差分值。Among them, C(x, y, Δt) represents the accumulated result of the pixel difference value at the point (x, y); D(x, y, t1) represents the pixel difference value of the t1 frame image at (x, y).

运动像素点确定子模块9032,用于基于所述累加差分信息与预定阈值比较结果,确定所述当前帧图像中的运动像素点;A moving pixel point determination submodule 9032 is used to determine the moving pixel points in the current frame image based on the comparison result between the accumulated difference information and a predetermined threshold value;

在一些实施例中,预定阈值是依据采集图像的传感器的杂散噪声设定的,传感器的杂散噪声越大,将该预定阈值设定通常也越大,其目的是为了滤除杂散噪声导致的识别错误。例如,两帧图像实质上是相同的,当阈值设定过小时,由于传感器杂散噪声的影响,导致在两帧图像上识别出了运动区域。In some embodiments, the predetermined threshold is set based on the stray noise of the sensor that collects the image. The greater the stray noise of the sensor, the greater the predetermined threshold is usually set, and the purpose is to filter out recognition errors caused by stray noise. For example, two frames of images are substantially the same. When the threshold is set too small, due to the influence of the stray noise of the sensor, the motion area is recognized in the two frames of images.

第一运动区域子模块9033,基于所述当前帧图像中的所述运动像素点,确定所述当前帧图像的第一运动区域。The first motion region submodule 9033 determines a first motion region of the current frame image based on the motion pixel points in the current frame image.

在一些实施例中,将当前帧图像中所有像素点的累加差分信息确定后,筛选出累加差分信息大于预定阈值的像素,即筛选出运动像素点,运动像素点所占的位置即为第一运动区域。通常情况下,为了确保运动目标的完整,还会将运动像素点周围一定距离内的像素点也作为第一运动区域内的像素值。In some embodiments, after the accumulated differential information of all pixels in the current frame image is determined, pixels whose accumulated differential information is greater than a predetermined threshold are screened out, that is, moving pixels are screened out, and the positions occupied by the moving pixels are the first moving area. Usually, in order to ensure the integrity of the moving target, the pixels within a certain distance around the moving pixels are also taken as the pixel values in the first moving area.

在上述的实施例中,对多帧图像集合中的帧间差分信息进行累加,并依据该累加结果识别运动像素点,在多帧图像集合中,对当前帧进行运动区域的识别,从而能够减少运动区域识别的计算量以及后续运动目标物检测的计算量。In the above-mentioned embodiment, the inter-frame differential information in a multi-frame image set is accumulated, and the moving pixels are identified based on the accumulated results. In the multi-frame image set, the moving area of the current frame is identified, thereby reducing the computational complexity of the moving area identification and the subsequent moving target detection.

如图12所示,在图11所示的实施例的基础上,第一运动区域子模块9033还可以包括如下单元:As shown in FIG. 12 , based on the embodiment shown in FIG. 11 , the first motion region submodule 9033 may further include the following units:

像素点集合确定单元90331,用于基于所述运动像素点和预定距离,确定与所述运动像素点的距离在所述预定距离范围内的像素点集合;A pixel point set determining unit 90331 is used to determine, based on the moving pixel point and the predetermined distance, a pixel point set whose distance from the moving pixel point is within the predetermined distance range;

在一些实施例中,预定距离是依据每一帧图像的场景设定的。例如,当每一帧图像的场景中的目标物都比较大时,将预定距离设定的较大,当每一帧图像中的场景中的目标物都比较小时,将预定距离设定的较小。像素点集合包括了运动像素点以及与运动像素点距离小于预定距离的像素点。该设定的目的是为了使运动目标物的整体都被包含在第一运动区域内,例如,当某一运动目标物的局部发生了运动时,将运动像素点作为运动区域显然是不能将该运动目标物全部包括在第一运动区域内的,但是,通过设置合理的预定距离,将运动像素点周围预定距离内的像素点也作为像素点集合的元素确定第一运动区域时,通常能够将运动目标物包括在第一运动区域内。In some embodiments, the predetermined distance is set based on the scene of each frame of image. For example, when the target objects in the scene of each frame of image are relatively large, the predetermined distance is set to be larger, and when the target objects in the scene of each frame of image are relatively small, the predetermined distance is set to be smaller. The pixel point set includes moving pixels and pixels whose distance from the moving pixels is less than the predetermined distance. The purpose of this setting is to include the entire moving target object in the first moving area. For example, when a part of a moving target object moves, it is obviously impossible to include the entire moving target object in the first moving area by using the moving pixels as the moving area. However, by setting a reasonable predetermined distance and determining the first moving area by using the pixels within the predetermined distance around the moving pixels as elements of the pixel point set, the moving target object can usually be included in the first moving area.

第一运动区域确定单元90332,用于基于所述像素点集合,确定所述第一运动区域。The first motion region determining unit 90332 is configured to determine the first motion region based on the pixel point set.

在一些实施例中,将运动像素点在当前帧图像中所占的位置以及运动像素点周围预定距离内的像素点的在图像中所占的位置进行合并,得到第一运动区域。例如,当预定距离设置为16时,此时,一个运动像素点所确定的第一运动区域的尺度为32*32的第一运动区域。此时,第一运动区域既包含了运动像素点,也包含了运动像素点周围预定距离内的像素点。In some embodiments, the position of the moving pixel in the current frame image and the position of the pixel within a predetermined distance around the moving pixel in the image are merged to obtain the first motion region. For example, when the predetermined distance is set to 16, the scale of the first motion region determined by a moving pixel is a 32*32 first motion region. At this time, the first motion region includes both the moving pixel and the pixel within a predetermined distance around the moving pixel.

采用上述实施例中的技术方案,将运动像素点及运动像素点周围预定距离内的像素点所占当前帧图像的位置作为第一运动区域,能够确保将运动目标物的整体都包含在第一运动区域内,有利于后续对第一运动区域中运动目标物的识别。By adopting the technical solution in the above embodiment, the position of the moving pixel point and the pixel points within a predetermined distance around the moving pixel point in the current frame image is taken as the first moving area, which can ensure that the entire moving target is included in the first moving area, which is facilitating the subsequent identification of the moving target in the first moving area.

如图13所示,在上述图12所示的实施例的基础上,第一运动区域确定单元90332还可以包括如下的子单元:As shown in FIG. 13 , based on the embodiment shown in FIG. 12 , the first motion region determining unit 90332 may further include the following subunits:

第二运动区域确定子单元903321,用于基于所述像素点集合,确定第二运动区域;A second motion region determining subunit 903321 is configured to determine a second motion region based on the pixel point set;

在一些实施例中,每一个运动像素点都能够确定一个像素点集合,每一个像素集合的各个像素点占的位置合并即为第二运动区域;由于每一个第二运动区域中不仅包含运动像素点,还包含运动像素点周围预定距离内的像素点。当两个运动像素点的距离小于预定距离时,两个运动像素点所对应的像素点集合确定的第二运动区域不可避免的会出现重合的像素点。In some embodiments, each moving pixel point can determine a pixel point set, and the positions occupied by each pixel point in each pixel point set are combined to form the second moving area; since each second moving area includes not only the moving pixel point, but also the pixels within a predetermined distance around the moving pixel point, when the distance between two moving pixels is less than the predetermined distance, the second moving area determined by the pixel point sets corresponding to the two moving pixels will inevitably have overlapping pixels.

第一合并子单元903322,用于基于两个以上的所述第二运动区域所具有的重合的像素点,将两个以上的所述第二运动区域合并为第一运动区域。The first merging subunit 903322 is configured to merge the two or more second motion regions into a first motion region based on overlapping pixels in the two or more second motion regions.

在一些实施例中,当两个第二运动区域具有重合的像素点时,表面其中一个运动像素点在另一个运动像素点对应的第二运动区域之内,此时,可以将两个运动像素点认为是同一个运动目标物所具有的两个运动像素点,因此,将两个第二运动区域合并为第一运动区域,从而能够确保同一个运动目标物不被分割,便于后续的运动目标物的识别。In some embodiments, when two second motion areas have overlapping pixels, one of the motion pixels is within the second motion area corresponding to the other motion pixel. At this time, the two motion pixels can be considered as two motion pixels of the same moving target. Therefore, the two second motion areas are merged into the first motion area, thereby ensuring that the same moving target is not divided, which facilitates the subsequent identification of the moving target.

如图14所示,在上述图12所示的实施例的基础上,第一运动区域获取模块90332还可以包括如下的子单元:As shown in FIG. 14 , based on the embodiment shown in FIG. 12 , the first motion region acquisition module 90332 may further include the following subunits:

第二运动区域确定子单元903321,用于基于所述像素点集合,确定第二运动区域;A second motion region determining subunit 903321 is configured to determine a second motion region based on the pixel point set;

在一些实施例中,每一个运动像素点都能够确定一个像素点集合,每一个像素集合的各个像素点占的位置合并即为第二运动区域。当相邻的两个第二运动区域的距离较小时,通常可以认为两个第二运动区域为同一个目标物上的运动区域。In some embodiments, each moving pixel can determine a pixel set, and the positions occupied by each pixel in each pixel set are combined to form a second moving area. When the distance between two adjacent second moving areas is small, the two second moving areas can usually be considered to be moving areas on the same target object.

合并结果确认子单元903323,用于基于相邻的两个所述第二运动区域的距离,确定相邻的两个所述第二运动区域的合并结果;A merging result confirmation subunit 903323 is used to determine a merging result of two adjacent second motion areas based on a distance between the two adjacent second motion areas;

在一些实施例中,当运动目标物的其中一部分与背景区域的图像相近时,会导致同一运动目标物识别出的两个第二运动区域之间不连续,此时,为了确保将同一个运动目标物的划分在同一个第一运动区域内,依据相邻的两个第二运动区域的距离判断是否将两个第二运动区域进行合并。当距离小于一个特定的距离时,将两个第二运动区域进行合并,当距离不小于一个特定的距离时,将两个第二运动区域分别作为两个第一运动区域。上述的特定距离可以根据视频中的画面的场景设定,也可以根据需要识别的运动目标物设定。In some embodiments, when a part of a moving target is close to the image of a background area, it will cause discontinuity between the two second motion areas identified for the same moving target. At this time, in order to ensure that the same moving target is divided into the same first motion area, whether to merge the two second motion areas is determined based on the distance between the two adjacent second motion areas. When the distance is less than a specific distance, the two second motion areas are merged. When the distance is not less than a specific distance, the two second motion areas are respectively used as two first motion areas. The above-mentioned specific distance can be set according to the scene of the picture in the video, and can also be set according to the moving target that needs to be identified.

第二合并子单元903324,用于基于所述合并结果,将距离符合预设条件的相邻的两个所述第二运动区域合并为第一运动区域。The second merging subunit 903324 is configured to merge two adjacent second motion regions whose distances meet a preset condition into a first motion region based on the merging result.

在一些实施例中,上述的预定条件例如可以为两个第二运动区域的距离小于特定距离。基于上述的步骤,将当前帧图像中距离小于特定距离的两个第二运动区域合并为第一运动区域。在设置上述特定距离时,需要依据视频中的画面的场景设定,也可以根据需要识别的运动目标物设定,例如,当运动目标物在视频图像中占的比例较大时,可以将特定距离设置的较大,又例如,当视频中的画面的场景颜色较为单一时,可以将特定距离设置的较小。将当前帧图像中的距离小于特定距离的两个第二运动区域合并的的目的是为了确保将同一个运动目标物划分在同一个第一运动区域之内,特定距离如果设置过小,可能会造成完整的运动物体被分割,导致后续模块无法正确识别;特定距离如果设置过大,会导致第一运动区域的尺度较大,后续对第一运动区域的缩放以及对被检测区域的识别的计算量会增加。In some embodiments, the above-mentioned predetermined condition may be, for example, that the distance between the two second motion areas is less than a specific distance. Based on the above steps, the two second motion areas in the current frame image whose distance is less than the specific distance are merged into the first motion area. When setting the above-mentioned specific distance, it is necessary to set it according to the scene of the picture in the video, and it can also be set according to the moving target to be identified. For example, when the moving target occupies a large proportion in the video image, the specific distance can be set to a larger value. For example, when the scene color of the picture in the video is relatively single, the specific distance can be set to a smaller value. The purpose of merging the two second motion areas whose distance in the current frame image is less than the specific distance is to ensure that the same moving target is divided into the same first motion area. If the specific distance is set too small, the complete moving object may be segmented, resulting in the inability of subsequent modules to correctly identify it; if the specific distance is set too large, the scale of the first motion area will be larger, and the subsequent scaling of the first motion area and the calculation amount of the recognition of the detected area will increase.

如图15所示,在上述图9所示的实施例的基础上,所述装置还包括如下模块:As shown in FIG. 15 , based on the embodiment shown in FIG. 9 , the device further includes the following modules:

参考图像确定模块906,用于基于所述当前帧图像与预定条件的比较结果,确定参考图像;A reference image determination module 906, configured to determine a reference image based on a comparison result between the current frame image and a predetermined condition;

在一些实施例中,在一些实施例中,视频中的画面表达的是背景缓慢变化的场景,此时,需要间隔性的将参考图像,有助于系统对缓慢变化背景的掌握。预定条件可以依据视频中的画面的背景确定,也可以依据视频中的画面的运动目标物确定,例如,可以依据视频中的画面的背景变化速度,每间隔固定数量的历史帧图像即选取当前帧图像作为参考图像,当视频中的画面的背景变化速度较快时,间隔的历史帧图像数量较少,当视频中的画面的背景变化速度较慢时,间隔的历史帧图像数量较多。也可以依据第一运动区域所占当前帧图像的比例确定是否将当前帧图像作为参考图像。In some embodiments, in some embodiments, the picture in the video expresses a scene with a slowly changing background. At this time, it is necessary to use reference images at intervals to help the system grasp the slowly changing background. The predetermined condition can be determined based on the background of the picture in the video, or it can be determined based on the moving target of the picture in the video. For example, based on the background change speed of the picture in the video, the current frame image can be selected as the reference image every fixed number of historical frame images. When the background change speed of the picture in the video is fast, the number of historical frame images at intervals is small, and when the background change speed of the picture in the video is slow, the number of historical frame images at intervals is large. It is also possible to determine whether to use the current frame image as a reference image based on the proportion of the first motion area in the current frame image.

被检测参考图像确定模块907,用于对所述参考图像逐次进行降采样处理,得到至少一个预定尺度的被检测参考图像;A detected reference image determination module 907 is used to successively downsample the reference image to obtain at least one detected reference image of a predetermined scale;

在一些实施例中,参考图像同样受限于对运动目标物进行检测的模块(例如能够执行神经网络运算的SOC芯片)所支持的尺度,因此,需要对参考图像进行至少一次降采样,得到至少一个预定尺度的被检测参考图像。由于单次降采样所能得到的图像尺度最小为原始图像尺度的1/2,因此,当参考图像的尺度与预定尺度相差较大时,需要对参考图像进行多次降采样,每次降采样得到一帧预定尺度的被检测参考图像,直到得到运动目标物进行检测的模块所支持的尺度的被检测参考图像,因此,被检测参考图像的数量需要由对运动目标物进行检测的模块所支持的尺度以及参考图像的尺度来确定。预定尺度可以由对运动目标物进行检测的模块所支持的尺度来确定。In some embodiments, the reference image is also limited by the scale supported by the module for detecting moving objects (e.g., a SOC chip capable of performing neural network operations). Therefore, the reference image needs to be downsampled at least once to obtain at least one detected reference image of a predetermined scale. Since the minimum image scale that can be obtained by a single downsampling is 1/2 of the original image scale, when the scale of the reference image differs greatly from the predetermined scale, the reference image needs to be downsampled multiple times, and each downsampling obtains a frame of a detected reference image of a predetermined scale until a detected reference image of a scale supported by the module for detecting moving objects is obtained. Therefore, the number of detected reference images needs to be determined by the scale supported by the module for detecting moving objects and the scale of the reference image. The predetermined scale can be determined by the scale supported by the module for detecting moving objects.

参考图像目标物确定模块908,用于基于所述至少一个预定尺度的被检测参考图像,确定所述参考图像中的所述运动目标物。The reference image target determination module 908 is used to determine the moving target in the reference image based on the detected reference image of at least one predetermined scale.

在一些实施例中,在得到被检测参考图像后,将被检测参考图像送入到用于对运动目标物进行检测的模块中,例如能够执行神经网络运算的SOC芯片。利用该模块对参考图像中的运动目标物进行检测。In some embodiments, after obtaining the detected reference image, the detected reference image is sent to a module for detecting moving objects, such as a SOC chip capable of performing neural network operations. The module is used to detect moving objects in the reference image.

在上述的实施例中,通过间隔的选取参考图像,能够识别到视频中的画面的背景变化,从而消除到背景变化对于运动目标物识别的影响。例如,随着时间的变化,太阳升起和落下引起的光照变化会影响视频中的画面各帧图像的亮度,采用本实施例的方式,能够消除由于背景亮度变化对运动物体识别的影响。In the above-mentioned embodiment, by selecting reference images at intervals, the background changes of the video can be identified, thereby eliminating the influence of the background changes on the recognition of moving objects. For example, as time changes, the illumination changes caused by the rising and setting of the sun will affect the brightness of each frame of the video. By adopting the method of this embodiment, the influence of the background brightness changes on the recognition of moving objects can be eliminated.

在上述图15所示的实施例的基础上,参考图像确定模块906用于基于所述当前帧图像与前一所述参考图像间隔的帧图像的数量,确定参考图像。Based on the embodiment shown in FIG. 15 , the reference image determination module 906 is used to determine the reference image based on the number of frame images between the current frame image and the previous reference image.

在一些实施例中,上述的参考图像的确定方式是一种静态的确定方式,其具体的方式是每间隔固定的帧图像数即取出一帧图像作为参考图像,例如将参考图像称为A帧图像,将第一运动区域进行缩放的帧图像称为B帧图像,通过设置周期T,每隔一个T周期,周期性的将参考图像缩放得到的被检测参考图像送入运动目标物识别模块做处理。例如,以帧率为50Hz的视频为例,当T为100毫秒时,即,每间隔100毫秒即将一帧帧图像作为参考图像,此时,参考图像和对第一运动区域进行缩放的帧图像的排列顺序为ABBBBABBBB。由于在同一个视频中,帧图像率是固定的,即每一帧图像所占的时间时固定的,占用的时间时固定的,规定了固定的周期即确定了间隔的帧图像数。当然,也可以采用直接设置固定的间隔帧图像数,例如设定每间隔3帧图像即获取一帧图像作为参考图像,此时,全图缩放的帧图像和第一运动区域缩放的帧图像排列将如下:ABBBABBB。In some embodiments, the above-mentioned method of determining the reference image is a static determination method, and the specific method is to take out a frame image as a reference image at every fixed number of frame images. For example, the reference image is called an A frame image, and the frame image that scales the first motion area is called a B frame image. By setting a period T, the reference image is periodically scaled to obtain the detected reference image every T period and sent to the moving target recognition module for processing. For example, taking a video with a frame rate of 50Hz as an example, when T is 100 milliseconds, that is, a frame image is taken as a reference image at every 100 millisecond interval. At this time, the arrangement order of the reference image and the frame image that scales the first motion area is ABBBBABBBB. Since in the same video, the frame image rate is fixed, that is, the time occupied by each frame image is fixed, and the fixed period is specified to determine the number of frame images at the interval. Of course, you can also directly set a fixed number of interval frame images, for example, set it to obtain a frame image as a reference image every 3 frames. At this time, the frame images of the full image zoom and the frame images of the first motion area zoom will be arranged as follows: ABBBABBB.

采用本实施例的方式设置参考图像,能够消除背景环境缓慢变化所造成的影响,有利于对移动目标物的精准识别。By setting the reference image in the manner of this embodiment, the influence caused by the slow changes in the background environment can be eliminated, which is conducive to the accurate recognition of the moving target object.

如图16所示,在上述图15所示的实施例的基础上,参考图像确定模块906还可以包括如下模块:As shown in FIG. 16 , based on the embodiment shown in FIG. 15 , the reference image determination module 906 may further include the following modules:

比例确认子模块9061,用于确定所述当前帧图像中的第一运动区域所占所述当前帧图像的比例;A ratio confirmation submodule 9061 is used to determine the ratio of the first motion area in the current frame image to the current frame image;

在一些实施例中,当第一运动区域所占当前帧图像的比例是指第一运动区域中的像素数量与当前帧图像中所有像素数量的比值。在一些实施例中,第一运动区域可以有多个,当第一运动区域具有多个时,该比例是指多个第一运动区域中的像素数量之和与当前帧图像中所有像素数量的比值。In some embodiments, the ratio of the first motion region to the current frame image refers to the ratio of the number of pixels in the first motion region to the number of all pixels in the current frame image. In some embodiments, there may be multiple first motion regions. When there are multiple first motion regions, the ratio refers to the ratio of the sum of the number of pixels in the multiple first motion regions to the number of all pixels in the current frame image.

参考图像确认子模块9062,用于基于所述比例以及预定阈值范围的比较结果,确定参考图像。The reference image confirmation submodule 9062 is used to determine a reference image based on the comparison result of the ratio and a predetermined threshold range.

在一些实施例中,当检测到的运动区域超过全图的一定比例,自动将全图进行缩放后送入运动目标物检测模块做处理,运动区域的比例可以根据不同的应用场景配置。例如,在人流、车流或动物活动比较密集的场景下,将该比例设置的较小,有助于对视频中的画面的活动细节进行识别,此时,A帧图像和B帧图像的比例是动态变化的。例如,第一帧图像、第四帧图像至第六帧图像以及第十二帧图像的第一运动区域所占比例超过全图的一定比例时,将第一帧图像、第四帧图像至第六帧图像以及第十二帧图像作为参考帧,而其他帧图像的第一运动区域不超过全图一定比例,对第一运动区域进行缩放,从而,参考图像和对第一运动区域进行缩放的帧图像的排列顺序如下:ABBAAABBBBBABB。In some embodiments, when the detected motion area exceeds a certain proportion of the whole image, the whole image is automatically scaled and sent to the motion target detection module for processing, and the proportion of the motion area can be configured according to different application scenarios. For example, in a scene with dense flow of people, vehicles or animals, setting the proportion to be smaller helps to identify the moving details of the picture in the video. At this time, the proportion of the A frame image and the B frame image changes dynamically. For example, when the proportion of the first motion area of the first frame image, the fourth frame image to the sixth frame image and the twelfth frame image exceeds a certain proportion of the whole image, the first frame image, the fourth frame image to the sixth frame image and the twelfth frame image are used as reference frames, and the first motion area of other frame images does not exceed a certain proportion of the whole image, and the first motion area is scaled, so that the reference image and the frame image for scaling the first motion area are arranged in the following order: ABBAAABBBBBABB.

采用本实施例的技术方案,能够依据当前帧图像中运动目标物的比例确定参考图像,从而,能够充分识别视频中的画面运动目标物的活动细节。By adopting the technical solution of this embodiment, the reference image can be determined according to the proportion of the moving target in the current frame image, so that the activity details of the moving target in the video can be fully recognized.

本领域技术人员应当理解,上述静态和动态的两种设置参考图像的方式可以进行切换。例如,检测单位时间内的运动像素点的比例(或者绝对数量),当比例较低时,设置为静态方式选取参考图像。又例如,根据场景,规定夜晚为静态方式选取参考图像,白天为动态方式选取参考图像。Those skilled in the art should understand that the above two methods of setting reference images, static and dynamic, can be switched. For example, the ratio (or absolute number) of moving pixels per unit time is detected. When the ratio is low, the reference image is selected in a static manner. For another example, according to the scene, it is specified that the reference image is selected in a static manner at night and in a dynamic manner during the day.

在上述图15所示的实施例基础上,所述装置还可以包括如下的模块:Based on the embodiment shown in FIG. 15 above, the device may further include the following modules:

当前帧图像全图缩放模块,用于基于所述当前帧图像的所述被检测区域以及在所述当前帧图像之前的一帧图像所述参考图像的所述被检测参考图像,确定所述当前帧图像对应的预定尺度的被检测图像。The current frame image full image scaling module is used to determine a detected image of a predetermined scale corresponding to the current frame image based on the detected area of the current frame image and the detected reference image of the reference image of a frame image before the current frame image.

在一些实施例中,本模块可以通过两种方式实现,其中一种如下:根据第一运动运动区域的坐标,得到运动区域相对于图像起始点的位置,这个相对位置可以换算成相对图像起点的地址偏移。该方式将第一运动区域的缩放结果,即至少一个预定尺度的被检测区域存储至存储单元中,当对运动目标物进行检测的模块需要当前帧图像的全图的缩放结果时,可以将被检测区域和当前帧图像之前的一帧参考图像的缩放结果,即至少一帧被检测参考图像同时读出,根据第一运动区域的地址偏移,将被检测参考图像和被检测区域求和,求和的结果即为当前帧图像的全图的缩放结果。第二种如下:如果对运动目标物进行检测的模块需要直接得到当前帧图像的全图缩放结果,而不是通过存储单元中转,可以在被检测区域的计算过程中,同时将存储单元中保存的之前的被检测参考图像读出,根据当前图像像素是否是运动区域来判断是将被检测区域与之前的被检测参考图像求和输出给后续处理模块还是将存储单元中的之前的被检测参考图像输出给后续处理模块,如果该像素在第一运动区域中,则将被检测区域和之前的被检测参考图像求和输出给后续模块,否则,直接将之前的被检测参考图像输出给后续模块处理。这种处理将当前帧图像中的运动区域的所得到的预定尺度的被检测区域传送至对运动目标物进行检测的模块,省去了预定尺度的被检测区域存入存储单元和从存储单元读出的过程,因此可以大大缩减图像处理的时延。In some embodiments, this module can be implemented in two ways, one of which is as follows: according to the coordinates of the first motion motion area, the position of the motion area relative to the starting point of the image is obtained, and this relative position can be converted into an address offset relative to the starting point of the image. This method stores the scaling result of the first motion area, that is, at least one detected area of a predetermined scale, in a storage unit. When the module for detecting the moving target needs the scaling result of the entire image of the current frame image, the scaling result of the detected area and a frame of reference image before the current frame image, that is, at least one frame of detected reference image, can be read out at the same time. According to the address offset of the first motion area, the detected reference image and the detected area are summed, and the summed result is the scaling result of the entire image of the current frame image. The second is as follows: if the module for detecting moving targets needs to directly obtain the full image scaling result of the current frame image instead of transferring it through a storage unit, the previously detected reference image stored in the storage unit can be read out during the calculation process of the detected area, and whether the detected area and the previously detected reference image are summed and output to the subsequent processing module or the previously detected reference image in the storage unit is output to the subsequent processing module is determined based on whether the current image pixel is a moving area. If the pixel is in the first moving area, the detected area and the previously detected reference image are summed and output to the subsequent module, otherwise, the previously detected reference image is directly output to the subsequent module for processing. This processing transmits the detected area of the predetermined scale obtained in the moving area of the current frame image to the module for detecting moving targets, eliminating the process of storing the detected area of the predetermined scale in the storage unit and reading it out from the storage unit, thereby greatly reducing the delay of image processing.

示例性电子设备Exemplary Electronic Devices

下面,参考图17来描述根据本公开实施例的电子设备。图17图示了根据本公开实施例的电子设备的框图。Hereinafter, an electronic device according to an embodiment of the present disclosure will be described with reference to Fig. 17. Fig. 17 illustrates a block diagram of an electronic device according to an embodiment of the present disclosure.

如图17所示,电子设备11包括一个或多个处理器111和存储器112。As shown in FIG. 17 , the electronic device 11 includes one or more processors 111 and a memory 112 .

处理器111可以是中央处理单元(CPU)或者具有数据处理能力和/或指令执行能力的其他形式的处理单元,并且可以控制电子设备11中的其他组件以执行期望的功能。The processor 111 may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and/or instruction execution capabilities, and may control other components in the electronic device 11 to perform desired functions.

存储器112可以包括一个或多个计算机程序产品,所述计算机程序产品可以包括各种形式的计算机可读存储介质,例如易失性存储器和/或非易失性存储器。所述易失性存储器例如可以包括随机存取存储器(RAM)和/或高速缓冲存储器(cache)等。所述非易失性存储器例如可以包括只读存储器(ROM)、硬盘、闪存等。在所述计算机可读存储介质上可以存储一个或多个计算机程序指令,处理器111可以运行所述程序指令,以实现上文所述的本公开的各个实施例的运动物体的检测方法以及/或者其他期望的功能。在所述计算机可读存储介质中还可以存储诸如输入信号、信号分量、噪声分量等各种内容。The memory 112 may include one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and/or cache memory (cache), etc. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 111 may run the program instructions to implement the moving object detection method of each embodiment of the present disclosure described above and/or other desired functions. Various contents such as input signals, signal components, noise components, etc. may also be stored in the computer-readable storage medium.

在一个示例中,电子设备11还可以包括:输入装置113和输出装置114,这些组件通过总线系统和/或其他形式的连接机构(未示出)互连。In one example, the electronic device 11 may further include: an input device 113 and an output device 114 , and these components are interconnected via a bus system and/or other forms of connection mechanisms (not shown).

例如,该输入装置113可以是通信网络连接器,用于接收输入信号。For example, the input device 113 may be a communication network connector for receiving input signals.

此外,该输入设备113还可以包括例如键盘、鼠标等等。In addition, the input device 113 may also include, for example, a keyboard, a mouse, and the like.

该输出装置114可以向外部输出各种信息,该输出设备114可以包括例如显示器、扬声器、打印机、以及通信网络及其所连接的远程输出设备等等。The output device 114 can output various information to the outside. The output device 114 can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, and the like.

当然,为了简化,图17中仅示出了该电子设备11中与本公开有关的组件中的一些,省略了诸如总线、输入/输出接口等等的组件。除此之外,根据具体应用情况,电子设备17还可以包括任何其他适当的组件。Of course, for simplicity, FIG17 only shows some of the components related to the present disclosure in the electronic device 11, omitting components such as a bus, an input/output interface, etc. In addition, the electronic device 17 may also include any other appropriate components according to specific application scenarios.

示例性计算机程序产品和计算机可读存储介质Exemplary computer program products and computer-readable storage media

除了上述方法和设备以外,本公开的实施例还可以是计算机程序产品,其包括计算机程序指令,所述计算机程序指令在被处理器运行时使得所述处理器执行本说明书上述“示例性方法”部分中描述的根据本公开各种实施例的运动物体检测方法中的步骤。In addition to the above-mentioned methods and devices, an embodiment of the present disclosure may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the motion object detection method according to various embodiments of the present disclosure described in the above-mentioned "Exemplary Method" section of this specification.

所述计算机程序产品可以以一种或多种程序设计语言的任意组合来编写用于执行本公开实施例操作的程序代码,所述程序设计语言包括面向对象的程序设计语言,诸如Java、C++等,还包括常规的过程式程序设计语言,诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算设备上执行、部分地在用户设备上执行、作为一个独立的软件包执行、部分在用户计算设备上部分在远程计算设备上执行、或者完全在远程计算设备或服务器上执行。The computer program product may be written in any combination of one or more programming languages to write program code for performing the operations of the disclosed embodiments, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

此外,本公开的实施例还可以是计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令在被处理器运行时使得所述处理器执行本说明书上述“示例性方法”部分中描述的根据本公开各种实施例的运动物体检测方法中的步骤。In addition, an embodiment of the present disclosure may also be a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes the steps of the motion object detection method according to various embodiments of the present disclosure described in the above "Exemplary Method" section of this specification.

所述计算机可读存储介质可以采用一个或多个可读介质的任意组合。可读介质可以是可读信号介质或者可读存储介质。可读存储介质例如可以包括但不限于电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

以上结合具体实施例描述了本公开的基本原理,但是,需要指出的是,在本公开中提及的优点、优势、效果等仅是示例而非限制,不能认为这些优点、优势、效果等是本公开的各个实施例必须具备的。另外,上述公开的具体细节仅是为了示例的作用和便于理解的作用,而非限制,上述细节并不限制本公开为必须采用上述具体的细节来实现。The basic principles of the present disclosure are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present disclosure are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. are required by each embodiment of the present disclosure. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, and are not limitations. The above details do not limit the present disclosure to the necessity of adopting the above specific details to be implemented.

本公开中涉及的器件、装置、设备、系统的方框图仅作为例示性的例子并且不意图要求或暗示必须按照方框图示出的方式进行连接、布置、配置。如本领域技术人员将认识到的,可以按任意方式连接、布置、配置这些器件、装置、设备、系统。诸如“包括”、“包含”、“具有”等等的词语是开放性词汇,指“包括但不限于”,且可与其互换使用。这里所使用的词汇“或”和“和”指词汇“和/或”,且可与其互换使用,除非上下文明确指示不是如此。这里所使用的词汇“诸如”指词组“诸如但不限于”,且可与其互换使用。The block diagrams of the devices, apparatuses, equipment, and systems involved in this disclosure are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagrams. As will be appreciated by those skilled in the art, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including," "comprising," "having," and the like are open words, referring to "including but not limited to," and can be used interchangeably therewith. The words "or" and "and" used herein refer to the words "and/or," and can be used interchangeably therewith, unless the context clearly indicates otherwise. The word "such as" used herein refers to the phrase "such as but not limited to," and can be used interchangeably therewith.

还需要指出的是,在本公开的装置、设备和方法中,各部件或各步骤是可以分解和/或重新组合的。这些分解和/或重新组合应视为本公开的等效方案。It should also be noted that in the apparatus, device and method of the present disclosure, each component or each step can be decomposed and/or recombined. Such decomposition and/or recombination should be regarded as equivalent solutions of the present disclosure.

提供所公开的方面的以上描述以使本领域的任何技术人员能够做出或者使用本公开。对这些方面的各种修改对于本领域技术人员而言是非常显而易见的,并且在此定义的一般原理可以应用于其他方面而不脱离本公开的范围。因此,本公开不意图被限制到在此示出的方面,而是按照与在此公开的原理和新颖的特征一致的最宽范围。The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the aspects shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

为了例示和描述的目的已经给出了以上描述。此外,此描述不意图将本公开的实施例限制到在此公开的形式。尽管以上已经讨论了多个示例方面和实施例,但是本领域技术人员将认识到其某些变型、修改、改变、添加和子组合。The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.

Claims (10)

1.一种运动物体的检测方法,包括:1. A method for detecting a moving object, comprising: 基于当前帧图像与所述当前帧图像的前一帧图像,确定所述当前帧图像与所述前一帧图像的帧间差分信息;Based on a current frame image and a frame image before the current frame image, determining inter-frame difference information between the current frame image and the frame image before the current frame image; 基于所述当前帧图像以及当前帧图像之前预定数量的历史帧图像,确定多帧图像集合;Determine a set of multiple frame images based on the current frame image and a predetermined number of historical frame images before the current frame image; 基于所述多帧图像集合中各帧图像的所述帧间差分信息,在所述当前帧图像中确定第一运动区域;Determining a first motion region in the current frame image based on the inter-frame difference information of each frame image in the multi-frame image set; 基于所述第一运动区域,确定至少一个预定尺度的被检测区域;Based on the first motion area, determining at least one detected area of a predetermined size; 基于所述当前帧图像与预定条件的比较结果,确定参考图像;Determining a reference image based on a comparison result between the current frame image and a predetermined condition; 对所述参考图像逐次进行降采样处理,得到至少一个预定尺度的被检测参考图像;Downsampling the reference image successively to obtain at least one detected reference image of a predetermined scale; 根据第一运动区域的地址偏移,将被检测参考图像和被检测区域求和,确定所述当前帧图像对应的预定尺度的被检测图像;或者,根据当前帧图像的像素是否在运动区域来判断是否将被检测区域与被检测参考图像求和,当前像素在第一运动区域中,将被检测区域和被检测参考图像求和,当前像素不在第一运动区域中,保留被检测参考图像,以确定所述当前帧图像对应的预定尺度的被检测图像;According to the address offset of the first motion region, the detected reference image and the detected region are summed to determine the detected image of the predetermined scale corresponding to the current frame image; or, according to whether the pixel of the current frame image is in the motion region, it is determined whether to sum the detected region and the detected reference image; if the current pixel is in the first motion region, the detected region and the detected reference image are summed; if the current pixel is not in the first motion region, the detected reference image is retained to determine the detected image of the predetermined scale corresponding to the current frame image; 基于所述当前帧图像的所述被检测图像,确定所述被检测区域中的运动目标物。Based on the detected image of the current frame image, a moving target in the detected area is determined. 2.根据权利要求1所述的方法,其中,基于当前帧图像与前一帧图像,确定所述当前帧图像与所述前一帧图像的帧间差分信息包括:2. The method according to claim 1, wherein, based on the current frame image and the previous frame image, determining the inter-frame difference information between the current frame image and the previous frame image comprises: 基于所述当前帧图像与所述前一帧图像对应的像素值,确定预定颜色空间中预定颜色通道的对应的像素差分值;Determine a corresponding pixel difference value of a predetermined color channel in a predetermined color space based on the pixel values corresponding to the current frame image and the previous frame image; 基于所述像素差分值和预定的权重值,确定所述帧间差分信息。The inter-frame difference information is determined based on the pixel difference value and a predetermined weight value. 3.根据权利要求1所述的方法,其中,基于所述多帧图像集合中各帧图像的帧间差分信息,在所述当前帧图像中确定第一运动区域包括:3. The method according to claim 1, wherein determining the first motion area in the current frame image based on inter-frame difference information of each frame image in the multi-frame image set comprises: 将多帧图像集合中各帧图像的帧间差分信息进行累加,确定多帧图像集合的累加差分信息;Accumulating inter-frame difference information of each frame image in the multi-frame image set to determine accumulated difference information of the multi-frame image set; 基于所述累加差分信息与预定阈值比较结果,确定所述当前帧图像中的运动像素点;Determine the moving pixel points in the current frame image based on the comparison result between the accumulated difference information and a predetermined threshold; 基于所述当前帧图像中的所述运动像素点,确定所述当前帧图像的第一运动区域。Based on the moving pixel points in the current frame image, a first moving area of the current frame image is determined. 4.根据权利要求3所述的方法,其中,基于所述当前帧图像中的所述运动像素点,确定所述当前帧图像的第一运动区域包括:4. The method according to claim 3, wherein determining the first motion area of the current frame image based on the motion pixel points in the current frame image comprises: 基于所述运动像素点和预定距离,确定与所述运动像素点的距离在所述预定距离范围内的像素点集合;Based on the moving pixel point and the predetermined distance, determining a set of pixel points whose distances from the moving pixel point are within the predetermined distance range; 基于所述像素点集合,确定所述第一运动区域。Based on the pixel point set, the first motion area is determined. 5.根据权利要求4所述的方法,其中,所述基于所述像素点集合,确定所述第一运动区域包括:5. The method according to claim 4, wherein determining the first motion area based on the pixel point set comprises: 基于所述像素点集合,确定第二运动区域;Determining a second motion area based on the pixel point set; 基于两个以上的所述第二运动区域所具有的重合的像素点,将两个以上的所述第二运动区域合并为第一运动区域。Based on the overlapping pixel points of the two or more second motion regions, the two or more second motion regions are merged into a first motion region. 6.根据权利要求4所述的方法,其中,基于所述像素点集合,确定所述第一运动区域帧图像包括:6. The method according to claim 4, wherein determining the first motion region frame image based on the pixel point set comprises: 基于所述像素点集合,确定第二运动区域;Determining a second motion area based on the pixel point set; 基于相邻的两个所述第二运动区域的距离,确定相邻的两个所述第二运动区域的合并结果;determining a merging result of two adjacent second motion regions based on a distance between the two adjacent second motion regions; 基于所述合并结果,将距离符合预设条件的相邻的两个所述第二运动区域合并为第一运动区域。Based on the merging result, two adjacent second motion regions whose distances meet a preset condition are merged into a first motion region. 7.根据权利要求1所述的方法,其中,所述方法还包括:7. The method according to claim 1, wherein the method further comprises: 基于所述至少一个预定尺度的被检测参考图像,确定所述参考图像中的所述运动目标物。Based on the detected reference image of the at least one predetermined scale, the moving target in the reference image is determined. 8.一种运动物体的检测装置,包括:8. A moving object detection device, comprising: 差分信息获取模块:用于基于当前帧图像与前一帧图像,确定所述当前帧图像与所述前一帧图像的帧间差分信息;The differential information acquisition module is used to determine the inter-frame differential information between the current frame image and the previous frame image based on the current frame image and the previous frame image; 多帧图像集合确定模块:用于基于所述当前帧图像以及所述当前帧图像之前预定数量的帧图像,确定多帧图像集合;A multi-frame image set determination module: used to determine a multi-frame image set based on the current frame image and a predetermined number of frame images before the current frame image; 运动区域获取模块:用于基于所述多帧图像集合中各帧图像的所述帧间差分信息,在所述当前帧图像中确定第一运动区域;A motion region acquisition module: used to determine a first motion region in the current frame image based on the inter-frame difference information of each frame image in the multi-frame image set; 尺度转换模块:用于基于所述第一运动区域,确定至少一个预定尺度的被检测区域;A scale conversion module: used to determine at least one detected area of a predetermined scale based on the first motion area; 参考图像确定模块:用于基于所述当前帧图像与预定条件的比较结果,确定参考图像;A reference image determination module: used to determine a reference image based on a comparison result between the current frame image and a predetermined condition; 被检测参考图像确定模块:用于对所述参考图像逐次进行降采样处理,得到至少一个预定尺度的被检测参考图像;A detected reference image determination module is used to successively downsample the reference image to obtain at least one detected reference image of a predetermined scale; 当前帧图像全图缩放模块:用于根据第一运动区域的地址偏移,将被检测参考图像和被检测区域求和,确定所述当前帧图像对应的预定尺度的被检测图像;或者,根据当前帧图像的像素是否在运动区域来判断是将被检测区域与被检测参考图像求和,当前像素在第一运动区域中,将被检测区域和被检测参考图像求和,当前像素不在第一运动区域中,保留被检测参考图像,以确定所述当前帧图像对应的预定尺度的被检测图像;The current frame image full image scaling module is used to sum the detected reference image and the detected area according to the address offset of the first motion area to determine the detected image of the predetermined scale corresponding to the current frame image; or, according to whether the pixel of the current frame image is in the motion area, determine whether to sum the detected area and the detected reference image. If the current pixel is in the first motion area, the detected area and the detected reference image are summed. If the current pixel is not in the first motion area, the detected reference image is retained to determine the detected image of the predetermined scale corresponding to the current frame image; 运动目标物检测模块:用于基于所述当前帧图像的被检测图像,确定所述被检测区域中的运动目标物。The moving target detection module is used to determine the moving target in the detected area based on the detected image of the current frame image. 9.一种计算机可读存储介质,所述存储介质存储有计算机程序,所述计算机程序用于执行上述权利要求1-7任一所述的运动物体的检测方法。9. A computer-readable storage medium storing a computer program, wherein the computer program is used to execute the moving object detection method according to any one of claims 1 to 7. 10.一种电子设备,所述电子设备包括:10. An electronic device, comprising: 处理器;processor; 用于存储所述处理器可执行指令的存储器;a memory for storing instructions executable by the processor; 所述处理器,用于从所述存储器中读取所述可执行指令,并执行所述指令以实现上述权利要求1-7任一所述的运动物体的检测方法。The processor is used to read the executable instructions from the memory and execute the instructions to implement the moving object detection method described in any one of claims 1-7.
CN202011160883.4A 2020-10-29 2020-10-29 Method and device for detecting moving object, readable storage medium and electronic equipment Active CN112287805B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011160883.4A CN112287805B (en) 2020-10-29 2020-10-29 Method and device for detecting moving object, readable storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011160883.4A CN112287805B (en) 2020-10-29 2020-10-29 Method and device for detecting moving object, readable storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN112287805A CN112287805A (en) 2021-01-29
CN112287805B true CN112287805B (en) 2024-10-29

Family

ID=74373367

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011160883.4A Active CN112287805B (en) 2020-10-29 2020-10-29 Method and device for detecting moving object, readable storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN112287805B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113673454B (en) * 2021-08-26 2025-02-28 北京声智科技有限公司 Relic detection method, related equipment and storage medium
CN114419522A (en) * 2022-03-29 2022-04-29 以萨技术股份有限公司 Target object structured analysis method, device and equipment
CN115965653B (en) * 2022-12-14 2023-11-07 北京字跳网络技术有限公司 Light spot tracking method and device, electronic equipment and storage medium
CN116912725A (en) * 2022-12-27 2023-10-20 中移物联网有限公司 A target object detection method, device, electronic equipment and readable storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108109163A (en) * 2017-12-18 2018-06-01 中国科学院长春光学精密机械与物理研究所 A kind of moving target detecting method for video of taking photo by plane
CN110751678A (en) * 2018-12-12 2020-02-04 北京嘀嘀无限科技发展有限公司 Moving object detection method and device and electronic equipment

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4187448B2 (en) * 2002-03-07 2008-11-26 富士通マイクロエレクトロニクス株式会社 Method and apparatus for tracking moving object in image
CN102307274B (en) * 2011-08-31 2013-01-02 南京南自信息技术有限公司 Motion detection method based on edge detection and frame difference
CN104700430A (en) * 2014-10-05 2015-06-10 安徽工程大学 Method for detecting movement of airborne displays
CN107886086B (en) * 2017-12-01 2020-01-14 中国农业大学 Target animal detection method and device based on image video
CN109446978B (en) * 2018-10-25 2022-01-07 哈尔滨工程大学 Method for tracking moving target of airplane based on staring satellite complex scene
CN110532875B (en) * 2019-07-26 2024-06-21 纵目科技(上海)股份有限公司 Night mode lens attachment detection system, terminal and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108109163A (en) * 2017-12-18 2018-06-01 中国科学院长春光学精密机械与物理研究所 A kind of moving target detecting method for video of taking photo by plane
CN110751678A (en) * 2018-12-12 2020-02-04 北京嘀嘀无限科技发展有限公司 Moving object detection method and device and electronic equipment

Also Published As

Publication number Publication date
CN112287805A (en) 2021-01-29

Similar Documents

Publication Publication Date Title
CN112287805B (en) Method and device for detecting moving object, readable storage medium and electronic equipment
US10867166B2 (en) Image processing apparatus, image processing system, and image processing method
CN108833785B (en) Fusion method and device of multi-view images, computer equipment and storage medium
CN109284670B (en) A pedestrian detection method and device based on multi-scale attention mechanism
CN111741211B (en) Image display method and device
US11600008B2 (en) Human-tracking methods, systems, and storage media
CN112927279B (en) Image depth information generation method, device and storage medium
CN112602091A (en) Object detection using multiple neural networks trained for different image fields
US11132538B2 (en) Image processing apparatus, image processing system, and image processing method
JP7272024B2 (en) Object tracking device, monitoring system and object tracking method
US11871125B2 (en) Method of processing a series of events received asynchronously from an array of pixels of an event-based light sensor
WO2019225964A1 (en) System and method for fast object detection
CN116309781B (en) Cross-modal fusion-based underwater visual target ranging method and device
KR20210129043A (en) How to process information from event-based sensors
US20240153105A1 (en) Feature point identification in sparse optical flow based tracking in a computer vision system
CN112183578A (en) Target detection method, medium and system
US11200681B2 (en) Motion detection method and motion detection system with low computational complexity and high detection accuracy
US12081876B2 (en) Method for determining photographing mode, electronic device and storage medium
US9727967B2 (en) Methods for determining estimated depth in an image and systems thereof
JP7384158B2 (en) Image processing device, moving device, method, and program
Ridwan et al. An event-based optical flow algorithm for dynamic vision sensors
CN115190220B (en) On-chip pulse image processing system based on dynamic vision and grayscale pulse sensor
CN117218454A (en) Small target detection method and device based on feature map information and negative sample training
US11212444B1 (en) Image processing device
CN113762017B (en) Action recognition method, device, equipment and storage medium

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
GR01 Patent grant
GR01 Patent grant