Object detection method, device, terminal and computer-readable storage medium

Through the methods of background modeling and feature extraction and comparison, combined with the Fast-RCNN network model, the problem of low detection accuracy of legacy items is solved, and the accuracy of missing items is achieved is improved.

CN113869110BActive Publication Date: 2025-08-22ZHEJIANG DAHUA TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110964997.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-20
Publication Date
2025-08-22
Estimated Expiration
2041-08-20

AI Technical Summary

Technical Problem

In the prior art, the accuracy of detection of legacy items is low, resulting in loss of users' property.

Method used

The background modeling method is used to detect whether the current frame image contains the detection item, and by extracting and comparing the current frame image and the background image, verifying whether the foreground image is a detection item, and further judgement is made in combination with the Fast-RCNN network model, and finally identifying the item category.

Benefits of technology

It improves the accuracy of detection of legacy items, effectively avoids misinspection, and ensures the identification and recycling of lost items.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113869110B_ABST
    Figure CN113869110B_ABST
Patent Text Reader

Abstract

The present invention provides an object detection method, device, terminal and computer-readable storage medium. The object detection method includes: obtaining a current frame image; detecting the current frame image based on background modeling to determine whether the current frame image contains a detection object; extracting and comparing the features of the current frame image and the background image of the current frame image respectively to verify whether the detection object is the foreground image of the current frame image; if the detection object is the foreground image of the current frame image, then identifying the category of the detection object. The present application detects the detection object in the current frame image through background modeling, extracts features from the current frame image and the background image of the current frame image and then compares them to further determine whether the detection object is the foreground image of the current frame image, thereby effectively avoiding false detection of the detection object; when it is confirmed that the detection object is the foreground image of the current frame image, then identifying the category of the detection object, thereby improving the accuracy of the detection of leftover items.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image recognition technology, and in particular to an object detection method, device, terminal and computer-readable storage medium. Background Art

[0002] In daily life, people often leave behind items (cash, wallets, bank cards, etc.) when conducting business at public places such as ATMs (Automatic Teller Machines), security checkpoints, and hospital emergency rooms, which can cause serious financial losses. Therefore, if a system can detect left-behind items and generate relevant alarms, it can effectively prevent customers from losing money. Summary of the Invention

[0003] The main technical problem solved by the present invention is to provide an object detection method, device, terminal and computer-readable storage medium to solve the problem of low accuracy of left-behind object detection in the prior art.

[0004] To solve the above technical problems, the first technical solution adopted by the present invention is: to provide an object detection method, which includes: obtaining a current frame image; detecting the current frame image based on background modeling, and determining that the current frame image contains a detection object; performing feature extraction on the current frame image and the background image of the current frame image respectively and comparing them to determine the foreground image of the current frame image, and verifying whether the foreground image of the current frame image is the detection object; in response to the foreground image of the current frame image being the detection object, identifying the category of the detection object.

[0005] Among them, before the step of detecting the current frame image based on background modeling and determining whether the current frame image contains a detection object, it also includes: detecting whether there is a moving target in the current frame image; in response to the absence of a moving target in the current frame image, detecting whether there is a detection object in the current frame image.

[0006] Among them, the step of detecting the current frame image based on background modeling and determining whether the current frame image contains a detection object specifically also includes: determining the background image of the current frame image based on the historical video frames before the current frame image; detecting and comparing the current frame image and the background image based on background modeling to determine the detection object contained in the current frame image.

[0007] Among them, the step of determining the background image of the current frame image based on the historical video frames before the current frame image specifically includes: comparing the historical video frames within a preset time period with the current frame image; screening and retaining the historical video frames in which no detection objects are detected within the preset time period; selecting the historical video frame whose time is closest to the time of the current video frame from the retained historical video frames, and determining the selected historical video frame as the background image of the current frame image.

[0008] Among them, the steps of performing feature extraction on the current frame image and the background image of the current frame image respectively and comparing them to determine the foreground image of the current frame image, and verifying whether the foreground image of the current frame image is the detection object specifically include: performing feature extraction on the current frame image to obtain a detection feature map, and performing feature extraction on the background image of the current frame image to obtain a background feature map; comparing the detection feature map with the background feature map to determine the foreground image of the current frame image; judging whether the position of the foreground image of the current frame image in the current frame image is the same as the position of the detection object in the current frame image; if the positions are the same, verifying that the foreground image of the current frame image is the detection object.

[0009] Among them, before the step of respectively extracting features from the current frame image and the background image of the current frame image and comparing them to determine the foreground image of the current frame image, and verifying whether the foreground image of the current frame image is the detection object, the method also includes: extracting features from the detection object based on the Fast-RCNN network model to obtain a first feature map, and extracting features from the background image to obtain a second feature map; determining whether the first feature map is the same as the second feature map; if the first feature map is the same as the second feature map, deleting the detection object; if the first feature map is different from the second feature map, retaining the detection object.

[0010] Among them, the step of identifying the category of the detected object specifically includes: extracting a feature map of the detected object based on the position of the detected object; comparing the feature map of the detected object with a preset feature map of the object in the database; if the similarity between the feature map of the detected object and the preset feature map of the object is greater than a threshold, determining that the category of the preset feature map is the category corresponding to the detected object.

[0011] The step of identifying the category of the detected object further includes: displaying the category and location of the detected object and issuing an alarm.

[0012] In order to solve the above technical problems, the second technical solution adopted by the present invention is: to provide an object detection device, which includes: an image acquisition module for acquiring a current frame image; a first detection module for detecting the current frame image based on background modeling, and determining that the current frame image contains a detection object; a second detection module for performing feature extraction on the current frame image and the background image of the current frame image respectively and comparing them to determine the foreground image of the current frame image, and verifying whether the foreground image of the current frame image is the detection object; a processing module for identifying the category of the detection object in response to the foreground image of the current frame image being the detection object.

[0013] In order to solve the above technical problems, the third technical solution adopted by the present invention is: to provide a terminal, which includes a memory, a processor, and a computer program stored in the memory and running on the processor, and the processor is used to execute program data to implement the steps in the above-mentioned object detection method.

[0014] In order to solve the above technical problems, the fourth technical solution adopted by the present invention is: providing a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps in the above-mentioned object detection method are implemented.

[0015] The beneficial effects of the present invention are as follows: different from the prior art, a method, device, terminal and computer-readable storage medium for detecting an object are provided, wherein the method for detecting an object comprises: obtaining a current frame image; detecting the current frame image based on background modeling, and determining that the current frame image contains a detection object; performing feature extraction on the current frame image and the background image of the current frame image respectively and comparing them to determine the foreground image of the current frame image, and verifying whether the foreground image of the current frame image is the detection object; in response to the foreground image of the current frame image being the detection object, the category of the detection object is identified. The present application detects the detection object in the current frame image through background modeling, and after performing feature extraction on the current frame image and the background image of the current frame image, further compares them to further determine whether the detection object is the foreground image of the current frame image, thereby effectively avoiding false detection of the detection object; when it is confirmed that the detection object is the foreground image of the current frame image, it indicates that the detection object is the user's lost item, and it is necessary to identify the category of the detection object, thereby improving the accuracy of the detection of the left-behind items. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 1 is a flow chart of the object detection method provided by the present invention;

[0017] Figure 2 This is a flow chart of a specific embodiment of the object detection method provided by the present invention;

[0018] Figure 3 yes Figure 2 A flowchart of a specific embodiment of step S205 in the image capture method provided;

[0019] Figure 4 is a schematic diagram of a specific embodiment of the object detection method S209 provided by the present invention;

[0020] Figure 5 is a schematic diagram of a specific embodiment of the object detection method S210 provided by the present invention;

[0021] Figure 6 is a schematic diagram of another specific embodiment of the object detection method provided by the present invention;

[0022] Figure 7 is a schematic block diagram of the object detection device provided by the present invention;

[0023] Figure 8 is a schematic block diagram of an embodiment of a terminal provided by the present invention;

[0024] Figure 9 It is a schematic block diagram of an embodiment of a computer-readable storage medium provided by the present invention. DETAILED DESCRIPTION

[0025] The following describes the embodiments of the present application in detail with reference to the accompanying drawings.

[0026] In the following description, for the purpose of explanation rather than limitation, specific details such as specific system structures, interfaces, and technologies are provided to facilitate a thorough understanding of the present application.

[0027] The term "and / or" in this document simply describes a relationship between related objects, indicating that three possible relationships exist. For example, "A and / or B" can mean: A exists alone, A and B exist simultaneously, or B exists alone. Furthermore, the character " / " in this document generally indicates that the related objects are in an "or" relationship. Furthermore, "many" in this document means two or more than two.

[0028] In order to enable those skilled in the art to better understand the technical solution of the present invention, an object detection method provided by the present invention is further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0029] See also Figure 1 , Figure 1 This embodiment provides an object detection method, which is applicable to scenarios in public places such as ATM machines, security inspection machines, and hospital emergency rooms. The object detection method includes the following steps.

[0030] S11: Get the current frame image.

[0031] Specifically, the image acquisition device captures real-time images of the ATM countertop, security inspection station, or emergency room, and their surroundings. The scene in this embodiment is a fixed scene. For example, the image acquisition device can be a camera installed in the ATM environment, or a camera built into the ATM device can be used to capture real-time images. The current frame image can be solely of the ATM countertop, or it can be of the ATM countertop and the ground near the ATM.

[0032] S12: Detect the current frame image based on background modeling to determine whether the current frame image contains a detection object.

[0033] Specifically, it is necessary to first detect and determine whether a moving target exists in the current frame image. If no moving target exists in the current frame image, target detection is performed on the current frame image to determine whether a detection object is detected in the current frame image. If a moving target exists in the current frame image, detection is not performed on the current frame image. The image acquisition device needs to continue to capture the next frame image and perform detection on the next captured frame image. The moving target can be a natural person.

[0034] Perform target detection on the current frame image based on background modeling to determine the detection objects contained in the current frame image and the location information of the detection objects.

[0035] S13: extracting features from the current frame image and the background image of the current frame image respectively and comparing them to determine the foreground image of the current frame image, and verifying whether the foreground image of the current frame image is the detection object.

[0036] Specifically, the background image of the current frame image is determined based on the historical video frames before the current frame image. Feature extraction is performed on the current frame image to obtain a detection feature map, and feature extraction is performed on the background image of the current frame image to obtain a background feature map. The detection feature map and the background feature map are compared to determine the foreground image of the current frame image. It is determined whether the position of the foreground image of the current frame image in the current frame image is the same as the position of the detection object in the current frame image. If the positions are the same, the foreground image of the current frame image is verified to be the detection object.

[0037] S14: In response to the foreground image of the current frame image being a detection object, the category of the detection object is identified.

[0038] Specifically, a feature map of the detected item is extracted based on the location of the detected item; the feature map of the detected item is compared with a preset feature map of the item in the database; if the similarity between the feature map of the detected item and the preset feature map of the item is greater than a threshold, the category of the preset feature map of the item is determined to be the category corresponding to the detected item. In other optional embodiments, when the category of the detected item is identified, the detection result is uploaded and an alarm is issued. The detection result includes the current frame image, the category of the detected item, and the location. After confirming that there is any left behind, the branch staff goes to retrieve the left behind item. The left behind item may be an ID card, wallet, mobile phone, and / or other documents.

[0039] The object detection method provided by this embodiment includes: obtaining a current frame image; detecting the current frame image based on background modeling, and determining that the current frame image contains a detection object; extracting and comparing the features of the current frame image and the background image of the current frame image respectively, and verifying whether the detection object is the foreground image of the current frame image; if the detection object is the foreground image of the current frame image, then identifying the category of the detection object. This application detects the detection object in the current frame image through background modeling, and after extracting features from the current frame image and the background image of the current frame image, further compares and determines whether the detection object is the foreground image of the current frame image, thereby effectively avoiding false detection of the detection object; when it is confirmed that the detection object is the foreground image of the current frame image, it indicates that the detection object is the user's lost item, and it is necessary to identify the category of the detection object, thereby improving the accuracy of the detection of left-behind items.

[0040] See also Figure 2 , Figure 2 This is a flow chart of a specific embodiment of the object detection method provided by the present invention. This embodiment provides an object detection method suitable for use in public places such as ATMs, security inspection machines, and hospital emergency rooms. The object detection method includes the following steps.

[0041] S201: Acquire the current frame image.

[0042] Specifically, the image acquisition device captures real-time images of the ATM operating table, security inspection station, or emergency room, and their surroundings. The scene in this embodiment is a fixed scene. The image acquisition device is a camera installed within the ATM environment, but a built-in camera on the ATM device can also be used to capture real-time images. The current frame image can be solely of the ATM operating table, or it can be of the ATM operating table and the ground near the ATM. In one specific embodiment, the current frame image can be a color image. After acquiring the current frame image, it is necessary to pre-process the current frame image, i.e., grayscale the captured color image before subsequent detection and recognition.

[0043] S202: Detect whether there is a moving target in the current frame image.

[0044] Specifically, since the image acquisition device in this embodiment is applied to a fixed scene, after the image acquisition device acquires the current frame image, the current frame image and the adjacent previous frame image are subjected to adjacent frame differential calculation. Specifically, the grayscale difference between the current frame image and the adjacent previous frame image is calculated, and the absolute value of the grayscale difference between the two frames is obtained. It is determined which parts of the current frame image and the adjacent previous frame image have an absolute value of the grayscale difference greater than a set threshold, and which parts have an absolute value of the grayscale difference less than the set threshold. Compared with the adjacent previous frame image, the part of the current frame image whose absolute value of the grayscale difference is greater than the set threshold is considered a moving target, thereby realizing the detection of the moving target in the current frame image. In another optional embodiment, the current frame image can also be compared with two frames in the historical video frames that are acquired closer in time, which can improve the detection accuracy of the moving target.

[0045] In other optional embodiments, a target in the current frame image is detected, and the detected target is compared with a preset moving target. If the detected target is the same as the preset moving target, the detected target can be directly determined to be the preset moving target. The preset moving target is a natural person.

[0046] If a moving object is detected in the current image frame, detection of the detection object in the current image frame ceases. Since a moving object is present in the current image frame, the object to be detected in the current image frame is a moving object, indicating that the object to be detected is not a lost item. The process then directly jumps to step S204, where the image acquisition device acquires the next image frame and performs detection on the next image frame. If no moving object is detected in the current image frame, the process directly jumps to step S203.

[0047] S203: Detect whether there is a detection object in the current frame image.

[0048] Specifically, target detection is performed on the current frame image based on background modeling to determine the detection target contained in the current frame image. The detection target is compared with a pre-stored preset target to determine whether the detection target is the same as the preset target. If they are the same, the detection target is determined to be a detection item. Target detection is performed on the current frame image based on background modeling, and location information of the detection target contained in the current frame image is also determined. If the detection target is determined to be a detection item, the location information of the detection target is the location information of the detection item. The process then directly jumps to step S205.

[0049] S204: Acquire the next frame of image.

[0050] Specifically, when a moving object is detected in the current frame image, the detection of whether the detection object exists in the current frame image is stopped, and the next frame image is acquired by the image acquisition device. After the image is acquired, the process directly jumps to step S202.

[0051] S205: Determine a background image of the current frame image according to historical video frames before the current frame image.

[0052] Specifically, see Figure 3 , Figure 3 yes Figure 2 The process of determining the background image of the current frame image in the historical video frames before the current frame image according to the current frame image is shown in the flowchart of a specific embodiment of the image capture method.

[0053] S2051: Extract features from historical video frames within a preset time period and compare them with the current frame image.

[0054] Specifically, multiple historical video frames within a preset time period are selected from the historical video frames before the current frame image. A target detection model based on a deep learning framework performs feature extraction on the current frame image, and also performs feature extraction on the multiple historical video frames within the selected preset time period. The feature map extracted from the current frame image is compared one by one with the feature maps extracted from the historical video frames, and it is determined which feature maps extracted from the historical video frames do not contain detected objects relative to the feature map extracted from the current frame image, and which feature maps extracted from the historical video frames contain detected objects relative to the feature map extracted from the current frame image.

[0055] S2052: Filter and retain historical video frames in which no detection object is detected within a preset time period.

[0056] Specifically, all historical video frames in which no detection objects are found are filtered out, that is, the filtered historical video frames in which no detection objects are found are compared with the current frame image, the filtered historical video frames in which no detection objects are found are retained, and the historical video frames in which detection objects are found are removed.

[0057] S2053: Select a historical video frame with the shortest time interval between the historical video frames and the current frame image from among the retained historical video frames, and determine the selected historical video frame as the background image.

[0058] Specifically, the capture time of the retained historical video frames is compared with the capture time of the current frame, and the closest historical video frame to the current frame is selected as the background image. This is to reduce errors and avoid situations where the current frame and the background image differ only in the detected object, thereby improving subsequent detection accuracy.

[0059] S206: performing feature extraction on the current frame image to obtain a detection feature map, and performing feature extraction on the background image of the current frame image to obtain a background feature map.

[0060] Specifically, a convolutional neural network is used to extract features from the current frame image and the background image of the current frame image, respectively. Feature extraction is performed on the current frame image to obtain a detection feature map, and feature extraction is performed on the background image of the current frame image to obtain a background feature map.

[0061] S207: Compare the detection feature map with the background feature map to determine the foreground image of the current frame image.

[0062] Specifically, the extracted detection feature map and background feature map are subjected to image difference processing to distinguish the similar parts from the different parts in the detection feature map and the background feature map, thereby achieving a comparison between the detection feature map and the background feature map. By comparing the detection feature map with the background feature map, the differences between the detection feature map and the background feature map can be highlighted.

[0063] S208: Determine whether the position of the foreground image of the current frame image in the current frame image is the same as the position of the detected object in the current frame image.

[0064] Specifically, after comparing the detection feature map with the background feature map, determine whether the preset position of the detection feature map is different from the corresponding position of the background image. If there is a difference between the preset position of the detection feature map and the corresponding position of the background image, jump directly to step S209; if the preset position of the detection feature map is the same as the corresponding position of the background image, that is, there is no difference, jump directly to step S204.

[0065] S209: Verify whether the foreground image of the current frame image is the detection object.

[0066] Specifically, when it is determined that the preset position of the detection feature map is different from the corresponding position of the background image, it is determined that there is a detection object at the preset position of the detection feature map, which further verifies that the detection object is the difference between the current image and the current frame image, and then determines that the detection object is the foreground image of the current frame image.

[0067] In an optional embodiment, the detection items obtained by background modeling can be screened first to avoid false detection, and then the foreground image can be determined and further verified. Specifically, the detection items can be feature extracted based on the Fast-RCNN (Region with CNN feature) network model to obtain a first feature map, and the background image can be feature extracted to obtain a second feature map; determine whether the first feature map is the same as the second feature map; if the first feature map is the same as the second feature map, it indicates that the detection item belongs to the background image, and the detection item needs to be deleted; if the first feature map is different from the second feature map, it indicates that the detection item is different from the background image, and the detection item needs to be retained. This step verifies the accuracy of the detection result obtained by detecting the current frame image based on background modeling, thereby avoiding false detection due to other interference factors such as shadows and lighting, and improving the detection accuracy of lost items.

[0068] See also Figure 4 , Figure 4 Schematic diagram of a specific embodiment of the object detection method S209 provided by the present invention. In one specific embodiment, the current frame image and the background image are detected based on background modeling to determine the detection object in the current frame image; the foreground image of the current frame image is determined by extracting and comparing features of the current frame image and the background image respectively; and whether the position of the foreground image in the current frame image is the same as the position of the detection object in the current frame image is determined to verify whether the foreground image in the current frame image is the detection object. If the position of the foreground image in the current frame image is the same as the position of the detection object in the current frame image, the foreground image of the current frame image is verified to be the detection object; if the position of the foreground image in the current frame image is different from the position of the detection object in the current frame image, the foreground image of the current frame image is verified not to be the detection object, thereby avoiding false detection and improving detection accuracy.

[0069] In an optional embodiment, when it is determined that the detected object is the foreground image of the current frame image, the current frame image is updated to the background image, and the current frame image becomes the background image of the next frame image.

[0070] S210: Identify the category of the detected object.

[0071] Specifically, a feature map of the detected object is obtained based on the position of the detected object; the feature map of the detected object is compared with the preset feature maps of the object in the database. Figure 5 , Figure 5This is a schematic diagram of a specific embodiment of the object detection method S210 provided by the present invention. To reduce errors, the similarity between the detected object feature map in the current frame image and each preset object feature map in the database can be calculated. If the similarity between the detected object feature map and the preset object feature map exceeds a threshold, the category of the preset object feature map is determined to be the category corresponding to the detected object. The preset threshold can be set to 99%. By comparing similarities, detailed object information can be effectively extracted while significantly reducing the data volume required, enabling the identification of the category of items left behind in ATM environments.

[0072] S211: Display the category and location of the detected object and issue an alarm.

[0073] Specifically, when the type of detected object is identified, the detection result is uploaded and an alarm is issued. The detection result includes the current frame image, the type of detected object, and its location. After confirming that the item is left behind, the branch staff will go to retrieve the item and claim it. The left-behind item can be an ID card, wallet, mobile phone, and / or other documents.

[0074] See also Figure 6 , Figure 6 The figure is a schematic diagram of another specific embodiment of the object detection method provided by the present invention. In one specific embodiment, a video frame is captured by an image acquisition device, and the presence of a natural person in the video frame is detected and determined. If a natural person is present in the video frame, detection of the detection object in the video frame ceases. Because a natural person is present in the video frame, the object to be detected in the video frame is a natural person, indicating that the object to be detected is not a lost object. The image acquisition device then acquires the next image frame and performs detection on the next image frame. When it is detected that there is no moving target in the video frame, the video frame is detected using background modeling to determine the detection object contained in the video stream. Feature extraction is performed on the video frame and the background image to determine the foreground image of the video frame. The foreground image of the video frame is verified to be the detection object based on the Fast-RCNN network model. When the foreground image in the video frame is detected to be the detection object, the detection object is compared with each preset object in the database and the similarity is calculated. If the similarity between the detection object and the preset object is greater than a threshold, the category of the preset object is determined to be the category corresponding to the detection object. When the detected object is determined to be the foreground image of the video frame, the video frame is updated to the background image, and the video frame becomes the background image of the next frame. When the category of the detected object is identified, the detection result is sent to the upper layer and an alarm is issued.

[0075] The object detection method provided by this embodiment includes: obtaining a current frame image; detecting the current frame image based on background modeling, and determining that the current frame image contains a detection object; extracting and comparing the features of the current frame image and the background image of the current frame image respectively, and verifying whether the detection object is the foreground image of the current frame image; if the detection object is the foreground image of the current frame image, then identifying the category of the detection object. This application detects the detection object in the current frame image through background modeling, and after extracting features from the current frame image and the background image of the current frame image, further compares and determines whether the detection object is the foreground image of the current frame image, thereby effectively avoiding false detection of the detection object; when it is confirmed that the detection object is the foreground image of the current frame image, it indicates that the detection object is the user's lost item, and it is necessary to identify the category of the detection object, thereby improving the accuracy of the detection of left-behind items.

[0076] See Figure 7 , Figure 7 This embodiment provides an object detection device 60 , which includes an image acquisition module 61 , a first detection module 62 , a second detection module 63 and a processing module 64 .

[0077] The image acquisition module 61 is used to acquire the current frame image.

[0078] The first detection module 62 is used to detect the current frame image based on background modeling and determine whether the current frame image contains a detection object.

[0079] The second detection module 63 is used to extract features from the current frame image and the background image of the current frame image respectively and compare them to determine the foreground image of the current frame image, and verify whether the foreground image of the current frame image is a detection object.

[0080] The processing module 64 is configured to identify the category of the detected object in response to the foreground image of the current frame image being the detected object.

[0081] The present application detects the detection object in the current frame image through the first detection module, and then uses the second detection module to extract features from the current frame image and the background image of the current frame image and then compare them, and further determines whether the detection object is the foreground image of the current frame image, thereby effectively avoiding false detection of the detection object; when it is confirmed that the detection object is the foreground image of the current frame image, it indicates that the detection object is the user's lost item, and the processing module is required to identify the category of the detection object, thereby improving the accuracy of the detection of left-behind items.

[0082] See Figure 8 , Figure 8This is a schematic block diagram of an embodiment of a terminal provided by the present invention. Terminal 70 in this embodiment includes a processor 71, a memory 72, and a computer program stored in memory 72 and executable by processor 71. When executed by processor 71, this computer program implements the aforementioned object detection method. To avoid repetition, detailed descriptions are omitted here.

[0083] See Figure 9 , Figure 9 It is a schematic block diagram of an embodiment of a computer-readable storage medium provided by the present invention.

[0084] In an embodiment of the present application, a computer-readable storage medium 90 is further provided. The computer-readable storage medium 90 stores a computer program 901. The computer program 901 includes program instructions. The processor executes the program instructions to implement the object detection method provided in the embodiment of the present application.

[0085] The computer-readable storage medium 90 may be an internal storage unit of the computer device described in the aforementioned embodiment, such as a hard disk or memory of the computer device. The computer-readable storage medium 90 may also be an external storage device of the computer device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash memory card, etc.

[0086] The above are merely embodiments of the present invention and are not intended to limit the scope of patent protection of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention's description and drawings, or directly or indirectly applied in other related technical fields, are also included in the scope of patent protection of the present invention.

Claims

1. A method for detecting an object, characterized in that: The object detection method comprises: Get the current frame image; Detecting whether there is a moving target in the current frame image; If the moving target does not exist in the current frame image, detecting the current frame image based on background modeling to determine whether the current frame image contains a detection object; performing feature extraction on the current frame image and the background image of the current frame image respectively and comparing them to determine the foreground image of the current frame image, and verifying whether the foreground image of the current frame image is the detection object; In response to the foreground image of the current frame image being the detection object, the category of the detection object is identified.

2. The object detection method according to claim 1, characterized in that: The step of detecting the current frame image based on background modeling and determining that the current frame image contains a detection object specifically further includes: Determining a background image of the current frame image in historical video frames before the current frame image according to the current frame image; The current frame image and the background image are detected and compared based on background modeling to determine the detection object contained in the current frame image.

3. The object detection method according to claim 2, characterized in that: The step of determining the background image of the current frame image in the historical video frames before the current frame image according to the current frame image specifically includes: Comparing the historical video frames within a preset time period with the current frame image; Filtering and retaining the historical video frames in which the detection object is not detected within the preset time period; The historical video frame whose time is closest to the time of the current video frame is selected from the retained historical video frames, and the selected historical video frame is determined as the background image of the current frame image.

4. The object detection method according to claim 3, characterized in that: The step of extracting features from the current frame image and the background image of the current frame image respectively and comparing them to determine the foreground image of the current frame image, and verifying whether the foreground image of the current frame image is the detected object specifically includes: Performing feature extraction on the current frame image to obtain a detection feature map, and performing feature extraction on the background image of the current frame image to obtain a background feature map; Comparing the detection feature map with the background feature map to determine the foreground image of the current frame image; determining whether a position of a foreground image of the current frame image in the current frame image is the same as a position of the detected object in the current frame image; If the positions are the same, it is verified that the foreground image of the current frame image is the detected object.

5. The object detection method according to claim 4, characterized in that: Before the step of extracting features from the current frame image and the background image of the current frame image respectively and comparing them to determine the foreground image of the current frame image, and verifying whether the foreground image of the current frame image is the detected object, the step further includes: Extracting features of the detected object based on the Fast-RCNN network model to obtain a first feature map, and extracting features of the background image to obtain a second feature map; Determining whether the first characteristic map is the same as the second characteristic map; If the first characteristic map is the same as the second characteristic map, deleting the detected object; If the first characteristic pattern is different from the second characteristic pattern, the detected object is retained.

6. The object detection method according to claim 1, characterized in that: The step of identifying the category of the detected object specifically includes: Extracting a detection object feature map based on the position of the detection object; Comparing the detected object characteristic map with preset object characteristic maps in a database; If the similarity between the detected object feature map and the preset object feature map is greater than a threshold, the category of the preset object feature map is determined to be the category corresponding to the detected object.

7. The object detection method according to claim 1, characterized in that: After the step of identifying the category of the detected object, the method further includes: Display the category and location of the detected object and issue an alarm.

8. An object detection device, characterized in that: The object detection device comprises: Image acquisition module, used to obtain the current frame image; A first detection module is configured to detect whether there is a moving target in the current frame image; if the moving target does not exist in the current frame image, detect the current frame image based on background modeling to determine whether the current frame image contains a detection object; a second detection module, configured to extract features from the current frame image and the background image of the current frame image respectively, and compare and determine the foreground image of the current frame image, and verify whether the foreground image of the current frame image is the detection object; A processing module is configured to identify a category of the detected object in response to a foreground image of the current frame image being the detected object.

9. A terminal, characterized in that: The terminal includes a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor is configured to execute the program data to implement the steps of the object detection method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the object detection method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Remaining object error detection recognition method and device and image processing equipment

    CN111832349A