Local moving object detection method and system, storage medium and electronic equipment

Through visual algorithms and differential image processing, fast and accurate detection of moving objects is achieved, solving the problems of high cost and complex deployment of traditional methods, simplifying the deployment process, and suitable for industrial automation.

CN119090921APending Publication Date: 2024-12-06JIANGLING MOTORS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411205658.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-30
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

Traditional moving object detection methods are costly and complex in deployment, so they cannot achieve rapid deployment. They need to be re-planned and deployed in the event of environmental changes, which cannot meet the rapid deployment needs in the field of industrial automation.

Method used

Using the local moving object detection method based on vision, the image extraction, differential operation, difference judgment, binarization and connectivity analysis are performed by acquiring monitoring videos, and whether there are differences in the images of adjacent frames are judged, and the foreground and background points are marked to generate A target image containing a complete moving target, sending an alarm message.

Benefits of technology

It realizes fast and accurate detection of moving objects, reduces deployment complexity and cost, simplifies deployment process, improves detection accuracy and low delay, and is suitable for industrial automation fields.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119090921A_ABST
    Figure CN119090921A_ABST
Patent Text Reader

Abstract

The invention provides a method and system for detecting a local moving object, a storage medium and electronic equipment, and the method comprises the steps: obtaining a monitoring video of a target region, and carrying out the image extraction of the monitoring video, and obtaining continuous frames of monitoring images; performing difference operation according to the images of the adjacent frames to obtain a difference image; judging whether the images of the adjacent frames have differences or not according to the difference image; if the images of the adjacent frames have differences, traversing each pixel point in the difference image, and marking foreground points and background points in the difference image according to a traversing result to obtain a binary image; and carrying out connectivity analysis on the binarized image to obtain a target image containing a complete moving target. According to the invention, the detection accuracy, low time delay and development convenience of the moving object can be simplified and improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of moving object monitoring, and in particular to a detection method, system, storage medium and electronic equipment for a local moving object. Background Art

[0002] In the field of industrial automation, there is a huge demand for moving object detection and accuracy. By identifying the target area, rapid deployment can be achieved using visual methods. There are various visual detection solutions on the market.

[0003] However, many traditional moving object detections use ultrasonic or lidar methods, which are costly and complex to deploy. They cannot be deployed quickly and require new planning and deployment when the environment changes. Summary of the invention

[0004] Based on this, an object of the present invention is to provide a method, system, storage medium and electronic device for detecting a local moving object, so as to solve at least one problem in the background technology.

[0005] In a first aspect, an embodiment of the present invention provides a method for detecting a local moving object, wherein the method comprises: Acquire a surveillance video of the target area, and perform image extraction on the surveillance video to obtain a monitoring image of continuous frames; Performing a differential operation on images of adjacent frames to obtain a differential image; Determining whether there is a difference between images of adjacent frames according to the differential image; If there is a difference between the images of adjacent frames, each pixel point in the difference image is traversed to mark the foreground point and the background point in the difference image according to the traversal result to obtain a binary image; Connectivity analysis is performed on the binary image to obtain a target image containing a complete moving target.

[0006] In some embodiments, the step of performing a differential operation on images of adjacent frames to obtain a differential image includes: The difference image is obtained according to the following formula: in, Represents the grayscale value of the pixel with coordinates (x, y) in the image of the nth frame, Represents the grayscale value of the pixel with coordinates (x, y) in the image of the n-1th frame, Represents the grayscale value of the pixel with coordinates (x, y) in the difference image.

[0007] In some embodiments, the step of determining whether there is a difference between images of adjacent frames according to the differential image comprises: Determine whether there is a pixel in the differential image whose grayscale value is greater than a first preset grayscale threshold; If there is a pixel whose grayscale value is greater than a first preset grayscale threshold, it is determined that there is a difference between the images of adjacent frames; If there is a pixel whose grayscale value is less than or equal to the first preset grayscale threshold, it is determined that there is no difference between the images of adjacent frames.

[0008] In some embodiments, if there is a difference between the images of adjacent frames, traversing each pixel point in the differential image to mark the foreground point and the background point in the differential image according to the traversal result to obtain a binary image comprises: The binary image is obtained according to the following formula: represents the gray value of the pixel with coordinates (x, y) in the binary image, and T represents the first preset gray threshold.

[0009] In some embodiments, if there is a pixel point whose grayscale value is less than or equal to the first preset grayscale threshold, the step of determining that there is no difference between images of adjacent frames further includes: Determine whether there is a difference between the image of the nth frame and the image of the n+1th frame; If there is no difference, continue to extract images of two adjacent frames until it is determined that there is a difference between the images of the two adjacent frames.

[0010] In some embodiments, the step of performing connectivity analysis on the binary image to obtain a target image containing a complete moving target includes: Acquire a target area corresponding to the moving target according to the target image, and determine whether the target area is within a preset designated area; If the target area appears within the preset specified area, an alarm message will be issued.

[0011] In a second aspect, an embodiment of the present invention further provides a local moving object detection system, the system comprising: An image extraction module is used to obtain a surveillance video of a target area and perform image extraction on the surveillance video to obtain a surveillance image of continuous frames; A differential operation module, used for performing differential operation on images of adjacent frames to obtain a differential image; A difference judgment module, used for judging whether there is a difference between images of adjacent frames according to the differential image; An image binarization module is used for traversing each pixel point in the differential image if there is a difference between the images of adjacent frames, so as to mark the foreground points and background points in the differential image according to the traversal result to obtain a binary image; The connectivity module is used to perform connectivity analysis on the binary image to obtain a target image containing a complete moving target.

[0012] In some embodiments, the differential operation module is further used to: The difference image is obtained according to the following formula: in, Represents the grayscale value of the pixel with coordinates (x, y) in the image of the nth frame, Represents the grayscale value of the pixel with coordinates (x, y) in the image of the n-1th frame, Represents the grayscale value of the pixel with coordinates (x, y) in the difference image.

[0013] In a third aspect, an embodiment of the present invention further provides a storage medium, including one or more programs stored in the storage medium, which, when executed, implements the above-mentioned method for detecting local moving objects.

[0014] In a fourth aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising a memory and a processor, wherein: The memory is used to store computer programs; When the processor is used to execute the computer program stored in the memory, the above-mentioned local moving object detection method is implemented.

[0015] In summary, according to the above-mentioned local moving object detection method, by comparing and extracting the images of adjacent frames to confirm whether there is a moving object in the picture, and setting the detection range in the picture, when it is judged that a moving object appears in the set range, an alarm is triggered, and it can be realized to quickly and accurately determine whether there is a moving object in the picture. In addition, the present invention is based on the visual algorithm plus the local moving object detection of the depth camera, based on the framework of C# and emgu cv, to simplify and improve the detection accuracy, low latency and convenience of moving objects, and at the same time simplify the deployment process.

[0016] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description or will be learned through embodiments of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 This is a flow chart of a method for detecting a local moving object according to a first embodiment of the present invention; Figure 2 is a schematic diagram of a target image in the first embodiment of the present invention; Figure 3 It is a schematic structural diagram of a local moving object detection system in the third embodiment of the present invention.

[0018] The following specific implementation manner will further illustrate the present invention in conjunction with the above-mentioned drawings. DETAILED DESCRIPTION

[0019] In order to facilitate the understanding of the present invention, the present invention will be described more fully below with reference to the relevant drawings. Several embodiments of the present invention are given in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive.

[0020] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.

[0021] See also Figure 1 , which is a flow chart of a method for detecting a local moving object in a first embodiment of the present invention, the method comprises steps S101 to S105, wherein: Step S101: acquiring a surveillance video of a target area, and performing image extraction on the surveillance video to obtain surveillance images of continuous frames; It should be noted that moving object detection is the detection of moving objects (targets) in videos (video files / camera acquisition). Common moving object detection methods include background subtraction, frame difference method, and optical flow method. Moving object detection is widely used in video security monitoring, vehicle detection, and other aspects.

[0022] The development environment of the technical solution of the present invention is developed using C# based on the emgu cv framework, with multi-threading and asynchronous detection, and a multi-model and multi-sample method for training.

[0023] Step S102: performing a differential operation on images of adjacent frames to obtain a differential image; In this step, the differential image is obtained according to the following formula: in, Represents the grayscale value of the pixel with coordinates (x, y) in the image of the nth frame, Represents the grayscale value of the pixel with coordinates (x, y) in the image of the n-1th frame, Represents the grayscale value of the pixel with coordinates (x, y) in the difference image.

[0024] Step S103: judging whether there is a difference between images of adjacent frames according to the differential image; It should be noted that if there is a difference, it means that there is a moving target, and if there is no difference, it means that there is no moving target.

[0025] In some embodiments, determining whether there is a pixel in the differential image whose grayscale value is greater than a first preset grayscale threshold; If there is a pixel whose grayscale value is greater than a first preset grayscale threshold, it is determined that there is a difference between the images of adjacent frames; If there is a pixel whose grayscale value is less than or equal to the first preset grayscale threshold, it is determined that there is no difference between the images of adjacent frames.

[0026] Further, if there is no difference, it is determined whether there is a difference between the image of the nth frame and the image of the n+1th frame, that is, the image of the latter frame and the image of the previous frame are extracted to form two images of adjacent frames; If there is still no difference, continue to extract images of two adjacent frames until it is determined that there is a difference between the images of the two adjacent frames.

[0027] Step S104: if there are differences between the images of adjacent frames, traverse each pixel point in the differential image to mark the foreground points and background points in the differential image according to the traversal result to obtain a binary image; In this step, the binary image is obtained according to the following formula: represents the gray value of the pixel with coordinates (x, y) in the binary image, and T represents the first preset gray threshold; that is, when the gray value of the pixel in the differential image is greater than the first preset pixel threshold, it is a foreground (moving target) point, and if it is less than or equal to the first preset pixel threshold, it is a background point.

[0028] Step S105: Perform connectivity analysis on the binary image to obtain a target image containing a complete moving target.

[0029] It should be noted that, after the target image is obtained, a target area corresponding to the moving target is obtained according to the target image, and it is determined whether the target area is within a preset designated area; If the target area appears within the preset specified area, an alarm message will be issued.

[0030] For example, see Figure 2, when a moving object is detected in the picture, the software will trigger CIP communication and send a signal to the lower computer (PLC), which can execute the corresponding logic.

[0031] In summary, according to the above-mentioned local moving object detection method, by comparing and extracting the images of adjacent frames to confirm whether there is a moving object in the picture, and setting the detection range in the picture, when it is judged that a moving object appears in the set range, an alarm is triggered, and it can be realized to quickly and accurately determine whether there is a moving object in the picture. In addition, the present invention is based on the visual algorithm plus the local moving object detection of the depth camera, based on the framework of C# and emgu cv, to simplify and improve the detection accuracy, low latency and convenience of moving objects, and at the same time simplify the deployment process.

[0032] See also Figure 3 , which is a schematic diagram of the structure of a local moving object detection system in the third embodiment, the system comprises: The image extraction module 10 is used to obtain the monitoring video of the target area and perform image extraction on the monitoring video to obtain monitoring images of continuous frames; The differential operation module 20 is used to perform differential operation on the images of adjacent frames to obtain a differential image; Furthermore, the differential operation module 20 is also used for: The difference image is obtained according to the following formula: in, Represents the grayscale value of the pixel with coordinates (x, y) in the image of the nth frame, Represents the grayscale value of the pixel with coordinates (x, y) in the image of the n-1th frame, Represents the grayscale value of the pixel with coordinates (x, y) in the difference image.

[0033] A difference determination module 30 is used to determine whether there is a difference between images of adjacent frames according to the differential image; Furthermore, the difference determination module 30 is also used for: Determine whether there is a pixel in the differential image whose grayscale value is greater than a first preset grayscale threshold; If there is a pixel whose grayscale value is greater than a first preset grayscale threshold, it is determined that there is a difference between the images of adjacent frames; If there is a pixel whose grayscale value is less than or equal to the first preset grayscale threshold, it is determined that there is no difference between the images of adjacent frames; If there is no difference, continue to extract images of two adjacent frames until it is determined that there is a difference between the images of the two adjacent frames.

[0034] The image binarization module 40 is used for traversing each pixel point in the difference image if there is a difference between the images of adjacent frames, so as to mark the foreground points and the background points in the difference image according to the traversal result, and obtain a binary image; Furthermore, the image binarization module 40 is also used for: The binary image is obtained according to the following formula: represents the gray value of the pixel with coordinates (x, y) in the binary image, and T represents the first preset gray threshold.

[0035] The connectivity module 50 is used to perform connectivity analysis on the binary image to obtain a target image containing a complete moving target.

[0036] Furthermore, the communication module 50 is also used for: Acquire a target area corresponding to the moving target according to the target image, and determine whether the target area is within a preset designated area; If the target area appears within the preset specified area, an alarm message will be issued.

[0037] Another aspect of the present invention further provides a computer storage medium on which one or more programs are stored, and when the programs are executed by a processor, the above-mentioned method for detecting local moving objects is implemented.

[0038] Another aspect of the present invention further provides an electronic device, comprising a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory to implement the above-mentioned method for detecting a local moving object.

[0039] Those skilled in the art will appreciate that the logic and / or steps represented in the flowchart or otherwise described herein, for example, may be considered as an ordered list of executable instructions for implementing logical functions, and may be specifically implemented in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For purposes of this specification, "computer-readable medium" may be any device that can contain storage, communication, propagation or transmission of a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.

[0040] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.

[0041] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or a combination thereof: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0042] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.

[0043] The above-described embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the present invention. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the attached claims.

Claims

1. A method for detecting a local moving object, characterized in that: The method comprises: Acquire a surveillance video of the target area, and perform image extraction on the surveillance video to obtain a monitoring image of continuous frames; Performing a differential operation on images of adjacent frames to obtain a differential image; Determining whether there is a difference between images of adjacent frames according to the differential image; If there is a difference between the images of adjacent frames, each pixel point in the difference image is traversed to mark the foreground point and the background point in the difference image according to the traversal result to obtain a binary image; Connectivity analysis is performed on the binary image to obtain a target image containing a complete moving target.

2. The method for detecting a local moving object according to claim 1, characterized in that: The step of performing a differential operation on the images of adjacent frames to obtain a differential image comprises: The difference image is obtained according to the following formula: in, Represents the grayscale value of the pixel with coordinates (x, y) in the image of the nth frame, Represents the grayscale value of the pixel with coordinates (x, y) in the image of the n-1th frame, Represents the grayscale value of the pixel with coordinates (x, y) in the difference image.

3. The method for detecting a local moving object according to claim 2, characterized in that: The step of judging whether there is a difference between images of adjacent frames according to the differential image comprises: Determine whether there is a pixel in the differential image whose grayscale value is greater than a first preset grayscale threshold; If there is a pixel whose grayscale value is greater than a first preset grayscale threshold, it is determined that there is a difference between the images of adjacent frames; If there is a pixel whose grayscale value is less than or equal to the first preset grayscale threshold, it is determined that there is no difference between the images of adjacent frames.

4. The method for detecting a local moving object according to claim 3, characterized in that: If there is a difference between the images of adjacent frames, traversing each pixel point in the differential image to mark the foreground point and the background point in the differential image according to the traversal result to obtain a binary image comprises: The binary image is obtained according to the following formula: represents the gray value of the pixel with coordinates (x, y) in the binary image, and T represents the first preset gray threshold.

5. The method for detecting a local moving object according to claim 4, characterized in that: After the step of determining that there is no difference between images of adjacent frames if there is a pixel whose grayscale value is less than or equal to the first preset grayscale threshold, the following step is further performed: Determine whether there is a difference between the image of the nth frame and the image of the n+1th frame; If there is no difference, continue to extract images of two adjacent frames until it is determined that there is a difference between the images of the two adjacent frames.

6. The method for detecting a local moving object according to claim 5, characterized in that: The step of performing connectivity analysis on the binary image to obtain a target image containing a complete moving target comprises: Acquire a target area corresponding to the moving target according to the target image, and determine whether the target area is within a preset designated area; If the target area appears within the preset specified area, an alarm message will be issued.

7. A local moving object detection system, characterized in that: The system comprises: An image extraction module is used to obtain a surveillance video of a target area and perform image extraction on the surveillance video to obtain a surveillance image of continuous frames; A differential operation module, used for performing differential operation on images of adjacent frames to obtain a differential image; A difference judgment module, used for judging whether there is a difference between images of adjacent frames according to the differential image; An image binarization module is used for traversing each pixel point in the differential image if there is a difference between the images of adjacent frames, so as to mark the foreground points and background points in the differential image according to the traversal result to obtain a binary image; The connectivity module is used to perform connectivity analysis on the binary image to obtain a target image containing a complete moving target.

8. The local moving object detection system according to claim 7, characterized in that: The differential operation module is also used for: The difference image is obtained according to the following formula: in, Represents the grayscale value of the pixel with coordinates (x, y) in the image of the nth frame, Represents the grayscale value of the pixel with coordinates (x, y) in the image of the n-1th frame, Represents the grayscale value of the pixel with coordinates (x, y) in the difference image.

9. A storage medium, characterized in that: include: The storage medium stores one or more programs, which, when executed by a processor, implement the method for detecting a local moving object as described in any one of claims 1 to 6.

10. An electronic device, characterized in that: The electronic device comprises a memory and a processor, wherein: The memory is used to store computer programs; When the processor is used to execute the computer program stored in the memory, it implements the method for detecting a local moving object described in any one of claims 1-6.