Target detection method, device and system, computer equipment and storage medium

By obtaining the difference information between the target image and the image to be detected, and re-verification of the image to be detected, the problem of low accuracy in traditional target detection technology when detecting small target objects is solved, and higher detection accuracy and stability are achieved.

CN120147597APending Publication Date: 2025-06-13SHENZHEN LUMIUNITED TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510202749.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-24
Publication Date
2025-06-13

AI Technical Summary

Technical Problem

Traditional target detection technology has low accuracy when detecting small target objects and is prone to missed detection, resulting in unstable detection results.

Method used

By obtaining the difference information between the target object image and the image to be detected, the target object image is used to verify the image to be detected to determine whether the target object is included in the image to be detected.

Benefits of technology

It improves the accuracy and stability of target detection, reduces missed detection, and ensures the reliability of detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120147597A_ABST
    Figure CN120147597A_ABST
Patent Text Reader

Abstract

The invention relates to a target detection method and device, computer equipment, a storage medium and a computer program product. The method comprises the following steps: acquiring a target object image, and acquiring a to-be-detected image corresponding to the target object image; the target object image represents an image extracted for the target object from target images containing the target object; the to-be-detected image represents that the shooting time is behind the target object image, and the image of which the target object is not detected is preliminarily judged; according to the target object image, target detection processing for the target object is carried out on the to-be-detected image, a target detection result of the target object is obtained, and the target detection result is used for representing whether the to-be-detected image contains the target object or not. By adopting the method, the stability and accuracy of target object detection can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technologies, and particularly to an object detection method, device, system, computer device, storage medium, and computer program product. Background Art

[0002] With the development of artificial intelligence technologies, many smart home products have functions such as package detection and express delivery monitoring, such as smart door locks, smart doorbells, and smart cameras and other smart home products.

[0003] In traditional technologies, objects are often detected through models built based on machine learning and deep learning, and the detection results of the models are used as the final judgment criteria. However, the detection results of the models are not 100% accurate. Especially for some small-sized objects, such as packages, the models are prone to failing to detect small packages in images, resulting in missed detection of packages and a decrease in the accuracy of object detection results. Summary of the Invention

[0004] Based on this, it is necessary to provide an object detection method, device, system, computer device, computer-readable storage medium, and computer program product that can improve the accuracy of object detection results for the above technical problems.

[0005] In a first aspect, the present application provides an object detection method. The method includes:

[0006] Obtain an object image and obtain a to-be-detected image corresponding to the object image; the object image represents an image extracted from an object image containing an object for the object; the to-be-detected image represents an image whose shooting time is after the object image and in which it is initially determined that the object is not detected.

[0007] Perform object detection processing on the to-be-detected image for the object according to the object image to obtain an object detection result of the object, where the object detection result is used to represent whether the to-be-detected image contains the object.

[0008] In one embodiment, obtaining an object image includes:

[0009] Input the collected image into an object detection model to obtain a first detection result for the object; the object detection model is trained based on sample images associated with the object; the first detection result contains detection information for the object.

[0010] If the first detection result indicates that the acquired image contains the target object, determine the acquired image as the target image, and extract the target object image corresponding to the position information from the target image according to the position information of the target object in the first detection result.

[0011] In one embodiment, obtaining the image to be detected corresponding to the target object image includes:

[0012] Obtain the next frame of image; the next frame of image represents the image acquired after the target object image;

[0013] Input the next frame of image into the target detection model to obtain a second detection result for the target object; the second detection result includes preliminary judgment information for the target object;

[0014] If the second detection result indicates that it is preliminarily determined that the next frame of image does not contain the target object, extract the image to be detected corresponding to the position information from the next frame of image according to the position information corresponding to the target object image.

[0015] In one embodiment, performing target detection processing on the image to be detected for the target object according to the target object image to obtain the target detection result of the target object includes:

[0016] Determine the image difference information between the image to be detected and the target object image;

[0017] Determine the target detection result of the target object according to the image difference information.

[0018] In one embodiment, the image difference information includes pixel difference information between the pixels in the target object image and the pixels in the image to be detected;

[0019] The determining the target detection result of the image to be detected according to the image difference information includes:

[0020] Filter out target pixels whose pixel difference information exceeds a preset difference threshold;

[0021] Determine the target detection result of the image to be detected according to the number of the target pixels.

[0022] In one embodiment, the determining the target detection result of the image to be detected according to the number of the target pixels includes:

[0023] If the number of the target pixels exceeds a preset number threshold, determine that the target detection result indicates that the target object is not detected in the image to be detected;

[0024] If the number of the target pixels does not exceed the preset number threshold, it is determined that the target detection result indicates that the target object is detected in the image to be detected, and the target object image is updated to the image to be detected.

[0025] In one embodiment, after inputting the next frame of image into the target detection model to obtain a second detection result for the target object, it further includes:

[0026] If the second detection result indicates that it is preliminarily determined that the next frame of image contains the target object, according to the position information of the target object in the second detection result, a local image for the target object is extracted from the next frame of image, and the target object image is updated to the local image;

[0027] Alternatively, if the second detection result indicates that it is preliminarily determined that the next frame of image contains the target object, jump to the step of obtaining the next frame of image.

[0028] In a second aspect, the present application further provides a target detection device. The device includes:

[0029] An image acquisition module, configured to acquire a target object image and an image to be detected corresponding to the target object image; the target object image represents an image extracted for the target object from a target image containing the target object; the image to be detected represents an image whose shooting time is after the target object image and is preliminarily determined not to detect the target object;

[0030] A target detection module, configured to perform target detection processing on the image to be detected for the target object according to the target object image, and obtain a target detection result of the target object, where the target detection result is used to indicate whether the image to be detected contains the target object.

[0031] In a third aspect, the present application further provides a target detection system. The system includes: a shooting device and a server;

[0032] The shooting device is configured to collect an image of a target scene and send it to the server;

[0033] The server is configured to determine a target object image and a to-be-detected image corresponding to the target object image from the received images; the target object image represents an image extracted for the target object from a target image containing the target object; the to-be-detected image represents an image whose shooting time is after the target object image and is initially determined not to detect the target object; perform target detection processing for the target object on the to-be-detected image according to the target object image, to obtain a target detection result of the target object, where the target detection result is used to represent whether the to-be-detected image contains the target object.

[0034] In a fourth aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0035] Obtain a target object image, and obtain a to-be-detected image corresponding to the target object image; the target object image represents an image extracted for the target object from a target image containing the target object; the to-be-detected image represents an image whose shooting time is after the target object image and is initially determined not to detect the target object;

[0036] Perform target detection processing for the target object on the to-be-detected image according to the target object image, to obtain a target detection result of the target object, where the target detection result is used to represent whether the to-be-detected image contains the target object.

[0037] In a fifth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, and when the computer program is executed by a processor, the following steps are implemented:

[0038] Obtain a target object image, and obtain a to-be-detected image corresponding to the target object image; the target object image represents an image extracted for the target object from a target image containing the target object; the to-be-detected image represents an image whose shooting time is after the target object image and is initially determined not to detect the target object;

[0039] Perform target detection processing for the target object on the to-be-detected image according to the target object image, to obtain a target detection result of the target object, where the target detection result is used to represent whether the to-be-detected image contains the target object.

[0040] In a sixth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0041] Obtain a target object image and obtain a to-be-detected image corresponding to the target object image; the target object image represents an image extracted from a target image containing the target object for the target object; the to-be-detected image represents an image whose shooting time is after the target object image and is initially judged not to detect the target object.

[0042] According to the target object image, perform target detection processing on the to-be-detected image for the target object to obtain a target detection result of the target object, and the target detection result is used to represent whether the to-be-detected image contains the target object.

[0043] The above-mentioned target detection method, device, system, computer device, storage medium and computer program product obtain a target object image and obtain a to-be-detected image corresponding to the target object image; the target object image represents an image extracted from a target image containing the target object for the target object; the to-be-detected image represents an image whose shooting time is after the target object image and is initially judged not to detect the target object; according to the target object image, perform target detection processing on the to-be-detected image for the target object to obtain a target detection result of the target object, and the target detection result is used to represent whether the to-be-detected image contains the target object. By using this method, after extracting the target object image from the target image containing the target object, if a to-be-detected image that is initially judged not to detect the target object is obtained, then use the target object image to verify again whether the to-be-detected image contains the target object, so as to obtain a more accurate target detection result, rather than directly using the initial judgment result to confirm that the to-be-detected image does not contain the target object, effectively solving the problem of occasional missed detection when detecting the target object in the traditional technology, thereby greatly improving the stability and accuracy of target object detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 It is an application environment diagram of the target detection method in an embodiment;

[0045] Figure 2 It is a flowchart of the target detection method in an embodiment;

[0046] Figure 3 It is a flowchart of the steps of obtaining a to-be-detected image corresponding to the target object image in an embodiment;

[0047] Figure 4 It is a flowchart of the target detection method in another embodiment;

[0048] Figure 5 It is a flowchart of the target detection method in yet another embodiment;

[0049] Figure 6 It is a structural block diagram of the target detection device in an embodiment;

[0050] Figure 7 It is the internal structure diagram of a computer device in an embodiment. Specific implementation manners

[0051] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0052] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with relevant regulations.

[0053] The object detection method provided by the embodiment of the present application can be applied to an application environment as Figure 1 shown. Among them, the application environment may be a smart home system, and the smart home system may include: a router, a gateway, a terminal 101 (such as a mobile phone, a tablet computer, a laptop computer), a server 102, multiple shooting devices 103 (such as a camera, a smart door lock, a smart door eye), etc. In the smart home system, the shooting device 103 can be connected to the gateway through ZIGBEE / Bluetooth / WiFi, and the gateway and the user terminal can be respectively connected to the router through WiFi. In addition, the terminal 101 can also establish a network connection with the server 102 through 2G / 3G / 4G / 5G, WiFi, etc., so as to obtain the data sent by the server 102.

[0054] Among them, the terminal 101 is used to provide local services for users. The server 102 can be implemented by an independent server or a server cluster composed of multiple servers, or can also be implemented by a cloud server. The shooting device 103 refers to a device with an image shooting function.

[0055] In an exemplary embodiment, an image is collected by a photographing device 103 and transmitted to a server 102 in real time. The server 102 analyzes and processes the image to obtain a target object image and a to-be-detected image corresponding to the target object image; the target object image represents an image extracted from a target image containing the target object for the target object; the to-be-detected image represents an image whose shooting time is after the target object image and is initially determined not to detect the target object; according to the target object image, target detection processing for the target object is performed on the to-be-detected image to obtain a target detection result of the target object, and the target detection result is used to represent whether the to-be-detected image contains the target object. In addition, the server 102 can also send the target detection result to a terminal 101.

[0056] In another exemplary embodiment, an image is collected by a photographing device 103, and the image can also be analyzed and processed by a processor carried in the photographing device 103 to obtain a target object image and a to-be-detected image corresponding to the target object image; the target object image represents an image extracted from a target image containing the target object for the target object; the to-be-detected image represents an image whose shooting time is after the target object image and is initially determined not to detect the target object; according to the target object image, target detection processing for the target object is performed on the to-be-detected image to obtain a target detection result of the target object, and the target detection result is used to represent whether the to-be-detected image contains the target object. Then, the photographing device 103 sends the target detection result to the terminal 101.

[0057] In one embodiment, as Figure 2 shown, a target detection method is provided. Taking the method applied to the Figure 1 server as an example for illustration, the method includes the following steps:

[0058] Step S201, obtain a target object image and a to-be-detected image corresponding to the target object image; the target object image represents an image extracted from a target image containing the target object for the target object; the to-be-detected image represents an image whose shooting time is after the target object image and is initially determined not to detect the target object.

[0059] Among them, the target image refers to an image taken at an earlier time and detected to contain the target object.

[0060] Among them, the to-be-detected image refers to an image taken at a later time and initially detected not to contain the target object. It should be noted that the to-be-detected image and the target object image can be partial images cropped from the image, and the position of the to-be-detected image in the image is the same as the position of the target object image in the image.

[0061] Among them, the target object refers to the object to be recognized. For example, the target object can be an express package, a human body, or other objects. Then the target image can be an image containing an express package.

[0062] Specifically, an image of the monitored environment (such as the entrance) is collected by a photographing device. Each image also carries a timestamp indicating the shooting time. The photographing device can transmit the collected image and its timestamp to the server in real time. The server determines a target image containing the target object from the received images, extracts a target object image for the target object from the target image. If an image in which it is preliminarily determined that the target object is not detected appears in the images taken after the target image, a to-be-detected image corresponding to the target object image can be extracted from the image in which it is preliminarily determined that the target object is not detected.

[0063] For example, after detecting that the target object appears in the environment monitored by the photographing device, it will continue to detect whether the target object is still in the environment. If it is preliminarily detected that the target object is not in the image, it indicates that the target object may have left the environment or the preliminary detection result may be incorrect. To further verify whether the target object is still in the environment, a to-be-detected image can be extracted from the image in which it is preliminarily determined that the target object is not detected, and then the target object image obtained earlier is used to check again whether the to-be-detected image contains the target object, so as to obtain the target detection result of the target object.

[0064] Step S202: Perform target detection processing for the to-be-detected image for the target object according to the target object image, and obtain the target detection result of the target object. The target detection result is used to indicate whether the to-be-detected image contains the target object.

[0065] Among them, the target detection result refers to the result of detecting again whether the target object is in the image.

[0066] Specifically, the server takes the target object image as a reference and analyzes and judges again whether the to-be-detected image contains the target object to avoid incorrect preliminary judgment results. For example, it can be by comparing the degree of difference (or similarity) between the target object image and the to-be-detected image to obtain the change situation between the target object-free image and the to-be-detected image, and then confirm whether the to-be-detected image contains the target object according to the magnitude of the change degree, and output the target detection result of the target object. In practical applications, if the degree of change is large, it can indicate that the target object is not in the to-be-detected image. If the degree of change is small, it can indicate that the target object is still in the to-be-detected image. Furthermore, the server can also send the target detection result to the terminal to remind the user of the coming and going of the target object in the monitored environment.

[0067] In the above object detection method, an object image is obtained, and a to-be-detected image corresponding to the object image is obtained; the object image represents an image extracted from an object image containing the object for the object; the to-be-detected image represents an image whose shooting time is after the object image and is initially judged not to detect the object; according to the object image, target detection processing for the object is performed on the to-be-detected image to obtain the target detection result of the object, and the target detection result is used to represent whether the to-be-detected image contains the object. By using this method, after extracting the object image from the object image containing the object, if a to-be-detected image that is initially judged not to detect the object is obtained, the object image is used to verify again whether the to-be-detected image contains the object, thereby obtaining a more accurate target detection result, rather than directly using the initial judgment result to confirm that the to-be-detected image does not contain the object, effectively solving the problem of occasional missed detection when detecting the object in the traditional technology, thus greatly improving the stability and accuracy of object detection.

[0068] In one embodiment, step S201 above, obtaining the object image, specifically includes the following content: inputting the collected image into the object detection model to obtain a first detection result for the object; the object detection model is trained based on sample images associated with the object; the first detection result contains detection information for the object; if the first detection result represents that the collected image contains the object, determining the collected image as the object image, and extracting the object image corresponding to the position information from the object image according to the position information of the object in the first detection result.

[0069] Among them, the object detection model refers to an intelligent model constructed based on the object detection algorithm. The object detection model is used to initially judge whether the input image contains the object.

[0070] Among them, the detection information in the first detection result is used to indicate whether the image contains the object and / or indicate the position information of the object in the image.

[0071] Specifically, the server can pre-collect sample images containing the object and sample images not containing the object. The server can use the sample images and their image labels to perform iterative training on the detection model to be trained, and use the trained model as the object detection model; or, the server can also use the sample images and their image labels to perform fine-tuning processing on the pre-trained detection model, and use the fine-tuned model as the object detection model; among them, the image label is used to indicate whether the sample image contains the object.

[0072] The server inputs the acquired image into the target detection model to preliminarily determine whether the target object is included in the image through the target detection model, and outputs the first detection result for the target object. If the first detection result indicates that the input image contains the target object, that is, it indicates that the target object appears for the first time in the scene during this period, the server can set the image as the target image. Moreover, the server can also perform image extraction processing on the image corresponding to the position information indicated in the first detection result in the target image, and then the server obtains the partial image of the target object in the target image, that is, the target object image; the server records (or stores) the target object image and the position information corresponding to the target object image. If the first detection result indicates that the input image does not contain the target object, that is, it indicates that the target object does not appear in the scene, the server can continue to input the next acquired image into the target detection model to preliminarily determine whether the next image contains the target object.

[0073] In this embodiment, the target detection model is used to perform preliminary detection on the acquired image for the target object to obtain the first detection information for the target object. If the first detection information indicates that the input image does not contain the target object, continue to use the target detection model to detect the next acquired image; if the first detection information indicates that the input image contains the target object, the input image can be set as the target image, and the target object image can be extracted from the target image and the position information of the target object image can be recorded, providing a processing basis for subsequent steps such as obtaining the image to be detected and verifying the image to be detected again.

[0074] In one embodiment, as Figure 3 shown, the above step S201 of obtaining the image to be detected corresponding to the target object image specifically includes the following contents:

[0075] Step S301, obtain the next frame of image; the next frame of image represents the image acquired after the target object image.

[0076] Specifically, after the server obtains the target object image, it will continue to perform preliminary detection on the subsequent images for the target object. In addition, in addition to collecting images, the imaging device can also collect the video of the monitored environment and transmit the video to the server; the server analyzes each frame of the video frame by frame. For example, after detecting that a certain frame of the video contains the target object and extracting the target object image from the frame, it can also obtain the next frame of image to continue the preliminary detection for the target object.

[0077] For example, assume that the server receives a 5s video sent by a shooting device, and this 5s video contains 5 frames of images in total. Then the server can perform preliminary detection and judgment on the target for these 5 frames of images in sequence. If the server does not detect the target in the first frame of the image but detects the target in the second frame of the image, then the second frame of the image can be set as the target image, and the target object image can be extracted from the second frame of the image; then, the server can continue to perform preliminary detection on the target for the third frame of the image until the last frame of the image is detected.

[0078] Step S302: Input the next frame of the image into the target detection model to obtain a second detection result for the target object; the second detection result includes preliminary judgment information for the target object.

[0079] Among them, the preliminary judgment information in the second detection result is used to indicate whether the next frame of the image contains the target object, and / or indicate the position information of the target object in the next frame of the image.

[0080] Specifically, the server inputs the next frame of the image into the target detection model to preliminarily judge whether the next frame of the image contains the target object through the target detection model, and outputs a second detection result for the target object.

[0081] Step S303: If the second detection result indicates that the next frame of the image is preliminarily judged not to contain the target object, then according to the position information corresponding to the target object image, extract the image to be detected corresponding to the position information from the next frame of the image.

[0082] Among them, the position information is used to characterize the specific position of the local image (such as the target object image, the image to be detected) in the corresponding entire image. The position information can be represented by coordinate positions. For example, the position information can be (x, y) or (x, y, w, h).

[0083] Specifically, if the second detection result indicates that the input next frame of the image does not contain the target object, that is, it indicates that the target object may have left the monitoring environment or there are missed detections or false detections in the target detection model, then the server extracts the image to be detected corresponding to the position information from the next frame of the image according to the position information corresponding to the target object image, that is, extracts and sets the local image corresponding to the position information in the next frame of the image as the image to be detected. Then the server jumps to the above step S202.

[0084] For example, assume that the width of the target object image extracted from the target image is w, the height is h, and the position information of the upper left corner of the target object image is (x, y). Then, the position information of the upper right corner of the target object image can be (x + w, y), the position information of the lower left corner can be (x, y + h), and the position information of the lower right corner can be (x + w, y + h); the position information of the image to be detected is the same as that of the target object image. Furthermore, the position information of the upper left corner of the image to be detected can also be (x, y), the position information of the upper right corner can also be (x + w, y), the position information of the lower left corner can also be (x, y + h), and the position information of the lower right corner can also be (x + w, y + h).

[0085] In this embodiment, the target detection model is used to preliminarily determine whether the next frame image of the target object image contains the target object, so as to obtain a second detection result for the target object. Furthermore, when the second detection result indicates that the next frame image does not contain the target object, the image to be detected corresponding to the position information of the target object image can be extracted from the next frame image, so as to re-detect the actual state of the target object based on the image to be detected, providing a reliable processing basis for verifying whether the image to be detected contains the target object in the subsequent steps.

[0086] In one embodiment, in step S202 above, according to the target object image, target detection processing for the target object is performed on the image to be detected to obtain a target detection result for the target object, which specifically includes the following: determining the image difference information between the image to be detected and the target object image; and determining the target detection result of the target object according to the image difference information.

[0087] Among them, the image difference information is used to characterize the degree of difference between images. The image difference information can characterize the degree of difference between images at the pixel level or at the overall image level.

[0088] Specifically, the server analyzes the difference between the image to be detected and the target object image, which can be to obtain the image difference information by calculating the optical flow of the image to be detected and the target object image. For example, the optical flow result = the image to be detected cut2 - the target object image cut1. Based on the image difference information, the server determines whether the image to be detected obtained at a later time has changed significantly relative to the target object image obtained at an earlier time, thereby obtaining a detection result of whether the image to be detected still contains the target object, and finally determining the target detection result of the target object in the image to be detected.

[0089] In this embodiment, the target detection result of the target object is determined by using the image difference information between the image to be detected and the target object image, rather than using the entire target image or the entire next frame image for difference analysis and target detection analysis. On the one hand, the amount of data to be analyzed can be reduced, thus improving the data analysis efficiency. On the other hand, accurate difference comparison and target object detection can be performed only on the target object image containing the target object and its corresponding image to be detected, avoiding the interference of background information on the analysis process, and greatly improving the accuracy of difference comparison and the accuracy of target object detection.

[0090] In one embodiment, the image difference information includes the pixel difference information between the pixels in the target object image and the pixels in the image to be detected. Determining the target detection result of the image to be detected according to the image difference information specifically includes the following content: screening out target pixels whose pixel difference information exceeds a preset difference threshold; determining the target detection result of the image to be detected according to the number of target pixels.

[0091] Wherein, the preset difference threshold is a threshold for judging the difference degree at the pixel level of an image (such as the image to be detected and the target object image).

[0092] Wherein, the image difference information can characterize the difference information between the image to be detected and the target object image from the pixel level. For example, the difference degree between each pixel in the target object image and each pixel in the image to be detected can be described by the image difference information.

[0093] Wherein, a target pixel refers to a pixel in the image to be detected that has a large change relative to the target object image.

[0094] Specifically, the server can preset a threshold for determining the difference degree, that is, set a preset difference threshold. After obtaining the pixel-level image difference information, the server can compare the image difference information of each pixel in the image to be detected with the preset difference threshold, and set the pixels in the image to be detected whose pixel difference information exceeds the preset difference threshold as target pixels. The server counts the number of target pixels, and then determines the final target detection result according to the number of target pixels. For example, the target detection result can be obtained by judging whether the number of target pixels exceeds a preset number threshold.

[0095] In this embodiment, first, target pixels whose pixel difference information exceeds the preset difference threshold are screened out from the image to be detected, realizing the accurate identification of target pixels with large differences in the image to be detected. Then, the target detection result of the image to be detected is determined according to the number of target pixels, avoiding the interference of background noise, that is, irrelevant pixels, on the detection result, and effectively improving the accuracy and detection efficiency of the target detection result.

[0096] In one embodiment, according to the number of target pixels, the target detection result of the image to be detected is determined, which specifically includes the following: If the number of target pixels exceeds a preset number threshold, it is determined that the target detection result indicates that no target object is detected in the image to be detected; if the number of target pixels does not exceed the preset number threshold, it is determined that the target detection result indicates that a target object is detected in the image to be detected, and the target object image is updated to the image to be detected.

[0097] Wherein, the preset number threshold refers to the threshold for judging the number of pixel points with large changes.

[0098] Specifically, the server can also preset the number threshold of differential pixels, that is, set the preset number threshold. Then the server judges whether the number of target pixels exceeds the preset number threshold, and obtains the target detection result of the image to be detected based on this judgment result. For example, if the number of target pixels exceeds the preset number threshold, it means that the number of pixel points with large changes in the image to be detected is large, that is, the target object is not in place anymore, which is consistent with the preliminary detection result. Then the server can determine that the target detection result indicates that no target object is detected in the image to be detected. If the number of target pixels does not exceed the preset number threshold, it means that the number of pixel points with large changes in the image to be detected is small, that is, the target object may still be in place. Then the server can determine that the target detection result indicates that a target object is detected in the image to be detected. Furthermore, the server can also set the image to be detected as the new target object image, and then the subsequent steps will be based on the new target object image for image difference judgment.

[0099] In this embodiment, by comparing whether the number of target pixels exceeds the preset number threshold, the target detection result is obtained; when the number of target pixels exceeds the preset number threshold, it is determined that the target detection result indicates that the image to be detected does not contain a target object; and when the number of target pixels does not exceed the preset number threshold, it is determined that the target detection result indicates that the image to be detected contains a target object, realizing the accurate detection of the target detection result. Furthermore, the image to be detected is set as the new target object image, providing a new processing basis for subsequent image difference judgment, and further improving the accuracy of image difference information and target detection result.

[0100] In one embodiment, as Figure 3 shown, after inputting the next frame of image into the target detection model and obtaining the second detection result for the target object in the above step S302, it further includes:

[0101] Step S304, if the second detection result indicates that it is preliminarily determined that the next frame of image contains a target object, according to the position information of the target object in the second detection result, a local image for the target object is extracted from the next frame of image, and the target object image is updated to the local image.

[0102] Among them, the local image refers to the image of the local position where the target object is located in the next frame of image.

[0103] Specifically, if the second detection result indicates that the next frame of input image contains the target object, it means that the target object may still not have left the monitoring environment. Then the server can continue to obtain the position information of the target object in the second detection result. If it is detected that the position information of the target object in the second detection result is different from the position information corresponding to the current target object image, it means that although the target object has not left the environment currently, its position has changed. Then the server can extract the local image of the target object from the next frame of image according to the position information of the target object in the second detection result, set the local image as the new target object image, and set the position information corresponding to the local image as the position information corresponding to the new target object image. Then the server jumps to the above step S301 to continue obtaining the next frame of image and performing subsequent preliminary judgment processing.

[0104] Or, in step S305, if the second detection result indicates that it is preliminarily judged that the next frame of image contains the target object, then jump to the step of obtaining the next frame of image.

[0105] Specifically, if the second detection result indicates that the next frame of input image contains the target object, it means that the target object may still not have left the monitoring environment. Then the server can continue to obtain the position information of the target object in the second detection result. If it is detected that the position information of the target object in the second detection result is the same as the position information corresponding to the current target object image, it means that not only has the target object not left the environment currently, but its position has not changed either. Then the server can directly jump to the above step S301 to continue obtaining the next frame of image and performing subsequent preliminary judgment processing.

[0106] It can be understood that the computer device can adaptively select to execute the above step S304 or select to execute the above step S305 according to whether the position information of the target object in the second detection result is the same as the position information corresponding to the current target object image.

[0107] In this embodiment, when the second detection result indicates that it is preliminarily judged that the next frame of image contains the target object, it can be determined whether to extract the local image of the target object from the next frame of image and set it as the new target object image, or jump to the step of obtaining the next frame of image to continue to preliminarily judge whether the next frame of image contains the target object according to whether the position information of the target object in the second detection result is the same as the position information corresponding to the current target object image. This realizes the real-time dynamic update of the target object image, provides an accurate and reliable processing basis for the subsequent steps of target object detection, and greatly improves the accuracy of target object detection.

[0108] In one embodiment, as Figure 4 shown, another object detection method is provided. Taking the server in Figure 1 as an example, the method includes the following steps:

[0109] Step S401: Input the collected image into the object detection model to obtain a first detection result for the object; the object detection model is trained based on sample images associated with the object; the first detection result contains detection information for the object.

[0110] Step S402: If the first detection result indicates that the collected image contains the object, determine the collected image as the target image, and extract the object image corresponding to the position information from the target image according to the position information of the object in the first detection result.

[0111] Step S403: Obtain the next frame of image; the next frame of image represents the image obtained after the object image.

[0112] Step S404: Input the next frame of image into the object detection model to obtain a second detection result for the object; the second detection result contains preliminary judgment information for the object.

[0113] Based on the second detection result, determine whether to execute step S405, step S406, or step S407 next.

[0114] Step S405: If the second detection result indicates that it is preliminarily determined that the next frame of image does not contain the object, extract the image to be detected corresponding to the position information from the next frame of image according to the position information corresponding to the object image; jump to step S408.

[0115] Step S406: If the second detection result indicates that it is preliminarily determined that the next frame of image contains the object, extract the local image of the object from the next frame of image according to the position information of the object in the second detection result, and update the object image to the local image; jump to step S403.

[0116] Alternatively, step S407: If the second detection result indicates that it is preliminarily determined that the next frame of image contains the object, jump to step S403.

[0117] Step S408: Determine the image difference information between the image to be detected and the object image.

[0118] Step S409: Determine the object detection result of the object according to the image difference information; the object detection result is used to indicate whether the image to be detected contains the object.

[0119] The above-mentioned object detection method can achieve the following beneficial effects: after extracting the object image from the target image containing the object, if a to-be-detected image that is preliminarily judged to have no detected object is obtained, the object image is used to verify again whether the to-be-detected image contains the object, so as to obtain a more accurate object detection result, rather than directly using the preliminary judgment result to confirm that the to-be-detected image does not contain the object, effectively solving the problem of occasional missed detection when detecting the object in the traditional technology, thereby greatly improving the stability and accuracy of object detection.

[0120] To more clearly illustrate the object detection method provided by the embodiments of the present disclosure, the above object detection method will be specifically described below with a specific embodiment. As Figure 5 shown, another object detection method is provided, which can be applied to Figure 1 the server in, and specifically includes the following content:

[0121] Obtain an image image1 of a target scene (such as a doorway) through a camera, and detect whether there is an object (such as a package) in image1 through an object detection model (i.e., an object detection algorithm); if the object detection model detects a package in image1, save the detected package coordinates X, and cut out the package image from image1 according to the coordinates X as the object image cut1. Then, continue to obtain an image image2 outside the doorway through the camera at the doorway, and detect whether there is a package in image2 through the object detection model. If the object detection model detects a package in image2, extract the coordinates and image of the package from image2, and judge whether the position of the package in image2 is the same as the position of cut1. If they are different, update the package image extracted from image2 to the latest package image cut1. If they are the same, continue to judge the next image image3 outside the doorway. If the object detection model detects that there is no package in image2, extract the to-be-detected image (cut2) corresponding to the position information of cut1 from image2 according to the previously detected package coordinates X; calculate the optical flow result between cut1 and cut2, that is, calculate the difference between cut1 and cut2 (result = cut2 - cut1). Then, judge whether there is a package in the to-be-detected image according to the optical flow result. A result contains the pixel differences of many pixel points. Count the number num of pixel points in the result that are greater than the set optical flow threshold thresh, and further determine whether there is a package in the to-be-detected image according to num. If num >= the quantity threshold T, it means that the area where the pixels in cut2 change is large, and it is concluded that the package is not there. If num < T, it means that the area where the pixels in cut2 change is small, and it is concluded that the package is still there, and save cut2 as the new cut1.

[0122] In this embodiment, after the wrapped image cut1 is extracted from the image image1, if the to-be-detected image cut2 in which it is preliminarily determined that no wrapped object is detected is obtained, the object image cut1 is used to verify again whether the to-be-detected image cut2 contains a wrapped object, so as to obtain a more accurate object detection result, rather than directly using the preliminary judgment result to confirm that the to-be-detected image cut2 does not contain an object, effectively solving the problem of occasional missed detection in the traditional technology for wrapped object detection, thereby improving the recall rate of wrapped object detection and greatly improving the stability and accuracy of object detection.

[0123] In one embodiment, an object detection system is provided. The system includes: a photographing device and a server. The photographing device is used to collect an image of a target scene and send it to the server; the server is used to determine an object image and a to-be-detected image corresponding to the object image from the received image; the object image represents an image extracted for the object from a target image containing the object; the to-be-detected image represents an image whose shooting time is after the object image and in which it is preliminarily determined that no object is detected; according to the object image, object detection processing for the object is performed on the to-be-detected image to obtain an object detection result of the object, and the object detection result is used to represent whether the to-be-detected image contains an object.

[0124] Among them, the target scene refers to the environment that needs to be monitored.

[0125] The specific processing process of this embodiment can refer to the limitation of the above object detection method and will not be elaborated here.

[0126] The above object detection system can achieve the following beneficial effects: The image of the target scene is collected through the photographing design and sent to the server; then, the server extracts the object image from the target image containing the object. After that, if the server obtains a to-be-detected image in which it is preliminarily determined that no object is detected, the object image is used to verify again whether the to-be-detected image contains an object, so as to obtain a more accurate object detection result, rather than directly using the preliminary judgment result to confirm that the to-be-detected image does not contain an object, effectively solving the problem of occasional missed detection in the traditional technology for object detection, thereby greatly improving the stability and accuracy of object detection.

[0127] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are sequentially shown according to the indications of the arrows, these steps are not necessarily executed sequentially in the order indicated by the arrows. Unless there is a clear indication in this article, there is no strict order limit for the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same moment, but can be executed at different moments. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.

[0128] Based on the same inventive concept, an embodiment of the present application further provides an object detection device for implementing the object detection method described above. The solution provided by this device to solve the problem is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the object detection device provided below can refer to the limitations on the object detection method in the above text, and will not be repeated here.

[0129] In one embodiment, as Figure 6 shown, an object detection device 600 is provided, including: an image acquisition module 601 and an object detection module 602, where:

[0130] The image acquisition module 601 is configured to acquire an object image and acquire a to-be-detected image corresponding to the object image; the object image represents an image extracted from a target image containing the object for the object; the to-be-detected image represents an image whose shooting time is after the object image and which is initially determined not to detect the object.

[0131] The object detection module 602 is configured to perform object detection processing on the to-be-detected image for the object according to the object image, and obtain an object detection result of the object. The object detection result is used to represent whether the to-be-detected image contains the object.

[0132] In one embodiment, the image acquisition module 601 is further configured to input the acquired image into an object detection model to obtain a first detection result for the object; the object detection model is trained based on a sample image associated with the object; the first detection result contains detection information for the object; if the first detection result represents that the acquired image contains the object, it is determined that the acquired image is a target image, and an object image corresponding to the position information is extracted from the target image according to the position information of the object in the first detection result.

[0133] In one embodiment, the image acquisition module 601 is further configured to acquire the next frame of image; the next frame of image represents an image acquired after the target object image; input the next frame of image into the target detection model to obtain a second detection result for the target object; the second detection result includes preliminary judgment information for the target object; if the second detection result indicates that it is preliminarily determined that the next frame of image does not include the target object, then extract a to-be-detected image corresponding to the position information from the next frame of image according to the position information corresponding to the target object image.

[0134] In one embodiment, the target detection module 602 is further configured to determine image difference information between the to-be-detected image and the target object image; determine the target detection result of the target object according to the image difference information.

[0135] In one embodiment, the image difference information includes pixel difference information between the pixels in the target object image and the pixels in the to-be-detected image. The target detection device 600 further includes a pixel screening module, configured to screen out target pixels whose pixel difference information exceeds a preset difference threshold; determine the target detection result of the to-be-detected image according to the number of target pixels.

[0136] In one embodiment, the target detection device 600 further includes a quantity judgment module, configured to if the number of target pixels exceeds a preset quantity threshold, then determine that the target detection result indicates that the target object is not detected in the to-be-detected image; if the number of target pixels does not exceed the preset quantity threshold, then determine that the target detection result indicates that the target object is detected in the to-be-detected image, and update the target object image to the to-be-detected image.

[0137] In one embodiment, the target detection device 600 further includes a quantity judgment module, configured to a detection and analysis module, configured to if the second detection result indicates that it is preliminarily determined that the next frame of image includes the target object, then extract a local image for the target object from the next frame of image according to the position information of the target object in the second detection result, and update the target object image to the local image; or, if the second detection result indicates that it is preliminarily determined that the next frame of image includes the target object, then jump to the step of acquiring the next frame of image.

[0138] Each module in the above target detection device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor in the computer device in the form of hardware or be independent of it, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above respective modules.

[0139] In one embodiment, a computer device is provided. The computer device can be a server, and its internal structure diagram can be as Figure 7As shown in the figure. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O), and a communication interface. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as target object images and images to be detected. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals through a network connection. When the computer program is executed by the processor, it implements a target detection method.

[0140] Those skilled in the art can understand that Figure 7 the structure shown in the figure is only a block diagram of some structures related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.

[0141] In one embodiment, a computer device is further provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the steps in the above method embodiments are implemented.

[0142] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by the processor, the steps in the above method embodiments are implemented.

[0143] In one embodiment, a computer program product is provided, including a computer program. When the computer program is executed by the processor, the steps in the above method embodiments are implemented.

[0144] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memories can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memories can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., without limitation.

[0145] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.

[0146] The above-described embodiments only represent several implementation manners of the present application. The description is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.

Claims

1. A target detection method, characterized in that: The method comprises: Acquire a target image and acquire an image to be detected corresponding to the target image; the target image represents an image extracted from a target image containing the target object; the image to be detected represents an image that is shot after the target image and preliminarily determines that the target object is not detected; According to the target object image, target detection processing for the target object is performed on the image to be detected to obtain a target detection result of the target object, and the target detection result is used to indicate whether the image to be detected contains the target object.

2. The method according to claim 1, characterized in that The step of acquiring the target object image comprises: Inputting the collected image into a target detection model to obtain a first detection result for the target object; the target detection model is trained based on a sample image associated with the target object; the first detection result includes detection information for the target object; If the first detection result indicates that the captured image contains the target object, the captured image is determined to be the target image, and based on the position information of the target object in the first detection result, the target object image corresponding to the position information is extracted from the target image.

3. The method according to claim 2, characterized in that The step of acquiring the image to be detected corresponding to the target image includes: Acquire a next frame of image; the next frame of image represents an image acquired after the target object image; Inputting the next frame of image into the target detection model to obtain a second detection result for the target object; the second detection result includes preliminary judgment information for the target object; If the second detection result indicates that the next frame image does not contain the target object, the image to be detected corresponding to the position information is extracted from the next frame image according to the position information corresponding to the target object image.

4. The method according to any one of claims 1 to 3, characterized in that: The step of performing target detection processing on the image to be detected for the target object according to the target object image to obtain a target detection result of the target object includes: Determining image difference information between the image to be detected and the target object image; The target detection result of the target object is determined according to the image difference information.

5. The method according to claim 4, characterized in that The image difference information includes pixel difference information between pixels in the target object image and pixels in the image to be detected; The step of determining the target detection result of the image to be detected according to the image difference information includes: Filter out target pixels whose pixel difference information exceeds a preset difference threshold; The target detection result of the image to be detected is determined according to the number of the target pixels.

6. The method according to claim 5, characterized in that Determining the target detection result of the image to be detected according to the number of the target pixels includes: If the number of the target pixels exceeds a preset number threshold, determining that the target detection result indicates that the target object is not detected in the image to be detected; If the number of the target pixels does not exceed the preset number threshold, it is determined that the target detection result indicates that the target object is detected in the image to be detected, and the target object image is updated to the image to be detected.

7. The method according to claim 3, characterized in that After inputting the next frame of image into the target detection model to obtain a second detection result for the target object, the method further includes: If the second detection result indicates that the next frame image contains the target object, extract a partial image of the target object from the next frame image according to the position information of the target object in the second detection result, and update the target object image to the partial image; Alternatively, if the second detection result indicates that the target object is preliminarily determined to be included in the next frame of image, the process jumps to the step of acquiring the next frame of image.

8. A target detection device, characterized in that: The device comprises: An image acquisition module is used to acquire a target image and acquire an image to be detected corresponding to the target image; the target image represents an image extracted from a target image containing the target object; the image to be detected represents an image that is shot after the target image and preliminarily determines that the target object is not detected; The target detection module is used to perform target detection processing on the image to be detected based on the target object image to obtain a target detection result of the target object, and the target detection result is used to indicate whether the image to be detected contains the target object.

9. A target detection system, characterized in that: The system comprises: a shooting device and a server; The shooting device is used to capture images of the target scene and send them to the server; The server is used to determine a target image and an image to be detected corresponding to the target image from a received image; the target image represents an image extracted from a target image containing the target object; the image to be detected represents an image that is shot after the target image and is preliminarily determined not to have detected the target object; based on the target image, target detection processing is performed on the image to be detected for the target object to obtain a target detection result of the target object, and the target detection result is used to represent whether the image to be detected contains the target object.

10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.