Moving object detection method and device

By combining inter-frame difference and binarization processing with contour analysis and image reconstruction, the problems of high false detection rate and large computational resource requirements in moving object detection are solved, achieving fast and accurate moving object detection and enhancing the intelligence and reliability of the monitoring system.

CN121746433APending Publication Date: 2026-03-27SHANGHAI FULLHAN MICROELECTRONICS
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-30
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Existing moving object detection models have high false detection rates and high computational resource requirements in complex scenarios, and lack perception and understanding of the target's motion state, which affects the reliability and security of the system in applications such as video surveillance.

Method used

The motion region is extracted using the inter-frame difference method. Binarization and morphological processing are combined to enhance the connectivity of the motion region. Contour analysis is used to divide the motion region into large and small blocks. Spatial-to-channel compression and image stitching are performed to reduce redundant calculations. Finally, a target detection model is used to obtain information about moving objects.

Benefits of technology

It effectively reduces static background interference, decreases false detection rate, improves detection efficiency, and enhances the intelligence and accuracy of the monitoring system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121746433A_ABST
    Figure CN121746433A_ABST
Patent Text Reader

Abstract

The invention provides a method and a device for detecting a moving object. The method comprises the following steps of: performing difference operation on two adjacent frames of images by adopting an inter-frame difference method to obtain a frame difference image; carrying out binarization processing and morphological processing on the frame difference image to obtain a binarization image; performing contour analysis processing on the binarized image to obtain the area of a contour circumscribed rectangular region of the moving object in the binarized image; dividing a contour external rectangular area in the binarized image into large block motion areas or small block motion areas, performing space-to-channel compression processing on the image corresponding to each large block motion area, and performing image splicing processing on the images corresponding to all the small block motion areas to respectively obtain images to be detected; and performing target detection by using the target detection model to obtain the center point position coordinates and category information of the moving object. According to the moving object detection method and device provided by the invention, the calculation amount of the target detection model can be reduced, and the moving object in a complex scene can be rapidly and accurately detected.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of deep learning, in particular to a moving object detection method and device. BACKGROUND

[0002] In recent years, with the wide application of large-scale labeled data sets, deep convolutional neural network models have shown great ability in image information extraction.

[0003] However, in the field of object detection, the existing object detection model lacks robustness to environmental changes. Factors such as light changes, target occlusions, and perspective differences that are common in real environments can all affect the accuracy of detection. Moreover, in some applications, a large amount of labeled data is used, especially for some rare objects, and the high labeling cost often makes such data extremely scarce. In some other applications, complex network architectures or multiple expert models are used, although the false detection rate is reduced, but in scenarios that require frame rate (such as passenger flow statistics, vehicle flow statistics, etc.), these models have a huge demand for computing resources, making it difficult to deploy such models in resource-constrained scenarios. In addition, most existing moving object detection methods are based on single-frame static images for inference, lacking perception and understanding of target motion state. In typical applications such as video surveillance and intelligent security, the system often needs to distinguish between real moving targets and static interference objects (such as human or animal images in advertising posters, long-stationed vehicles, etc.). If temporal motion information cannot be effectively integrated, detection results relying solely on spatial features are prone to produce a large number of false positives, seriously affecting the reliability and safety of the system. In real test scenarios, there are often many objects that are misidentified, these misidentifications not only have diverse forms (such as misjudging a texture-rich advertising board as a human figure, identifying a shadow or reflection area as a vehicle, etc.), but also often lack clear explanations, making it difficult to suppress false detections through conventional model optimization methods. SUMMARY

[0004] The purpose of the present application is to provide a moving object detection method and device to solve one or more of the problems of high false detection rate in moving object detection in complex scenarios, high demand for model computing resources, etc. in the prior art.

[0005] To achieve the above-mentioned purpose, the present application realizes the following technical scheme: a moving object detection method, comprising:

[0006] performing difference operation on a current frame original image and its previous frame original image in a video image sequence by using inter-frame difference method to obtain a frame difference image;

[0007] performing binaryzation processing and morphological processing on the frame difference image to obtain a binary image;

[0008] performing contour analysis processing on the binary image to obtain an area of a contour circumscribed rectangle region of the moving object in the binary image;

[0009] dividing the contour circumscribed rectangle region of the moving object in the binary image into a large block motion region or a small block motion region according to a preset area threshold and the area of the contour circumscribed rectangle region of the moving object in the binary image;

[0010] performing spatial-to-channel compression processing on an image corresponding to each of the large block motion regions in the binary image to generate a first to-be-detected image;

[0011] performing image splicing processing on images corresponding to all the small block motion regions in the binary image to generate a second to-be-detected image;

[0012] performing target detection on the first to-be-detected image and the second to-be-detected image respectively using a target detection model to obtain a center point position coordinate and category information of the moving object on the current frame original image.

[0013] Optionally, the binarization processing and the morphological processing on the frame difference image to obtain the binary image include: performing binarization processing on the frame difference image based on an adaptive threshold to obtain a binary image after binarization processing; and performing morphological processing on the binary image after binarization processing to obtain the binary image.

[0014] Optionally, the adaptive threshold = a pixel mean value of the frame difference image + a threshold adjustment coefficient x a pixel standard deviation of the frame difference image; and the threshold adjustment coefficient is used to adjust sensitivity of motion detection.

[0015] Optionally, the morphological processing on the binary image after binarization processing to obtain the binary image includes: performing erosion processing on the binary image after binarization processing, and then performing inflation processing to obtain the binary image.

[0016] Optionally, the contour analysis processing on the binary image to obtain the area of the contour circumscribed rectangle region of the moving object in the binary image includes: extracting contour information of the moving object in the binary image; and obtaining the area of the contour circumscribed rectangle region of the moving object in the binary image based on the contour information of the moving object in the binary image.

[0017] Optionally, the dividing the contour circumscribed rectangular region of the moving object in the binarized image into a large block motion region or a small block motion region according to a preset area threshold and an area of the contour circumscribed rectangular region of the moving object in the binarized image comprises: determining whether the area of the contour circumscribed rectangular region of the moving object in the binarized image is greater than the preset area threshold; if yes, dividing the contour circumscribed rectangular region into the large block motion region; and if no, dividing the contour circumscribed rectangular region into the small block motion region.

[0018] Optionally, the spatial-to-channel compression processing on the image corresponding to each of the large block motion regions in the binarized image to generate a first to-be-detected image comprises: performing data rearrangement from a spatial dimension to a channel dimension on the image corresponding to each of the large block motion regions in the binarized image to generate the first to-be-detected image.

[0019] Optionally, the image splicing processing on the images corresponding to all the small block motion regions in the binarized image to generate a second to-be-detected image comprises: splicing the images corresponding to the small block motion regions to be spliced in the binarized image into a preset-size image canvas in sequence, and ensuring that any one of the images corresponding to the small block motion regions does not exceed a boundary of the image canvas after splicing; when an image corresponding to a next small block motion region to be spliced cannot be spliced completely without exceeding the boundary of the image canvas, saving the current image canvas and initializing a new image canvas of the preset size for subsequent splicing; and for a blank area in each of the image canvases that is not covered by the images corresponding to the small block motion regions, using pixel information corresponding to the blank area in the binarized image to fill the blank area, to obtain the second to-be-detected image.

[0020] Optionally, the target detection on the first to-be-detected image and the second to-be-detected image respectively using a target detection model to obtain center point position coordinates and category information of the moving object on the current frame original image comprises: performing target detection on the first to-be-detected image and the second to-be-detected image respectively using a target detection model, and respectively outputting center point position coordinates and category information of the moving object in the first to-be-detected image and center point position coordinates and category information of the moving object in the second to-be-detected image; and obtaining the center point position coordinates and the category information of the moving object on the current frame original image through a mapping relationship.

[0021] To achieve the above object, the application further provides a moving object detection device, comprising a frame difference module, a binarization module, a contour analysis module, a moving target screening module, an image reconstruction module and a target detection module arranged in sequence, wherein the image reconstruction module comprises an image compression unit and an image splicing unit; the frame difference module is configured to perform difference operation on a current frame original image and a previous frame original image in a video image sequence by using an inter-frame difference method to obtain a frame difference image; the binarization module is configured to perform binarization processing and morphological processing on the frame difference image to obtain a binarized image; the contour analysis module is configured to perform contour analysis processing on the binarized image to obtain the area of a contour circumscribed rectangle region of a moving object in the binarized image; the moving target screening module is configured to divide the contour circumscribed rectangle region of the moving object in the binarized image into a large block motion region or a small block motion region according to a preset area threshold and the area of the contour circumscribed rectangle region of the moving object in the binarized image; the image compression unit is configured to perform spatial-to-channel compression processing on an image corresponding to each large block motion region in the binarized image to generate a first to-be-detected image; the image splicing unit is configured to perform image splicing processing on images corresponding to all small block motion regions in the binarized image to generate a second to-be-detected image; and the target detection module is configured to use a target detection model to perform target detection on the first to-be-detected image and the second to-be-detected image respectively to obtain the center point position coordinates and category information of the moving object on the current frame original image.

[0022] Compared with the prior art, the moving object detection method and device provided by the application have the following beneficial effects:

[0023] The motion object detection method provided by the application can effectively reduce the repeated calculation of the static background, improve the detection efficiency, and when applied to a monitoring system, can reduce the false alarm caused by the slight change in the static background, provide a more rich scene understanding for the system, and enhance the intelligence of the monitoring system.

[0024] Since the motion object detection device provided by the application and the motion object detection method provided by the application belong to the same inventive concept, the motion object detection device provided by the application at least has all the advantages of the motion object detection method provided by the application. For the advantages of the motion object detection device provided by the application, please refer to the related description of the advantages of the motion object detection method provided by the application. Here, it will not be repeated. BRIEF DESCRIPTION OF DRAWINGS

[0025] Figure 1 The overall step schematic diagram of the motion object detection method provided by the first embodiment of the application is shown in the figure;

[0026] Figure 2 The specific flowchart of the motion object detection method provided by the first embodiment of the application is shown in the figure;

[0027] Figure 3 One specific example diagram of data rearrangement from spatial dimension to channel dimension for the image corresponding to the large motion area provided for the first embodiment of the present application;

[0028] Figure 4 The structure block diagram of the motion object detection device provided for the second embodiment of the present application;

[0029] The reference signs are explained as follows:

[0030] 1-frame difference module, 2-binarization module, 3-contour analysis module, 4-motion target screening module, 5-image reconstruction module, 51-image compression unit, 52-image splicing unit, 6-target detection module. DETAILED DESCRIPTION

[0031] The motion object detection method and device proposed by the present application are further described in detail below in combination with the drawings and specific embodiments. The advantages and features of the present application will be more apparent according to the following description. It should be noted that the drawings are all very simplified and use non-precise proportions, only to facilitate, clearly assist in explaining the purpose of the embodiments of the present application. In order to make the purpose, features and advantages of the present application more apparent and easy to understand, please refer to the drawings. It should be understood that the structures, proportions, sizes, etc. shown in the drawings attached to the present specification are only used to cooperate with the content disclosed in the specification, so that those skilled in the art can understand and read, and are not used to limit the conditions of the implementation of the present application. Any modification of structure, change of proportion relationship or adjustment of size, as long as it is the same or similar to the effect and purpose that can be achieved by the present application, should still fall within the scope of the technical content disclosed by the present application. The specific design features of the present application disclosed in this paper include, for example, specific dimensions, directions, positions and shapes, which will be determined partly by the specific application and use environment. In the following description of the embodiments, sometimes the same reference signs are used to represent the same parts or parts with the same function between different drawings, and the repeated description is omitted.

[0032] Embodiment one

[0033] The present embodiment provides a motion object detection method. Specifically, please refer to Figure 1 and Figure 2 , Figure 1 The overall step schematic diagram of the motion object detection method provided for the present embodiment; Figure 2 One specific flowchart of the motion object detection method provided for the present embodiment. From Figure 1 and Figure 2 It can be seen that the detection method comprises:

[0034] S100: difference operation is performed on a current frame original image and a previous frame original image in a video image sequence by using an inter-frame difference method to obtain a frame difference image;

[0035] S200: binaryzation processing and morphological processing are performed on the frame difference image to obtain a binary image;

[0036] S300: contour analysis processing is performed on the binary image to obtain an area of a contour circumscribed rectangle region of a moving object in the binary image;

[0037] S400: according to a preset area threshold and the area of the contour circumscribed rectangle region of the moving object in the binary image, the contour circumscribed rectangle region of the moving object in the binary image is divided into a large block motion region or a small block motion region;

[0038] S500: spatial-to-channel compression processing is performed on an image corresponding to each of the large block motion regions in the binary image to generate a first to-be-detected image;

[0039] S600: image splicing processing is performed on images corresponding to all the small block motion regions in the binary image to generate a second to-be-detected image;

[0040] S700: target detection is performed on the first to-be-detected image and the second to-be-detected image respectively by using a target detection model to obtain center point position coordinates and category information of the moving object on the current frame original image.

[0041] Therefore, the method for detecting moving objects provided in the embodiment can effectively extract the moving area in the scene, suppress the interference of the static background, and lay a good foundation for subsequent accurate distinction between the real moving target and the static interference. Then, the binary image is subjected to contour analysis processing to obtain the area of the contour circumscribed rectangle region of the moving object in the binary image, which lays a foundation for subsequent division of the moving object. Next, according to a preset area threshold and the area of the contour circumscribed rectangle region of the moving object in the binary image, the contour circumscribed rectangle region of the moving object in the binary image is divided into a large moving area or a small moving area, a spatial-to-channel compression processing is performed on the image corresponding to each large moving area in the binary image to generate a first to-be-detected image, and an image splicing processing is performed on the images corresponding to all the small moving areas in the binary image to generate a second to-be-detected image, which can reduce redundant calculation, reduce the subsequent model calculation amount, and lay a good foundation for fast detection of the moving object in the complex scene. Finally, a target detection model is used to perform target detection on the first to-be-detected image and the second to-be-detected image respectively to obtain the center point position coordinates and category information of the moving object on the current frame original image, which can quickly and accurately detect the moving object in the complex scene. The method for detecting moving objects provided in the embodiment can not only effectively reduce the repeated calculation of the static background and improve the detection efficiency, but also can be applied to a monitoring system to reduce the false alarm caused by the slight change in the static background, provide the system with richer scene understanding, and enhance the intelligence of the monitoring system.

[0042] It should be noted that in step S100, the absolute difference value of the pixel values at the same position in the adjacent two frames of images can be calculated to generate a frame difference image reflecting the motion change. This method is a common motion detection method in the field and belongs to the prior art, which will not be described in detail here.

[0043] Preferably, in step S200, the binary image is obtained by performing binaryzation processing and morphological processing on the frame difference image, including: S211: performing binaryzation processing on the frame difference image based on an adaptive threshold to obtain a binaryzation-processed image; and S212: performing morphological processing on the binaryzation-processed image to obtain the binary image. Therefore, the frame difference image is first subjected to binaryzation processing based on an adaptive threshold to separate the foreground from the background and obtain the motion information, and then the binaryzation-processed image is subjected to morphological processing to remove part of the noise information and make the foreground area more complete.

[0044] Exemplarily, in some embodiments, in step S211, the adaptive threshold = the pixel mean value of the frame difference image + threshold adjustment coefficient x the pixel standard deviation of the frame difference image; wherein the threshold adjustment coefficient is used to adjust the sensitivity of motion detection. Thus, by introducing the threshold adjustment coefficient to adjust the adaptive threshold, not only can the sensitivity of motion detection be flexibly adjusted according to the actual application requirements, but also more reliable input can be provided for subsequent contour analysis and target detection, so as to reduce the false detection rate.

[0045] Exemplarily, in some embodiments, in step S212, the morphological processing of the binaryzation-processed image to obtain the binary image comprises: performing erosion processing on the binaryzation-processed image, and then performing inflation processing to obtain the binary image. Thus, the erosion processing and inflation processing can be used to filter out fine noise information.

[0046] Further, in step S300, the contour analysis processing of the binary image to obtain the area of the contour circumscribed rectangle region of the moving object in the binary image comprises: S311: extracting the contour information of the moving object in the binary image; S312: obtaining the area of the contour circumscribed rectangle region of the moving object in the binary image based on the contour information of the moving object in the binary image.

[0047] It should be noted that the type of algorithm used for the contour analysis processing is not limited in the present application. Exemplarily, in some embodiments, the FindContours function in the Opencv computer vision library can be used to extract the contour of the binary image and obtain the area of the contour circumscribed rectangle region of the moving object in the binary image; in other embodiments, the cv2.connectedComponentsWithStats function in the Opencv computer vision library can also be used to extract the contour of the binary image and obtain the area of the contour circumscribed rectangle region of the moving object in the binary image.

[0048] In addition, it should be noted that in the present application, the contour circumscribed rectangle refers to a rectangle used to surround the contour of the moving object, and its specific form can include but is not limited to an axis-aligned circumscribed rectangle, a minimum-area circumscribed rectangle, etc.

[0049] Exemplarily, in some embodiments, in step S400, the dividing the contour circumscribed rectangular region of the moving object in the binary image into a large block motion region or a small block motion region according to the preset area threshold and the area of the contour circumscribed rectangular region of the moving object in the binary image comprises: judging whether the area of the contour circumscribed rectangular region of the moving object in the binary image is greater than the preset area threshold; if yes, dividing the contour circumscribed rectangular region into a large block motion region; if not, dividing the contour circumscribed rectangular region into a small block motion region.

[0050] It should be noted that the present application does not make too many limitations on the specific value of the preset area threshold, which can be set according to the actual application scenario.

[0051] Preferably, in step S500, the space-to-channel compression processing of the image corresponding to each large block motion region in the binary image to generate a first to-be-detected image comprises: data rearrangement of the image corresponding to each large block motion region in the binary image from a spatial dimension to a channel dimension to generate the first to-be-detected image. Thus, by rearranging the spatial data of the image corresponding to the large block motion region to the channel dimension to realize image compression, the calculation efficiency of the subsequent model can be improved without losing information.

[0052] Exemplarily, please refer to Figure 3 , Figure 3 A specific example of data rearrangement of the image corresponding to the large block motion region from a spatial dimension to a channel dimension is provided for the present embodiment. As shown in Figure 3 , the image corresponding to the large block motion region with a size of 6x6x2 (widthxheightxcolor channel) is rearranged by space-to-depth to generate a first to-be-detected image with a size of 3x3x8 (widthxheightxcolor channel).

[0053] Further, in step S600, the image stitching processing is performed on the images corresponding to all the small motion regions in the binary image to generate a second to-be-detected image, including: S611: sequentially stitching the images corresponding to the small motion regions to be stitched in the binary image into a preset-size image canvas, and ensuring that any image corresponding to the small motion region does not exceed the boundary of the image canvas after being stitched; S612: when the image corresponding to the next small motion region to be stitched cannot be completely stitched without exceeding the boundary of the image canvas, saving the current image canvas and initializing a new preset-size image canvas for subsequent stitching; S613: for any blank area in each image canvas that is not covered by the image corresponding to the small motion region, using the pixel information at the corresponding position in the binary image to fill the blank area, to obtain a second to-be-detected image.

[0054] For example, in some embodiments, the images corresponding to all the small motion regions are first extracted from the binary image, and are sorted according to their spatial positions in the binary image in the order from top to bottom and from left to right (for example, the vertical coordinates are compared first, and if the vertical coordinates are the same, the horizontal coordinates are compared). Then, a preset-size image canvas (for example, 640x480) is initialized, and the image corresponding to the first small motion region in the sorted order is placed at the top-left corner of the image canvas. Then, the images corresponding to the small motion regions are stitched into the image canvas in the order from top to bottom and from left to right, and the stitched image corresponding to the small motion region does not exceed the boundary of the image canvas. When the image corresponding to the next small motion region to be stitched cannot be completely stitched without exceeding the boundary of the image canvas, the current image canvas is saved, and a new preset-size image canvas is initialized for subsequent stitching. The image corresponding to the current small motion region to be stitched is placed at the top-left corner of the new image canvas, and the above stitching process is repeated. In addition, for any blank area in each image canvas that is not covered by the image corresponding to any small motion region, the pixel information at the corresponding position in the binary image is used to fill the blank area. Finally, a plurality of second to-be-detected images of a preset size are obtained.

[0055] Preferably, in step S700, the target detection model is used to respectively detect targets in the first to-be-detected image and the second to-be-detected image, to obtain the center point position coordinates and category information of the moving object on the current frame original image, including: S711: using the target detection model to respectively detect targets in the first to-be-detected image and the second to-be-detected image, and respectively outputting the center point position coordinates and category information of the moving object in the first to-be-detected image and the center point position coordinates and category information of the moving object in the second to-be-detected image; S712: obtaining the center point position coordinates and category information of the moving object on the current frame original image through the mapping relationship.

[0056] Exemplarily, in some embodiments, the target detection model adopts an Anchor-Free type neural network target detection model, which does not rely on a predefined anchor box, but directly predicts the center point position, size and category information of the target. Compared with an Anchor-Based target detection model, the Anchor-Free model does not need to preset anchor boxes and related hyperparameters, reduces the model parameter tuning complexity, and has stronger adaptability to size changes of input images and diversity of target shapes.

[0057] It should be noted that the above description of the Anchor-Free model is only exemplary, and the specific type of the target detection model is not limited in the present application. In other embodiments, the target detection model can also adopt other detection algorithms capable of target positioning and classification of input images, preferably various neural network target detection models (such as Faster R-CNN, YOLO, DETR, FCOS, etc.), as long as it can receive the first to-be-detected image or the second to-be-detected image as input and output the center point position coordinates and category information of the moving object.

[0058] It should be noted that, since the first to-be-detected image and the second to-be-detected image are generated by reconstructing the binary image in different ways, after the target detection model outputs the center point position coordinates of the moving object on the first to-be-detected image and the second to-be-detected image, the coordinates need to be mapped back to the coordinate system of the current frame original image according to the respective reconstruction rules to obtain the real space position. The specific mapping method is as follows: for the first to-be-detected image, since it is generated by rearranging the image corresponding to the large moving area in the binary image through spatial conversion channel compression processing, and the rearrangement rule is known, the position of the center point of the moving object in the first to-be-detected image in the image corresponding to the large moving area can be determined by reverse indexing, and then combined with the position coordinates of the image corresponding to the large moving area in the current frame original image, the position coordinates of the center point of the moving object in the first to-be-detected image on the current frame original image can be finally obtained. For the second to-be-detected image, since it is generated by splicing the images corresponding to multiple small moving areas in the binary image according to the known splicing rule, first, it is judged in which image corresponding to a small moving area the center point of the moving object in the second to-be-detected image falls, and then according to the coordinate offset of the image corresponding to the small moving area on the current frame original image, the position coordinates of the center point of the moving object in the second to-be-detected image are converted to the position coordinates on the current frame original image. At the same time, the category information of the moving object is directly retained and does not need to be converted.

[0059] Embodiment Two

[0060] The embodiment provides a detection device of a moving object. Specifically, please refer to Figure 4 , Figure 4 The structure block diagram of the detection device of the moving object provided by the embodiment. From Figure 4It can be seen that the detection device comprises a frame difference module 1, a binarization module 2, a contour analysis module 3, a moving target screening module 4, an image reconstruction module 5 and a target detection module 6 arranged in sequence, the image reconstruction module 5 comprises an image compression unit 51 and an image splicing unit 52; the frame difference module 1 is configured to perform difference operation on a current frame original image and a previous frame original image in a video image sequence by using an inter-frame difference method to obtain a frame difference image; the binarization module 2 is configured to perform binarization processing and morphological processing on the frame difference image to obtain a binarized image; the contour analysis module 3 is configured to perform contour analysis processing on the binarized image to obtain an area of a contour circumscribed rectangle region of a moving object in the binarized image; the moving target screening module 4 is configured to divide the contour circumscribed rectangle region of the moving object in the binarized image into a large block moving region or a small block moving region according to a preset area threshold and the area of the contour circumscribed rectangle region of the moving object in the binarized image; the image compression unit 51 is configured to perform spatial-to-channel compression processing on an image corresponding to each of the large block moving regions in the binarized image to generate a first to-be-detected image; the image splicing unit 52 is configured to perform image splicing processing on images corresponding to all of the small block moving regions in the binarized image to generate a second to-be-detected image; and the target detection module 6 is configured to perform target detection on the first to-be-detected image and the second to-be-detected image respectively by using a target detection model to obtain a center point position coordinate and category information of the moving object on the current frame original image.

[0061] Since the detection device for a moving object provided in the embodiment and the detection method for a moving object provided in any of the above embodiments belong to the same inventive concept, the detection device for a moving object provided in the embodiment has at least all the advantages of the detection method for a moving object provided in each of the above embodiments, and the advantages of the detection device for a moving object provided in the embodiment are described in the description of the advantages of the detection method for a moving object provided in each of the above embodiments, which will not be repeated here.

[0062] In order to facilitate understanding of the present application, the working process of the detection device is exemplarily described below.

[0063] Firstly, the continuous frame pictures in the video image sequence are sequentially input into the frame difference module 1 in time sequence, and difference operation is performed on the current frame original image and the previous frame original image by using the inter-frame difference method to obtain the frame difference image of the adjacent two frame pictures. Among them, the input is an RGB picture with a size of 1920x1080x3 (widthxheightxcolor channel), and the frame difference module 1 outputs the frame difference image of the adjacent two frame pictures to the binarization module 2.

[0064] Then, in the binarization module 2, the frame difference image is first binarized based on an adaptive threshold, and then the binarized image is sequentially subjected to erosion processing and dilation processing to filter out fine noise information, and the binarized image is output to the contour analysis module 3 through the binarization module 2.

[0065] Then, in the contour analysis module 3, the FindContours function in the Opencv computer vision library is used to extract the contours of the binarized image and obtain the area of the contour bounding rectangle region of the moving object in the binarized image.

[0066] Then, in the motion target screening module 4, it is first determined whether the area of the contour bounding rectangle region of the moving object in the binarized image is greater than a preset area threshold, and then the contour bounding rectangle region of the moving object with an area greater than the preset area threshold is divided into a large block motion region, and the contour bounding rectangle region of the moving object with an area not greater than the preset area threshold is divided into a small block motion region.

[0067] Subsequently, the binarized image obtained after processing by the contour analysis module 3 and the motion target screening module 4 is output to the image reconstruction module 5, the image in each large block motion region in the binarized image is subjected to spatial-to-channel compression processing by the image compression unit 51 to generate a first to-be-detected image, and the images corresponding to all small block motion regions in the binarized image are subjected to image stitching processing by the image stitching unit 52 to generate a second to-be-detected image with a size of 640x480. Finally, the first to-be-detected image and the second to-be-detected image are output to the target detection module 6 through the reconstruction module.

[0068] Finally, in the target detection module 6, the Anchor-Free model is used to perform target detection on the first to-be-detected image and the second to-be-detected image respectively, and the center point position coordinates and class information of the moving object in the first to-be-detected image and the center point position coordinates and class information of the moving object in the second to-be-detected image are output respectively. Then, the center point position coordinates and class information of the moving object on the current frame original image are obtained through the mapping relationship.

[0069] In summary, the motion object detection method and device provided by the application have the following advantages: the motion object detection method provided by the application can effectively extract the motion region in the scene and suppress the interference of the static background by performing difference operation on the current frame original image and the previous frame original image in the video image sequence to obtain a frame difference image, laying a good foundation for subsequent accurate distinction between the real motion target and the static interference; the binarization processing and the morphological processing are performed on the frame difference image to obtain a binarization image, which can not only enhance the connectivity of the motion region, but also effectively filter out the fine noise information, thereby reducing the false detection rate. Then, the contour analysis processing is performed on the binarization image to obtain the area of the contour circumscribed rectangle region of the motion object in the binarization image, laying a foundation for subsequent division of the motion object. Next, according to the preset area threshold and the area of the contour circumscribed rectangle region of the motion object in the binarization image, the contour circumscribed rectangle region of the motion object in the binarization image is divided into a large block motion region or a small block motion region, and the spatial conversion channel compression processing is performed on the image corresponding to each large block motion region in the binarization image to generate a first to-be-detected image, and the image splicing processing is performed on the images corresponding to all the small block motion regions in the binarization image to generate a second to-be-detected image, which can reduce the redundant calculation, reduce the subsequent model calculation amount, and lay a good foundation for quickly detecting the motion object in the complex scene. Finally, the target detection model is used to perform target detection on the first to-be-detected image and the second to-be-detected image respectively to obtain the center point position coordinates and the category information of the motion object on the current frame original image, which can quickly and accurately detect the motion object in the complex scene. The motion object detection method provided by the application can not only effectively reduce the repeated calculation of the static background and improve the detection efficiency, but also applied to the monitoring system, can reduce the false alarm caused by the slight change in the static background, provide more rich scene understanding for the system, and enhance the intelligence of the monitoring system.

[0070] Since the motion object detection device provided by the application belongs to the same inventive concept as the motion object detection method provided by the application, the motion object detection device provided by the application at least has all the advantages of the motion object detection method provided by the application. For the advantages of the motion object detection device provided by the application, please refer to the related description of the advantages of the motion object detection method provided by the application, which will not be repeated here.

[0071] Finally, it should be pointed out that the above embodiments are only used to illustrate the technical solutions of the application and not to limit the application. Although the application has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the application can be modified or replaced equivalently without departing from the spirit and scope of the technical solutions of the application.

Claims

1. A method for detecting a moving object, characterized in that, include: The frame difference method is used to perform a difference operation on the original image of the current frame and the original image of the previous frame in the video image sequence to obtain the frame difference map; The frame difference map is binarized and morphologically processed to obtain a binarized image; Perform contour analysis on the binarized image to obtain the area of ​​the bounding rectangle region of the contour of the moving object in the binarized image; Based on a preset area threshold and the area of ​​the bounding rectangle region of the moving object's outline in the binarized image, the bounding rectangle region of the moving object's outline in the binarized image is divided into large motion regions or small motion regions. The image corresponding to each large motion region in the binarized image is subjected to spatial-to-channel compression processing to generate the first image to be detected; The images corresponding to all the small motion regions in the binarized image are stitched together to generate a second image to be detected. The target detection model is used to perform target detection on the first image to be detected and the second image to be detected, respectively, to obtain the center point coordinates and category information of the moving object on the original image of the current frame.

2. The method for detecting a moving object as described in claim 1, characterized in that, The step of performing binarization and morphological processing on the frame difference map to obtain a binarized image includes: The frame difference map is binarized based on an adaptive threshold to obtain a binarized image. The binarized image is then subjected to morphological processing to obtain the binarized image.

3. The method for detecting moving objects as described in claim 2, characterized in that, The adaptive threshold is equal to the mean pixel value of the frame difference map plus a threshold adjustment coefficient multiplied by the standard deviation of the pixels in the frame difference map; wherein the threshold adjustment coefficient is used to adjust the sensitivity of motion detection.

4. The method for detecting a moving object as described in claim 2, characterized in that, The step of performing morphological processing on the binarized image to obtain the binarized image includes: The binarized image is then subjected to erosion and dilation to obtain the binarized image.

5. The method for detecting a moving object as described in claim 1, characterized in that, The step of performing contour analysis on the binarized image to obtain the area of ​​the bounding rectangle region of the contour of the moving object in the binarized image includes: Extract the contour information of moving objects from the binarized image; Based on the contour information of the moving object in the binarized image, the area of ​​the bounding rectangle region of the moving object's contour in the binarized image is obtained.

6. The method for detecting a moving object as described in claim 1, characterized in that, The step of dividing the bounding rectangle region of the moving object in the binarized image into large motion regions or small motion regions based on a preset area threshold and the area of ​​the bounding rectangle region of the moving object's outline in the binarized image includes: Determine whether the area of ​​the bounding rectangle region of the moving object in the binarized image is greater than the preset area threshold: if yes, divide the bounding rectangle region into a large motion region; if no, divide the bounding rectangle region into a small motion region.

7. The method for detecting a moving object as described in claim 1, characterized in that, The step of performing spatial-to-channel compression processing on the image corresponding to each large motion region in the binarized image to generate a first image to be detected includes: The image corresponding to each large motion region in the binarized image is rearranged from the spatial dimension to the channel dimension to generate the first image to be detected.

8. The method for detecting a moving object as described in claim 1, characterized in that, The step of performing image stitching processing on the images corresponding to all the small motion regions in the binarized image to generate a second image to be detected includes: The images corresponding to the small moving regions to be stitched in the binarized image are sequentially stitched into an image canvas of a preset size, ensuring that the image corresponding to any one of the small moving regions does not exceed the boundary of the image canvas after stitching. When the image corresponding to the next small moving area to be stitched cannot be completely stitched without exceeding the boundary of the image canvas, the current image canvas is saved, and a new image canvas of a preset size is initialized for subsequent stitching. For each image canvas containing a missing region not covered by the image corresponding to the small motion region, the pixel information of the corresponding position in the binarized image is used to fill the missing region, thus obtaining a second image to be detected.

9. The method for detecting a moving object as described in claim 1, characterized in that, The step of using a target detection model to perform target detection on the first image to be detected and the second image to be detected, respectively, to obtain the center point coordinates and category information of the moving object on the original image of the current frame, includes: The target detection model is used to perform target detection on the first image to be detected and the second image to be detected, respectively, and outputs the center point coordinates and category information of the moving object in the first image to be detected and the center point coordinates and category information of the moving object in the second image to be detected, respectively. The center point coordinates and category information of the moving object on the original image of the current frame are obtained through the mapping relationship.

10. A device for detecting moving objects, characterized in that, It includes a frame difference module, a binarization module, a contour analysis module, a moving target screening module, an image reconstruction module, and a target detection module arranged in sequence. The image reconstruction module includes an image compression unit and an image stitching unit. The frame difference module is configured to: perform a difference operation on the original image of the current frame and the original image of the previous frame in the video image sequence using the inter-frame difference method to obtain a frame difference map; The binarization module is configured to perform binarization and morphological processing on the frame difference map to obtain a binarized image; The contour analysis module is configured to: perform contour analysis processing on the binarized image to obtain the area of ​​the bounding rectangle region of the contour of the moving object in the binarized image; The moving target filtering module is configured to: divide the bounding rectangle region of the moving object in the binarized image into large moving regions or small moving regions based on a preset area threshold and the area of ​​the bounding rectangle region of the moving object in the binarized image. The image compression unit is configured to: perform spatial-to-channel compression processing on the image corresponding to each large motion region in the binarized image to generate a first image to be detected; The image stitching unit is configured to: perform image stitching processing on the images corresponding to all the small motion regions in the binarized image to generate a second image to be detected; The target detection module is configured to: use a target detection model to perform target detection on the first image to be detected and the second image to be detected respectively, and obtain the center point coordinates and category information of the moving object on the original image of the current frame.