Target object quantity detection method and device, electronic equipment and storage medium

CN117372738BActive Publication Date: 2026-08-18SF TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210775667.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-01
Publication Date
2026-08-18
Estimated Expiration
2042-07-01

AI Technical Summary

Technical Problem

但当场地线体数量增多时,对数据和模型的维护都将是一项艰巨的工作,同时分类方法具有一定局限性,并不能完全解决流水线包裹种类多样的需求,而单一检测方案同样具有局限性

Benefits of technology

[0042] In this application, an image to be detected is acquired, and the main area to be detected and other areas to be detected in the image are classified by light exposure. Based on the classification results of the main area to be detected and other areas to be detected, the image type of the image to be detected is determined. When the image type of the image to be detected is a detectable image, the number of target objects in the image to be detected is detected to obtain the target object quantity detection result. That is, this application divides the image to be detected into the main area to be detected and other areas to be detected, and adopts a scheme of classifying the image to be detected before detection to accurately identify the number of target objects in the image to be detected with light exposure areas. Compared with the existing single classification scheme, the scheme of this application can solve the problem of difficulty in verifying the number of target objects on the assembly line in the logistics field due to the variety of package types, and effectively improve the detection accuracy of the number of target objects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117372738B_ABST
    Figure CN117372738B_ABST
Patent Text Reader

Abstract

The application provides a target quantity detection method and device, electronic equipment and storage medium, relates to the technical field of image recognition, solves the problem that the current classification method has certain limitations and cannot meet the current verification requirements of various types of pipeline packages, including obtaining a to-be-detected image, the to-be-detected image including a main to-be-detected region and other to-be-detected regions; performing light exposure image classification on the main to-be-detected region and the other to-be-detected regions respectively; determining the image type of the to-be-detected image according to the main to-be-detected region classification result and the other to-be-detected region classification result; when the to-be-detected image is a detectable image, the quantity of target objects in the to-be-detected image is detected to obtain a target quantity detection result, the application adopts a fusion classification detection scheme of classifying and then detecting the to-be-detected image, efficiently and accurately judges the quantity of target objects in the to-be-detected image, and solves the problem of pipeline target quantity verification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image recognition technology, specifically to a method, apparatus, electronic device, and storage medium for detecting the number of target objects. Background Technology

[0002] Existing methods for verifying the number of packages on assembly lines typically use different classification models to identify packages for different locations and lines. However, as the number of locations and lines increases, maintaining the data and models becomes a challenging task. Furthermore, classification methods have limitations and cannot fully address the diverse needs of assembly line packages, while a single detection solution also has its limitations. Summary of the Invention

[0003] This application provides a target object quantity detection method, apparatus, electronic device, and storage medium that can efficiently and accurately determine the number of target objects in an image by first classifying it and then detecting it, thereby solving the current problem of target object quantity verification on production lines.

[0004] On the one hand, this application provides a method for detecting the quantity of a target object, including:

[0005] Acquire an image to be detected, the image to be detected including a main region to be detected and other regions to be detected;

[0006] The main region to be detected and the other regions to be detected are classified by light exposure image to obtain the classification results of the main region to be detected and the classification results of the other regions to be detected.

[0007] Based on the classification results of the main region to be detected and other regions to be detected, the image type of the image to be detected is determined;

[0008] When the image type of the image to be detected is a detectable image, the number of target objects in the image to be detected is detected to obtain the target object number detection result.

[0009] In one possible implementation of this application, the step of performing exposure image classification on the main detection region and the other detection regions respectively to obtain the classification results of the main detection region and the other detection regions includes:

[0010] Determine whether the main area to be detected is an image of light exposure;

[0011] If yes, the classification result of the main detection area is determined to be an exposed image; otherwise, the classification result of the main detection area is determined to be a non-exposed image.

[0012] Determine whether the other areas to be detected are light exposure images;

[0013] If yes, the other areas to be detected are classified as light-exposed images; otherwise, they are classified as non-light-exposed images.

[0014] In one possible implementation of this application, determining the image type of the image to be detected based on the classification results of the main region to be detected and other regions to be detected includes:

[0015] The image types of the images to be detected include detectable images and undetectable images;

[0016] When the classification result of the main region to be detected is that the main region to be detected is an exposure-type image and the classification result of the other regions to be detected is that the other regions to be detected are exposure-type images, the image type of the image to be detected is determined to be an undetectable image; otherwise, the image type of the image to be detected is determined to be a detectable image.

[0017] In one possible implementation of this application, detecting the number of target objects in the image to be detected and obtaining a target object number detection result includes:

[0018] The number of target objects is detected by performing a panoramic view of the image to be detected, and the resulting image to be detected contains multiple target detection boxes, each containing multiple target detection points;

[0019] The number of target detection boxes in the image to be detected is determined based on the coordinates of multiple target detection points located in the main detection area.

[0020] The number of target objects is determined based on the number of target detection boxes.

[0021] In one possible implementation of this application, detecting the number of target objects in the image to be detected and obtaining a target object number detection result includes:

[0022] The image to be detected is divided into (n*n) sub-images to be detected using a slice reasoning method, where n is a natural number;

[0023] The number of target objects in the (n*n) sub-images to be detected is detected to obtain the target object number detection result.

[0024] In one possible implementation of this application, acquiring the image to be detected includes continuously acquiring multiple frames of the image to be detected.

[0025] In one possible implementation of this application, before dividing the image to be detected into (n*n) sub-images using slice reasoning, the method includes:

[0026] Obtain the image time interval between each frame of the image to be detected;

[0027] The value of n in the (n*n) sub-images to be detected is determined based on the image time interval.

[0028] In one possible implementation of this application, the step of performing light exposure image classification on the main detection area and the other detection areas includes:

[0029] The Mobilenet-v2 classification network is used to classify the light exposure image of the main detection area and the other detection areas respectively, so as to obtain the classification results of the main detection area and the other detection areas.

[0030] In one possible implementation of this application, detecting the number of target objects in the image to be detected and obtaining a target object number detection result includes:

[0031] The YOLOv5S detection network is used to detect the number of target objects in the image to be detected, and the target object quantity detection result is obtained.

[0032] On the other hand, this application provides a target quantity detection device, the device comprising:

[0033] The acquisition module is used to acquire the image to be detected, which includes a main region to be detected and other regions to be detected.

[0034] The classification module is used to classify the light exposure image of the main detection area and the other detection areas respectively, and obtain the classification results of the main detection area and the other detection areas.

[0035] The determination module is used to determine the image type of the image to be detected based on the classification results of the main region to be detected and other regions to be detected.

[0036] The detection module is used to detect the number of target objects in the image to be detected when the image type of the image to be detected is a detectable image, and to obtain the target object quantity detection result.

[0037] On the other hand, this application also provides an electronic device, the electronic device comprising:

[0038] One or more processors;

[0039] Memory; and

[0040] One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the target quantity detection method.

[0041] On the other hand, this application also provides a computer-readable storage medium having a computer program stored thereon, the computer program being loaded by a processor to execute the steps in the target quantity detection method.

[0042] In this application, an image to be detected is acquired, and the main area to be detected and other areas to be detected in the image are classified by light exposure. Based on the classification results of the main area to be detected and other areas to be detected, the image type of the image to be detected is determined. When the image type of the image to be detected is a detectable image, the number of target objects in the image to be detected is detected to obtain the target object quantity detection result. That is, this application divides the image to be detected into the main area to be detected and other areas to be detected, and adopts a scheme of classifying the image to be detected before detection to accurately identify the number of target objects in the image to be detected with light exposure areas. Compared with the existing single classification scheme, the scheme of this application can solve the problem of difficulty in verifying the number of target objects on the assembly line in the logistics field due to the variety of package types, and effectively improve the detection accuracy of the number of target objects. Attached Figure Description

[0043] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0044] Figure 1 This is a schematic diagram of a scene of an existing production line body light exposure image provided in the embodiments of this application;

[0045] Figure 2 This is a schematic diagram of a scene of an existing production line body without light exposure provided in the embodiments of this application;

[0046] Figure 3 This is a schematic flowchart of an embodiment of the target object quantity detection method provided in this application;

[0047] Figure 4 This is a schematic flowchart of an embodiment of the target object quantity detection method provided in this application;

[0048] Figure 5 This is a scene diagram of the image to be detected provided in the embodiments of this application;

[0049] Figure 6 This is a schematic diagram of an embodiment of the target quantity detection system provided in this application.

[0050] Figure 7 This is a schematic diagram of an embodiment of the electronic device provided in this application. Detailed Implementation

[0051] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0052] In the description of this invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, features defined as "first" and "second" may explicitly or implicitly include one or more of the stated features. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0053] In this application, the term "exemplary" is used to mean "serving as an example, illustration, or description." Any embodiment described as "exemplary" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use the invention. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that the invention can be made without using these specific details. In other instances, well-known structures and processes will not be described in detail to avoid obscuring the description of the invention with unnecessary detail. Therefore, the invention is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.

[0054] In the process of verifying the quantity of packages on the production line, the obtained images of the production line include, for example: Figure 1 The non-exposure type images shown and such Figure 2The image shown is an exposed image. When the area outside the weighing area in the assembly line image is an exposed image, existing detection networks cannot detect objects within that area. For example, if the object has a corner in the weighing area, the actual detection of the weighing area in the assembly line image should be multiple objects (one complete package and one package with a corner), but the detection network is affected by the exposed image outside the weighing area, and the result is a single object.

[0055] Furthermore, when using a classification network for detection, since the area outside the weighing scale in the assembly line image is an exposed image while the weighing surface area is not, and the classification network only detects the weighing surface area, it will inevitably classify the assembly line image as a non-exposed image. If the detection network is then used for detection, it will lead to the detection network drawing the incorrect conclusion that it is a single piece.

[0056] Therefore, in order to solve the above problems, this application provides a method, apparatus, electronic device and storage medium for detecting the quantity of a target object, which will be described in detail below.

[0057] like Figure 3 and Figure 4 The diagram shown is a flowchart of an embodiment of the target object quantity detection method in this application. The target object quantity detection method includes the following steps 101 to 104:

[0058] 101. Obtain the image to be detected, which includes the main area to be detected and other areas to be detected.

[0059] The image to be detected is the image for which the quantity of target objects needs to be detected. This image can be an image captured in real time by existing shooting equipment and uploaded to a display device that supports playing the image to be detected for real-time display, or it can be an image in other ways. This embodiment does not specifically limit this.

[0060] In this embodiment, acquiring the image to be detected includes: continuously acquiring multiple frames of the image to be detected;

[0061] Each frame of the image to be detected includes a main detection area and other detection areas. The main detection area represents the area in the image to be detected that is mainly used to detect the number of target objects, while the other detection areas represent the areas that will affect the detection of the number of target objects in the image to be detected.

[0062] When this embodiment is applied to the problem of verifying the number of packages on a logistics assembly line, the image to be detected can be an image of the assembly line itself. The main area to be detected is the surface area of ​​the assembly line image, and the other areas to be detected are the areas outside the surface of the assembly line image.

[0063] 102. Perform light exposure image classification on the main detection area and other detection areas respectively to obtain the classification results of the main detection area and other detection areas.

[0064] In this embodiment, exposure image classification is performed on the main detection area and other detection areas respectively to obtain the classification results of the main detection area and other detection areas, including:

[0065] Determine whether the main area to be detected is an image of light exposure.

[0066] If yes, the classification result of the main area to be detected is determined to be an image of light exposure; otherwise, the classification result of the main area to be detected is determined to be an image of non-light exposure.

[0067] Determine whether other areas to be detected are images of light exposure;

[0068] If yes, the other regions to be detected are classified as exposed images; otherwise, they are classified as non-exposed images.

[0069] In this embodiment, the Mobilenet-v2 classification network is used to classify the light exposure image of the main detection area and other detection areas respectively. Other classification networks can also be used to achieve the light exposure image classification in this embodiment.

[0070] 103. Based on the classification results of the main regions to be detected and the classification results of other regions to be detected, determine the image type of the image to be detected.

[0071] In this embodiment, the image type of the image to be detected is determined based on the classification results of the main region to be detected and other regions to be detected, including:

[0072] The image types to be detected include detectable images and undetectable images;

[0073] When the classification result of the main region to be detected is that the main region to be detected is an exposure-type image and the classification result of other regions to be detected is that other regions to be detected are exposure-type images, the image type of the image to be detected is determined to be an undetectable image; otherwise, the image type of the image to be detected is determined to be a detectable image.

[0074] 104. When the image type of the image to be detected is a detectable image, the number of target objects in the image to be detected is detected to obtain the target object quantity detection result.

[0075] In this embodiment, the YOLOv5s detection network is used to detect the number of target objects in the image to be detected, and the target object quantity detection result is obtained.

[0076] In this application, an image to be detected is acquired, and the main area to be detected and other areas to be detected in the image are classified by light exposure. Based on the classification results of the main area to be detected and other areas to be detected, the image type of the image to be detected is determined. When the image type of the image to be detected is a detectable image, the number of target objects in the image to be detected is detected to obtain the target object quantity detection result. That is, this application divides the image to be detected into the main area to be detected and other areas to be detected, and adopts a scheme of classifying the image to be detected before detection to accurately identify the number of target objects in the image to be detected with light exposure areas. Compared with the existing single classification method, the solution of this application can solve the problem of difficulty in checking the number of target objects on the assembly line in the logistics field due to the variety of package types, and effectively improve the detection accuracy of the number of target objects.

[0077] In another embodiment of this application, the number of target objects in the image to be detected is detected to obtain a target object number detection result, including:

[0078] The number of objects is detected by performing a panoramic view of the image to be detected. The resulting image contains multiple target detection boxes, and each target detection box contains multiple target detection points.

[0079] The number of target detection boxes in the image to be detected is determined based on the coordinates of multiple target detection points located in the main detection area.

[0080] The number of target objects is determined based on the number of target detection boxes.

[0081] For example, such as Figure 5 As shown, when performing target quantity detection on the panoramic image of the image to be detected, the image to be detected contains a target detection box composed of target detection points a1, a2, a3, and a4, and also includes a target detection box composed of target detection points b1, b2, b3, and b4.

[0082] That is, a target detection box can be determined based on the coordinates (a1, a2, a3, a4), and a target detection box can be determined based on the coordinates (b1, b2, b3, b4), thus determining that the image to be detected contains two target detection boxes;

[0083] The number of objects can be determined based on the two object detection boxes. The detection result is that there are two objects in the image to be detected, namely object 1 and object 2.

[0084] When this embodiment is applied to the problem of verifying the number of packages on a logistics assembly line, there may be a situation where two objects overlap in the image to be detected, which is actually difficult to distinguish, and the detection network cannot detect the existence of two packages. In order to solve the problem that such small objects cannot be detected, a slice inference processing scheme can be used to detect the number of target objects.

[0085] Therefore, in another embodiment of this application, detecting the number of target objects in the image to be detected and obtaining the target object number detection result includes:

[0086] The image to be detected is divided into (n*n) sub-images to be detected using a slice reasoning method, where n is a natural number;

[0087] The number of target objects in (n*n) sub-images to be detected is detected to obtain the target object number detection result.

[0088] In this embodiment, before dividing the image to be detected into (n*n) sub-images using the slice reasoning method, the method further includes:

[0089] Obtain the image time interval between each frame of the image to be detected;

[0090] Based on the image time interval, determine the value of n in (n*n) sub-images to be detected.

[0091] In this embodiment, the value of n is not specifically limited.

[0092] Therefore, based on the above analysis, this embodiment proposes a target item quantity detection method that integrates classification and detection. This method can solve the problem of model applicability in different scenarios, greatly expanding the generalization degree. Applying this method to the problem of package quantity verification on assembly lines in the logistics field can reduce the manual maintenance time of a large number of lines. At the same time, the overlay detection model can solve the problem of edge items, corner items, and stacked items that cannot be identified by a single classification model, thus reducing costs, increasing efficiency, and increasing profits in practical applications.

[0093] To better implement the target object quantity detection method in the embodiments of this application, based on the target object quantity detection method, the embodiments of this application also provide a target object quantity detection device 200, such as... Figure 6 As shown, the target quantity detection device 200 includes:

[0094] The acquisition module 201 is used to acquire the image to be detected, which includes the main area to be detected and other areas to be detected.

[0095] The classification module 202 is used to classify the light exposure image of the main detection area and other detection areas respectively, and obtain the classification results of the main detection area and other detection areas.

[0096] The determination module 203 is used to determine the image type of the image to be detected based on the classification results of the main region to be detected and other regions to be detected.

[0097] The detection module 204 is used to detect the number of target objects in the image to be detected when the image type of the image to be detected is a detectable image, and to obtain the target object quantity detection result.

[0098] Classification module 202 specifically includes:

[0099] Used to determine whether the main area to be detected is an image of light exposure;

[0100] If yes, the classification result of the main area to be detected is determined to be an image of light exposure; otherwise, the classification result of the main area to be detected is determined to be an image of non-light exposure.

[0101] Used to determine whether other areas to be detected are light-exposed images;

[0102] If yes, the other regions to be detected are classified as exposed images; otherwise, they are classified as non-exposed images.

[0103] The image types to be detected include detectable images and undetectable images. The determination module 203 specifically includes:

[0104] This method is used to determine the image type of the image to be detected as an undetectable image when the classification result of the main region to be detected is an exposure-type image and the classification results of other regions to be detected are exposure-type images; otherwise, it determines the image type of the image to be detected as a detectable image.

[0105] The detection module 204 is specifically as follows:

[0106] This is used to detect the number of objects in a panoramic view of the image to be detected. The resulting image contains multiple target detection boxes, and each target detection box contains multiple target detection points.

[0107] Used to determine the number of target detection boxes in the image to be detected based on the coordinates of multiple target detection points located in the main detection area;

[0108] Used to determine the number of target objects based on the number of target detection boxes.

[0109] The detection module 204 is specifically as follows:

[0110] This is used to divide the image to be detected into (n*n) sub-images to be detected using a slice reasoning method;

[0111] This is used to detect the number of target objects in (n*n) sub-images to be detected, and to obtain the target object number detection result.

[0112] The acquisition module 201 is specifically used to continuously acquire multiple frames of images to be detected.

[0113] The target quantity detection device also includes a determination module, which specifically includes:

[0114] Used to obtain the image time interval between each frame of the image to be detected;

[0115] Used to determine the value of n in (n*n) sub-images to be detected based on the image time interval.

[0116] Classification module 202 specifically includes:

[0117] This is used to classify the main detection area and other detection areas in the light exposure image using the classification network Mobilenet-v2, and obtain the classification results of the main detection area and other detection areas.

[0118] The detection module 204 is specifically as follows:

[0119] This method uses the YOLOv5S detection network to detect the number of objects in an image and obtains the object quantity detection results.

[0120] In another embodiment of this application, such as Figure 7 As shown, this application also provides an electronic device 300, which illustrates a structural schematic diagram of the electronic device 300 involved in the embodiments of this application. Specifically:

[0121] The electronic device 300 may include components such as a processor 301 with one or more processing cores, a memory 302 with one or more computer-readable storage media, a power supply 303, and an input unit 304. Those skilled in the art will understand that... Figure 7 The structure of the electronic device 300 shown does not constitute a limitation on the electronic device 300, and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:

[0122] The processor 301 is the control center of the electronic device 300. It connects various parts of the electronic device 300 via various interfaces and lines. By running or executing software programs and / or modules stored in the memory 302, and by calling data stored in the memory 302, it performs various functions and processes data of the electronic device 300, thereby providing overall monitoring of the electronic device 300. Optionally, the processor 301 may include one or more processing cores. The processor 301 may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor. Preferably, the processor 301 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and application programs, and the modem processor mainly handles wireless communication. It is understandable that the aforementioned modem processor may not be integrated into processor 301.

[0123] The memory 302 can be used to store software programs and modules. The processor 301 executes various functional applications and data processing by running the software programs and modules stored in the memory 302. The memory 302 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created based on the use of the electronic device 300, etc. In addition, the memory 302 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 302 may also include a memory controller to provide the processor 301 with access to the memory 302.

[0124] The electronic device 300 also includes a power supply 303 that supplies power to the various components. Preferably, the power supply 303 can be logically connected to the processor 301 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 303 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0125] The electronic device 300 may also include an input unit 304, which can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.

[0126] Although not shown, the electronic device 300 may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 301 in the electronic device 300 loads the executable files corresponding to the processes of one or more applications into the memory 302 according to the following instructions, and the processor 301 runs the applications stored in the memory 302 to realize various functions, as follows:

[0127] Acquire the image to be detected, which includes the main region to be detected and other regions to be detected;

[0128] The main detection area and other detection areas are classified by light exposure image to obtain the classification results of the main detection area and other detection areas.

[0129] Based on the classification results of the main region to be detected and other regions to be detected, the image type of the image to be detected is determined;

[0130] When the image type of the image to be detected is a detectable image, the number of target objects in the image is detected to obtain the target object quantity detection result.

[0131] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0132] In some embodiments of this application, a computer-readable storage medium is also provided. This storage medium may include: read-only memory (ROM), random access memory (RAM), a magnetic disk, or an optical disk, etc. A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in the target object quantity detection method provided in the embodiments of this application. For example, the computer program loaded by the processor can execute the following steps:

[0133] Acquire the image to be detected, which includes the main region to be detected and other regions to be detected;

[0134] The main detection area and other detection areas are classified by light exposure image to obtain the classification results of the main detection area and other detection areas.

[0135] Based on the classification results of the main region to be detected and other regions to be detected, the image type of the image to be detected is determined;

[0136] When the image type of the image to be detected is a detectable image, the number of target objects in the image is detected to obtain the target object quantity detection result.

[0137] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the detailed descriptions of other embodiments above, which will not be repeated here.

[0138] The above provides a detailed description of a target quantity detection method, apparatus, electronic device, and storage medium provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A method for detecting the quantity of a target object, characterized in that, include: Acquire an image to be detected, the image to be detected including a main region to be detected and other regions to be detected; The main region to be detected and the other regions to be detected are classified by light exposure image to obtain the classification results of the main region to be detected and the classification results of the other regions to be detected. Based on the classification results of the main region to be detected and other regions to be detected, the image type of the image to be detected is determined; the image type of the image to be detected includes detectable images and undetectable images; when the classification result of the main region to be detected is that the main region to be detected is an exposure-type image, and the classification results of other regions to be detected are that other regions to be detected are exposure-type images, the image type of the image to be detected is determined to be an undetectable image; otherwise, the image type of the image to be detected is determined to be a detectable image. When the image type of the image to be detected is a detectable image, the number of target objects in the image to be detected is detected to obtain the target object number detection result.

2. The method for detecting the quantity of a target object as described in claim 1, characterized in that, The step of performing exposure image classification on the main detection region and the other detection regions respectively to obtain the classification results of the main detection region and the other detection regions includes: Determine whether the main area to be detected is an image of light exposure; If yes, the classification result of the main detection area is determined to be an exposed image; otherwise, the classification result of the main detection area is determined to be a non-exposed image. Determine whether the other areas to be detected are light exposure images; If yes, the other areas to be detected are classified as light-exposed images; otherwise, they are classified as non-light-exposed images.

3. The method for detecting the quantity of a target object as described in claim 1, characterized in that, The step of detecting the number of target objects in the image to be detected, and obtaining the target object number detection result, includes: The number of target objects is detected in the panoramic image of the image to be detected, and the resulting image to be detected contains multiple target detection boxes, each containing multiple target detection points; The number of target detection boxes in the image to be detected is determined based on the coordinates of multiple target detection points located in the main detection area. The number of target objects is determined based on the number of target detection boxes.

4. The method for detecting the quantity of a target object as described in claim 1, characterized in that, The step of detecting the number of target objects in the image to be detected, and obtaining the target object number detection result, includes: The image to be detected is divided into n*n sub-images to be detected using a slice reasoning method, where n is a natural number; The number of target objects in the n*n sub-images to be detected is detected to obtain the target object number detection result.

5. The method for detecting the quantity of a target object as described in claim 4, characterized in that, The acquisition of the image to be detected includes continuously acquiring multiple frames of the image to be detected.

6. The method for detecting the quantity of a target object as described in claim 5, characterized in that, Before dividing the image to be detected into n*n sub-images using the slice reasoning method, the method includes: Obtain the image time interval between each frame of the image to be detected; The value of n in the n*n sub-images to be detected is determined based on the image time interval.

7. The method for detecting the quantity of a target object as described in claim 1, characterized in that, The step of classifying the light exposure images of the main detection area and the other detection areas includes: The Mobilenet-v2 classification network is used to classify the light exposure image of the main detection area and the other detection areas respectively, so as to obtain the classification results of the main detection area and the other detection areas.

8. The method for detecting the quantity of a target object as described in claim 2, characterized in that, The step of detecting the number of target objects in the image to be detected, and obtaining the target object number detection result, includes: The YOLOv5S detection network is used to detect the number of target objects in the image to be detected, and the target object quantity detection result is obtained.

9. A target object quantity detection device, characterized in that, The device includes: The acquisition module is used to acquire the image to be detected, which includes a main region to be detected and other regions to be detected. The classification module is used to classify the light exposure image of the main detection area and the other detection areas respectively, and obtain the classification results of the main detection area and the other detection areas. The determination module is used to determine the image type of the image to be detected based on the classification results of the main region to be detected and other regions to be detected. The image type of the image to be detected includes detectable images and undetectable images. When the classification result of the main region to be detected is that the main region to be detected is an exposure-type image, and the classification results of other regions to be detected are that other regions to be detected are exposure-type images, the image type of the image to be detected is determined to be an undetectable image; otherwise, the image type of the image to be detected is determined to be a detectable image. The detection module is used to detect the number of target objects in the image to be detected when the image type of the image to be detected is a detectable image, and to obtain the target object quantity detection result.

10. An electronic device, characterized in that, The electronic device includes: One or more processors; Memory; and One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the target quantity detection method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that, It stores a computer program, which is loaded by a processor to execute the steps in the target quantity detection method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Fire point detection method and device, electronic equipment and storage medium

    CN110443969A

  • Quality inspection method and device, quality inspection system, electronic equipment and readable medium

    CN114627093A