Method, apparatus, storage medium, and electronic device for generating target detection boxes

By using perimeter cross-border ratio in object detection to determine the object detection box, the problem of deletion of redundant candidate boxes is solved, and efficient object object detection box determination is achieved, which improves the processor's computing speed and detection efficiency.

CN115294328BActive Publication Date: 2025-07-01HORIZON JOURNEY (SHANGHAI) TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In object detection, usually each target object will be boxed by multiple candidate boxes, resulting in the appearance of redundant candidate boxes, and it is necessary to efficiently remove the redundant candidate boxes to obtain accurate object detection results.

Method used

By detecting objects on the image to be processed, the first candidate box and its confidence are obtained, and the number of the first candidate box is detected. If the number exceeds the preset number, the reference detection box is determined based on the confidence, the perimeter intersecting ratio between the second candidate box and the reference detection box is calculated, and the third candidate box is determined based on the relationship between the intersecting ratio and the preset threshold. If the third candidate box meets the preset conditions, it and the reference detection box are determined as the target detection box.

Benefits of technology

It realizes efficient deletion of redundant candidate boxes of objects in the image, improves the determination efficiency of object object detection boxes, reduces the computing power requirements of the processor, and improves the computing speed of the processor.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115294328B_ABST
    Figure CN115294328B_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure disclose a method, apparatus, storage medium, and electronic device for generating a target detection box. The method includes performing object detection on a to-be-processed image to obtain a first set of candidate boxes and the confidence levels of the first set of candidate boxes; when the number of the first set of candidate boxes is greater than a first preset number, determining a reference detection box based on the confidence levels respectively corresponding to the first set of candidate boxes; obtaining the perimeter intersection over union (IoU) between each second candidate box in at least one second set of candidate boxes and the reference detection box; obtaining at least one third set of candidate boxes based on the size relationship between the perimeter IoU respectively corresponding to the second set of candidate boxes and a first preset threshold; and when at least one third set of candidate boxes meets a first preset condition, determining the at least one third set of candidate boxes and the reference detection box as target detection boxes. Embodiments of the present disclosure achieve the deletion of redundant candidate boxes of objects in an image, thereby achieving efficient determination of target detection boxes of objects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to image processing technologies, and in particular, to a method, apparatus, storage medium, and electronic device for generating target detection frames. Background Art

[0002] Object detection technology refers to the technology of using a computer to process, analyze, and understand an image to detect target objects of various different patterns in the image. After the target object in the image is detected, it is necessary to use candidate frames to enclose the target object. Usually, each target object will have multiple candidate frames. At this time, it is necessary to remove redundant candidate frames to obtain the object detection result of the target object. Therefore, how to efficiently and accurately remove redundant candidate frames to obtain the detection result of the target object is an urgent problem to be solved. Summary of the Invention

[0003] In order to solve the above technical problems, the present disclosure is proposed. Embodiments of the present disclosure provide a method, apparatus, storage medium, and electronic device for generating target detection frames.

[0004] According to one aspect of the embodiments of the present disclosure, a method for generating a target detection frame is provided, including: performing object detection on an image to be processed to obtain at least one first candidate frame and the confidence of each first candidate frame in the at least one first candidate frame; detecting the number of the at least one first candidate frame; in response to the number of the at least one first candidate frame being greater than a first preset number, determining a reference detection frame based on the confidence corresponding to each of the first candidate frames; obtaining the perimeter intersection over union between each of at least one second candidate frame and the reference detection frame, where the at least one second candidate frame is the first candidate frame other than the reference detection frame in the at least one first candidate frame; obtaining at least one third candidate frame based on the magnitude relationship between the perimeter intersection over union corresponding to each of the second candidate frames and a first preset threshold; and in response to at least one of the at least one third candidate frame satisfying a first preset condition, determining the at least one third candidate frame and the reference detection frame as the target detection frame.

[0005] According to another aspect of the embodiments of the present disclosure, there is provided an apparatus for generating a target detection box, including: an image processing module configured to perform object detection on an image to be processed, obtaining at least one first candidate box and the confidence of each first candidate box in the at least one first candidate box; a detection module configured to detect the number of the at least one first candidate box; a first response module configured to, in response to the number of the at least one first candidate box being greater than a first preset number, determine a reference detection box based on the confidence corresponding to each of the first candidate boxes; a first acquisition module configured to acquire the perimeter intersection over union between each of at least one second candidate box and the reference detection box, where the at least one second candidate box is the first candidate box other than the reference detection box in the at least one first candidate box; a first comparison module configured to obtain at least one third candidate box based on the size relationship between the perimeter intersection over union corresponding to each of the second candidate boxes and a first preset threshold; a second response module configured to, in response to the at least one third candidate box satisfying a first preset condition, determine the at least one third candidate box and the reference detection box as the target detection box.

[0006] According to yet another aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium storing a computer program for executing the above-mentioned method for generating a target detection box.

[0007] According to still another aspect of the embodiments of the present disclosure, there is provided an electronic device, including: a processor; a memory for storing executable instructions executable by the processor; the processor configured to read the executable instructions from the memory and execute the instructions to implement the above-mentioned method for generating a target detection box.

[0008] Based on the method, apparatus, storage medium, and electronic device for generating a target detection box provided in the above embodiments of the present disclosure, after performing object detection on a to-be-processed image to obtain at least one first candidate box and the confidence of each first candidate box, the number of the at least one first candidate box is detected. In response to the number of the at least one first candidate box being greater than a first preset number, a reference detection box is determined based on the confidence corresponding to each first candidate box, and the perimeter intersection over union (IoU) between each second candidate box (the first candidate boxes other than the reference detection box among the at least one first candidate box) and the reference detection box is obtained. Further, based on the magnitude relationship between the perimeter IoU corresponding to each second candidate box and a first preset threshold, at least one third candidate box is obtained. In response to the at least one third candidate box satisfying a first preset condition, the at least one third candidate box and the reference detection box are determined as the target detection box. Thus, in the embodiments of the present disclosure, the third candidate box is determined by using the perimeter IoU between the second candidate box (other than the reference detection box) in the first candidate box and the reference detection box, and the target detection box is determined according to whether the third candidate box satisfies the first preset condition, realizing the deletion of redundant candidate boxes of objects in the image, thereby realizing the efficient determination of the object target detection box.

[0009] In addition, the embodiments of the present disclosure also creatively use the perimeter intersection over union to determine the target detection box, reducing the amount of multiplication operations, reducing the operation difficulty, thereby reducing the requirement for the computing power of the processor, improving the operation speed of the processor, further shortening the processing time of the processor, and further effectively improving the determination efficiency of the target detection box, and further improving the target detection efficiency.

[0010] The technical solution of the present disclosure will be further described in detail below with reference to the drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] By describing the embodiments of the present disclosure in more detail in conjunction with the drawings, the above and other objects, features, and advantages of the present disclosure will become more obvious. The drawings are used to provide a further understanding of the embodiments of the present disclosure, and constitute a part of the specification, and are used to explain the present disclosure together with the embodiments of the present disclosure, and do not constitute a limitation to the present disclosure. In the drawings, the same reference numerals generally represent the same components or steps.

[0012] Figure 1 is an exemplary application scenario of the method for generating a target detection box provided by the present disclosure.

[0013] Figure 2 is a flowchart of the method for generating a target detection box provided by an exemplary embodiment of the present disclosure.

[0014] Figure 3 is a flowchart of the method for generating a target detection box provided by another exemplary embodiment of the present disclosure.

[0015] Figure 4 It is a schematic diagram of the preliminary object detection result of the image to be processed provided by an exemplary embodiment of the present disclosure.

[0016] Figure 5 It is a schematic diagram of the object detection result of the image to be processed provided by an exemplary embodiment of the present disclosure.

[0017] Figure 6 It is a schematic flowchart of step S230 provided by an exemplary embodiment of the present disclosure.

[0018] Figure 7 It is a schematic diagram of the second candidate box and the reference detection box provided by an exemplary embodiment of the present disclosure.

[0019] Figure 8 It is a schematic flowchart of step S230 provided by another exemplary embodiment of the present disclosure.

[0020] Figure 9 It is a schematic flowchart of the method for generating the target detection box provided by another exemplary embodiment of the present disclosure.

[0021] Figure 10 It is an overall flowchart of the method for generating the target detection box provided by an exemplary embodiment of the present disclosure.

[0022] Figure 11 It is an overall flowchart of the method for generating the target detection box provided by another exemplary embodiment of the present disclosure.

[0023] Figure 12 It is a schematic structural diagram of the device for generating the target detection box provided by an exemplary embodiment of the present disclosure.

[0024] Figure 13 It is a schematic structural diagram of the device for generating the target detection box provided by another exemplary embodiment of the present disclosure.

[0025] Figure 14 It is a structural diagram of the electronic device provided by an exemplary embodiment of the present disclosure. Detailed Embodiments

[0026] Next, exemplary embodiments according to the present disclosure will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all the embodiments of the present disclosure. It should be understood that the present disclosure is not limited by the exemplary embodiments described herein.

[0027] It should be noted that: unless otherwise specifically stated, the relative arrangements of components and steps, numerical expressions and values set forth in these embodiments do not limit the scope of the present disclosure.

[0028] Those skilled in the art can understand that terms such as "first" and "second" in the embodiments of the present disclosure are only used to distinguish different steps, devices or modules, etc., and neither represent any specific technical meaning nor indicate an inevitable logical order between them.

[0029] It should also be understood that in the embodiments of the present disclosure, "a plurality" may refer to two or more, and "at least one" may refer to one, two or more.

[0030] It should also be understood that for any component, data or structure mentioned in the embodiments of the present disclosure, in the absence of a clear limitation or a contrary indication in the context, it is generally understood to be one or more.

[0031] In addition, the term "and / or" in the present disclosure is merely a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in the present disclosure generally represents an "or" relationship between the associated objects before and after.

[0032] It should also be understood that the description of each embodiment in the present disclosure emphasizes the differences between the embodiments, and their similarities can be referred to each other. For the sake of brevity, they will not be elaborated one by one.

[0033] At the same time, it should be understood that for the convenience of description, the dimensions of the various parts shown in the drawings are not drawn in actual proportional relationship.

[0034] The following description of at least one exemplary embodiment is actually merely illustrative and in no way constitutes a limitation on the present disclosure and its application or use.

[0035] Technologies, methods and devices known to those of ordinary skill in the relevant art may not be discussed in detail, but where appropriate, the said technologies, methods and devices should be regarded as part of the specification.

[0036] It should be noted that like reference numerals and letters denote like items in the following figures, and thus, once an item is defined in one figure, it need not be further discussed in subsequent figures.

[0037] Embodiments of the present disclosure can be applied to electronic devices such as terminal devices, computer systems, servers, etc., which can operate together with many other general or special computing system environments or configurations. Examples of well-known terminal devices, computing systems, environments, and / or configurations suitable for use with electronic devices such as terminal devices, computer systems, servers, etc. include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers, small computer systems, large computer systems, and distributed cloud computing technology environments including any of the above systems, and so on.

[0038] Electronic devices such as terminal devices, computer systems, servers, etc. can be described in the general context of computer system-executable instructions (such as program modules) executed by a computer system. Generally, program modules can include routines, programs, object programs, components, logics, data structures, etc., which perform specific tasks or implement specific abstract data types. The computer system / server can be implemented in a distributed cloud computing environment where tasks are executed by remote processing devices linked through a communication network. In a distributed cloud computing environment, program modules can be located on local or remote computing system storage media including storage devices.

[0039] Summary of the Application

[0040] In the process of implementing the present disclosure, the inventors found that in object detection currently, usually each target object is framed by multiple candidate boxes, and one or more redundant candidate boxes appear. At this time, redundant candidate boxes need to be removed to obtain an accurate object detection result of the target object.

[0041] Exemplary System

[0042] The present disclosure can be applied to object detection in any field and application scenario. For example, it can be applied to the detection process of road signs, dynamic obstacles (such as vehicles or pedestrians, etc.) in autonomous driving to remove redundant candidate boxes and determine the target detection box.

[0043] Figure 1An applicable scenario of the present disclosure is shown. The applicable scenario includes an image acquisition device, a processing device, and a display device. The image acquisition device is used to acquire an image to be processed and transmit the acquired image to be processed to the processing device. The processing device can perform object detection on the image to be processed according to a pre-trained neural network for object detection, etc., to obtain a preliminary object detection result in the image to be processed. The preliminary object detection result includes all first candidate boxes of the object. When the number of first candidate boxes is greater than a first preset number, a reference detection box is determined according to the confidence of the first candidate boxes. The perimeter intersection over union between the reference detection box and the second candidate boxes (first candidate boxes other than the reference detection box) is determined. Through the size relationship between the perimeter intersection over union and a first preset threshold, a third candidate box is obtained. It is determined whether the third candidate box meets a first preset condition, and when the first preset condition is met, the third candidate box and the reference detection box are determined as target detection boxes, and the object detection result of the image to be processed is output. The object detection result includes the image to be processed and the target detection boxes. Among them, the image acquisition device can be a monocular camera, a binocular camera, or a TOF (time of flight) camera, etc. The processing device can be a processor with computing functions, such as a server, a computing terminal, etc. The display device can be a display screen, etc.

[0044] The present disclosure determines the third candidate box by using the perimeter intersection over union between the second candidate box and the reference detection box, and determines the target detection box according to whether the third candidate box meets the first preset condition, thereby realizing the deletion of redundant candidate boxes of the object in the image, and thus realizing the efficient determination of the target detection box of the object.

[0045] Exemplary Method

[0046] Figure 2 It is a schematic flowchart of a method for generating a target detection box provided by an exemplary embodiment of the present disclosure. This embodiment can be applied to electronic devices, vehicles, computing terminals, etc., as Figure 2 shown, and includes the following steps:

[0047] Step S200, perform object detection on the image to be processed to obtain at least one first candidate box and the confidence of each first candidate box in the at least one first candidate box.

[0048] Among them, the image to be processed can be collected by an image acquisition device, and the image to be processed can be a grayscale image, an RGB (Red Green Blue) image, a depth image, etc. Object detection technology can be used to perform object detection on the image to be processed to obtain a preliminary detection result of object detection, and the preliminary detection result includes at least one first candidate box and the confidence of each first candidate box. Among them, the confidence of the first candidate box represents the probability that the object framed by the first candidate box belongs to a certain classification. In a specific implementation, the detection box used to frame the object obtained after performing object detection on the processed image can be used as the first candidate box.

[0049] Exemplarily, the image to be processed can be input into a pre-trained neural network for object detection, and the neural network outputs a preliminary detection result of object detection of the image to be processed. The neural network can be YOLO (You Only Look Once), CNN (Convolutional Neural Networks), R-CNN (Region Convolutional Neural Networks), etc.

[0050] Step S210: Detect the number of at least one first candidate box.

[0051] Among them, calculate the number of candidate boxes of the first candidate boxes on the image to be processed.

[0052] Step S220: In response to the number of at least one first candidate box being greater than a first preset number, determine a reference detection box based on the confidence of each first candidate box respectively.

[0053] Among them, the first preset number can be set according to actual needs. For example, the first preset number can be 1. The screening conditions for the reference detection box can be preset based on the confidence. According to the confidence of each first candidate box, the first candidate boxes that meet the screening conditions of the reference detection box preset are selected as the reference detection boxes.

[0054] Exemplarily, the screening condition for the reference detection box can be to determine the candidate box with the highest confidence as the reference detection box. Compare the number of first candidate boxes with the first preset number. When the number of first candidate boxes is greater than the first preset number, according to the confidence of each candidate box, the first candidate box with the highest confidence is selected from the first candidate boxes as the reference detection box.

[0055] Step S230: Obtain the perimeter intersection over union between each second candidate box in at least one second candidate box and the reference detection box.

[0056] Among them, at least one second candidate box is a first candidate box among at least one first candidate box except the reference detection box. The perimeter intersection over union ratio can be the overlapping rate of the perimeter of the second candidate box and the perimeter of the reference detection box. That is, the perimeter intersection over union ratio can be the ratio of the perimeter of the overlapping part between the reference detection box and the second candidate box to the sum of the perimeters of the second candidate box and the reference detection box except for the perimeter of the overlapping part.

[0057] Exemplarily, for any one second candidate box, the coordinate values of any three vertices of the second candidate box and the reference detection box can be obtained respectively. The coordinate values can be planar coordinate values or spatial coordinate values. According to the coordinate values of the three vertices of the second candidate box and the coordinate values of the three vertices of the reference detection box, the perimeter intersection over union ratio between the second candidate box and the reference detection box is calculated.

[0058] Step S240, based on the size relationship between the perimeter intersection over union ratio corresponding to each second candidate box and the first preset threshold, obtain at least one third candidate box.

[0059] Among them, the first preset threshold can be set according to the actual situation. The candidate box screened from the second candidate box according to the size relationship between the perimeter intersection over union ratio between the second candidate box and the reference detection box and the first preset threshold can be called the third candidate box.

[0060] Exemplarily, the perimeter intersection over union ratio between each second candidate box and the reference detection box can be compared with the first preset threshold, and the second candidate box with a perimeter intersection over union ratio greater than the first preset threshold can be removed to obtain the third candidate box.

[0061] Step S250, in response to at least one third candidate box satisfying the first preset condition, determine at least one third candidate box and the reference detection box as the target detection box.

[0062] Among them, the first preset condition can include a second preset quantity. Exemplarily, when the number of third candidate boxes is less than or equal to the second preset quantity, it is determined that the third candidate box satisfies the first preset condition, and the third candidate box and the reference detection box are determined as the target detection box. The target detection box is the final detection box of the object in the image to be processed. When the target detection box is determined, the object detection result of the image to be processed can be output, and the object detection result includes the target detection box and the image to be processed.

[0063] It should be noted that when the number of objects included in the image to be processed is 1, the finally obtained third candidate box and the reference detection box are the same detection box.

[0064] In the embodiments of the present disclosure, by using the perimeter intersection over union between the second candidate box in the first candidate box except the reference detection box and the reference detection box to determine the third candidate box, and determining the target detection box according to whether the third candidate box meets the first preset condition, the deletion of redundant candidate boxes of objects in the image is realized, thereby realizing the efficient determination of the object target detection box. In addition, the embodiments of the present disclosure also creatively use the perimeter intersection over union to determine the target detection box. Compared with the method of using the area intersection over union to determine the target detection box in the related art, the amount of computation can be significantly reduced, the computational difficulty can be reduced, thereby reducing the requirement for the computing power of the processor, improving the computing speed of the processor, and then shortening the processing time of the processor, effectively improving the determination efficiency of the target detection box, and further improving the target detection efficiency.

[0065] In an alternative embodiment, the embodiments of the present disclosure further include: in response to at least one third candidate box not meeting the first preset condition, taking at least one third candidate box as at least one first candidate box, and performing an operation of determining a reference detection box based on the confidence levels respectively corresponding to the first candidate boxes.

[0066] Wherein, when the third candidate box does not meet the first preset condition, steps S220 and the steps after step S220 are executed until the third candidate box meets the first preset condition.

[0067] Exemplarily, in response to the number of third candidate boxes being greater than the second preset number, it is determined that the third candidate box does not meet the first preset condition. The third candidate box is taken as the first candidate box. Among the newly determined first candidate boxes, a reference detection box is re-determined according to the confidence levels of the newly determined first candidate boxes. The perimeter intersection over union between each newly determined second candidate box and the newly determined reference detection box is respectively obtained, wherein the newly determined second candidate box is the candidate box in the newly determined first candidate box except the newly determined detection reference box; according to the size relationship between the perimeter intersection over union between each newly determined second candidate box and the newly determined reference detection box and the first preset threshold, a new third candidate box is determined. When the new third candidate box meets the first preset condition, the new third candidate box and all reference detection boxes are determined as the target detection box. When the new third candidate box does not meet the first preset condition, the new third candidate box is taken as the first candidate box, and steps S220 and the steps after step S220 are continued to be executed until the third candidate box meets the first preset condition.

[0068] In the embodiments of the present disclosure, when the third candidate box does not meet the first preset condition, the third candidate box is taken as the first candidate box to re-execute the operation of determining the reference detection box based on the confidence levels respectively corresponding to the first candidate boxes and the operations after this operation until the third candidate box meets the first preset condition, realizing the one-time deletion of redundant candidate boxes of multiple objects in the image.

[0069] In one implementation, asFigure 3 As shown, the method for generating a target detection box in an embodiment of the present disclosure may include the following steps:

[0070] Step S300: Perform object detection on the image to be processed to obtain at least one first candidate box and the confidence of each first candidate box in the at least one candidate box.

[0071] Step S310: Determine the candidate box with the highest confidence in the at least one first candidate box as the reference detection box.

[0072] Step S320: In response to the number of second candidate boxes being greater than 1, respectively obtain the perimeter intersection over union between each second candidate box and the reference detection box determined most recently, where the second candidate box is a candidate box other than the reference detection box in the at least one first candidate box.

[0073] Step S330: Remove the second candidate boxes with a perimeter intersection over union greater than the first preset threshold to obtain third candidate boxes.

[0074] Step S340: In response to the number of third candidate boxes being greater than 1, use the third candidate boxes as the at least one first candidate box and perform the operation of determining the candidate box with the highest confidence in the at least one first candidate box as the reference detection box;

[0075] Step S350: In response to the number of third candidate boxes being equal to 1, determine the third candidate box and all reference detection boxes as the target detection boxes.

[0076] In an alternative embodiment, the image to be processed may include one or more objects. When the image to be processed includes multiple objects, for example, Figure 4 shows the preliminary object detection result of the image to be processed, such as Figure 4 as shown, Figure 4 which has three objects (cups) and multiple first candidate boxes. At this time, detect the number of first candidate boxes. When the number of first candidate boxes is greater than the first preset number, determine the first candidate box with the highest confidence as the reference detection box, determine the perimeter intersection over union between the second candidate boxes (all first candidate boxes other than the reference detection box in the image to be processed) and the reference detection box, delete the second candidate boxes with a perimeter intersection over union greater than the first preset threshold to obtain third candidate boxes. When the number of third candidate boxes is less than or equal to the second preset number, determine the third candidate box and the reference detection box as the target detection boxes, and output the object detection result of the image to be processed. For example, Figure 5 shows the object detection result of the image to be processed, such as Figure 5The object detection results of the to-be-processed image shown include: three objects (cups), and each object has a target detection box. When the number of third candidate boxes is greater than the second preset number, all the third candidate boxes are used as the first candidate boxes to perform the operation of determining the reference detection box as the first candidate box with the highest confidence, and perform the subsequent operations until the number of third candidate boxes is less than or equal to the second preset number.

[0077] In an alternative embodiment, as Figure 6 shown, step S230 of the embodiments of the present disclosure may include the following steps:

[0078] Step S231, obtain the coordinate values of the four vertices of each second candidate box in at least one second candidate box, and obtain the coordinate values of the four vertices of the reference detection box.

[0079] Wherein, each second candidate box and the reference detection box are located in the same coordinate system, and this coordinate system can be a plane coordinate system or a spatial rectangular coordinate system, and obtain the coordinate values of the four vertices of each second candidate box and the coordinate values of the four vertices of the reference detection box.

[0080] Step S232, for each second candidate box in at least one second candidate box, based on the coordinate values of the four vertices of the second candidate box and the reference detection box, determine the perimeter intersection over union between the second candidate box and the reference detection box.

[0081] Wherein, for each second candidate box, according to the coordinate values of the four vertices of the second candidate box and the coordinate values of the four vertices of the reference detection box, calculate the ratio of the perimeter of the overlapping part between the reference detection box and the second candidate box to the sum of the perimeters of the second candidate box and the reference detection box except for the perimeter of the overlapping part (perimeter intersection over union).

[0082] Exemplarily, FIG. 7 shows a schematic diagram of the relationship between the second candidate box and the reference detection box. As Figure 7 shown, the coordinate values of the four vertices of the reference detection box are respectively (A1, B1), (A2, B1), (A1, B2), (A2, B2); the coordinate values of the four vertices of the second candidate box are respectively (C1, D1), (C2, D1), (C1, D2), (C2, D2); calculate the perimeter intersection over union between the second candidate box and the reference detection box according to formula (1).

[0083]

[0084] In the embodiments of the present disclosure, by respectively calculating the sum of the perimeter of the overlapping part between the reference detection box and the second candidate box and the perimeter of the second candidate box other than the overlapping part with the reference detection box according to the coordinate values of the four vertices of the second candidate box and the reference detection box, and calculating the perimeter intersection over union ratio between the second candidate box and the reference detection box through the above data, the rapid and accurate determination of the perimeter intersection over union ratio is realized, providing a reliable data basis for determining the target detection box according to the perimeter intersection over union ratio in the subsequent process.

[0085] In an alternative embodiment, as Figure 8 shown, step S230 of the embodiments of the present disclosure may include the following steps:

[0086] Step S233, obtaining the coordinate values of the center point and any vertex of each second candidate box in at least one second candidate box, and obtaining the coordinate values of the center point and any vertex of the reference detection box;

[0087] Among them, the coordinate values of the center points of the second candidate box and the reference detection box can be determined respectively according to the contour data of the second candidate box and the reference detection box.

[0088] Step S234, for each second candidate box in at least one second candidate box, determining the perimeter intersection over union ratio between the second candidate box and the reference detection box based on the coordinate values of the center point and any vertex of the second candidate box, and the coordinate values of the center point and any vertex of the reference detection box.

[0089] Among them, for each second candidate box, according to the coordinate values of a vertex and the center point of the second candidate box, and the coordinate values of a vertex and the center point of the reference detection box, calculate the ratio (perimeter intersection over union ratio) of the sum of the perimeter of the overlapping part between the reference detection box and the second candidate box and the perimeter of the second candidate box other than the overlapping part with the reference detection box.

[0090] Exemplarily, the perimeter of the second candidate box can be calculated according to the coordinate values of a vertex and the center point of the second candidate box, the perimeter of the reference detection box can be calculated according to the coordinate values of a vertex and the center point of the reference detection box, the perimeter of the overlapping part between the second candidate box and the reference detection box can be calculated according to the coordinate values of a vertex and the center point of the second candidate box and the coordinate values of a vertex and the center point of the reference detection box, and the perimeter intersection over union ratio can be calculated according to the sum of the perimeter of the overlapping part between the reference detection box and the second candidate box and the perimeter of the second candidate box other than the overlapping part with the reference detection box.

[0091] In the embodiments of the present disclosure, by using the coordinate values of a vertex and the center point of the second candidate box and the reference detection box, the perimeter intersection over union (IoU) between the second candidate box and the reference candidate box is accurately determined, effectively improving the accuracy of subsequently determining the target detection box using the perimeter IoU.

[0092] In an alternative embodiment, after step S210, the embodiments of the present disclosure further include: in response to the number of at least one first candidate box being less than or equal to a first preset number, determining the at least one first candidate box as the target detection box.

[0093] Wherein, after performing object detection on the image to be processed, the number of first candidate boxes on the image to be processed is compared with the first preset number. When the number of first candidate boxes is less than or equal to the first preset number, the first candidate box is determined as the target detection box, that is, at this time, the first candidate box is the target detection box of the object in the image to be processed.

[0094] In an alternative embodiment, step S250 of the embodiments of the present disclosure may include: in response to the number of at least one third candidate box being less than or equal to a second preset number, determining that the at least one third candidate box meets a first preset condition, and determining the at least one third candidate box and the reference detection box as the target detection box.

[0095] Wherein, the second preset number can be set according to actual needs, and the second preset number and the first preset number can be the same or different.

[0096] Exemplarily, taking the second preset number as 1, the number of third candidate boxes is counted, and the number of third candidate boxes is compared with the second preset number. When the number of third candidate boxes is equal to the second preset number, it is determined that the third candidate box meets the first preset condition, and the third candidate box and the reference detection box are determined as the target detection box.

[0097] In an alternative embodiment, as Figure 9 shown, the embodiments of the present disclosure further include the following steps:

[0098] Step S400, obtaining the aspect ratio of each first candidate box.

[0099] Wherein, when the number of first candidate boxes is greater than the first preset number, after determining the reference detection box based on the confidence levels respectively corresponding to the first candidate boxes, the aspect ratio of each first candidate box is determined. The aspect ratio of the first candidate box can be the ratio of the length to the width of the first candidate box.

[0100] Exemplarily, the length and width of the first candidate box can be determined according to the coordinate values of the four vertices of the first candidate box, and the aspect ratio of the first candidate box is calculated based on the length and width of the first candidate box.

[0101] Step S410, in response to the aspect ratios of all the first candidate boxes being within a preset range, perform the operation of obtaining the perimeter intersection over union (IoU) between each of the at least one second candidate box and the reference detection box.

[0102] Among them, the preset range can be set according to the actual situation. For example, the preset range can be 0.5 to 1.5. When the aspect ratios of all the first candidate boxes are within the preset range, perform step S230 and the steps after step S230, that is, when the aspect ratios of all the first candidate boxes are within the preset range, the target detection box can be determined according to the perimeter intersection over union between the second candidate box and the reference detection box.

[0103] Step S420, in response to there being a first candidate box among the aspect ratios of the first candidate boxes that is not within the preset range, respectively obtain the area intersection over union between each second candidate box and the reference detection box.

[0104] Among them, when it is detected that there is a first candidate box among the aspect ratios of the first candidate boxes that is not within the preset range, calculate the area intersection over union between each second candidate box and the reference detection box. The area intersection over union between the second candidate box and the reference detection box can be the ratio of the area of the overlapping region between the second candidate box and the reference detection box to the sum of the areas of the second candidate box and the reference detection box.

[0105] Exemplarily, for each second candidate box, the coordinate values of the four vertices of the second candidate box and the coordinate values of the four vertices of the reference detection box can be obtained, and according to the coordinate values of the four vertices of the second candidate box and the coordinate values of the four vertices of the reference detection box, the area intersection over union between the second candidate box and the reference detection box can be determined.

[0106] Step S430, based on the magnitude relationship between the area intersection over union corresponding to each second candidate box and a second preset threshold, obtain at least one fourth candidate box.

[0107] Among them, the second preset threshold can be set according to actual requirements. The second preset threshold can be the same as or different from the first preset threshold.

[0108] Exemplarily, according to the area intersection over union corresponding to each second candidate box and the second preset threshold, the second candidate boxes with an area intersection over union greater than the second preset threshold can be removed to obtain the fourth candidate box. The second candidate boxes remaining after removing the second candidate boxes with an area intersection over union greater than the second preset threshold are the fourth candidate boxes.

[0109] Step S440, in response to at least one fourth candidate box satisfying a second preset condition, determine the at least one fourth candidate box and the reference detection box as the target detection box.

[0110] Among them, the second preset condition may include a third preset quantity. Exemplarily, the quantity of the fourth candidate boxes is counted. When the quantity of the fourth candidate boxes is less than or equal to the third preset quantity, it is determined that the fourth candidate boxes meet the second preset condition, and the fourth candidate boxes and the reference detection boxes are determined as the target detection boxes.

[0111] In the embodiments of the present disclosure, by using the aspect ratios of the first candidate boxes, the method of perimeter intersection over union or area intersection over union is selected to eliminate redundant candidate boxes and determine the target detection boxes. The method for eliminating redundant candidate boxes and determining the target detection boxes can be selected according to the actual situation of object detection, effectively improving the accuracy of deleting redundant candidate boxes in object detection, and thus improving the accuracy of determining the target detection boxes.

[0112] In an alternative embodiment, as Figure 9 shown, the embodiments of the present disclosure further include the following steps:

[0113] Step S450, in response to at least one fourth candidate box not meeting the second preset condition, taking at least one fourth candidate box as at least one first candidate box, and performing the operation of determining the reference detection box based on the confidence levels respectively corresponding to the first candidate boxes.

[0114] Among them, in response to at least one fourth candidate box not meeting the second preset condition, taking at least one fourth candidate box as at least one first candidate box, and performing the operation of determining the reference detection box based on the confidence levels respectively corresponding to the first candidate boxes.

[0115] Among them, when the fourth candidate box does not meet the second preset condition, step S220 and the steps after step S220 are executed until the fourth candidate box meets the second preset condition or the third candidate box meets the first preset condition.

[0116] Exemplarily, in response to the quantity of the fourth candidate boxes being greater than the third preset quantity, it is determined that the fourth candidate boxes do not meet the second preset condition. Taking the fourth candidate boxes as the first candidate boxes, in the newly determined first candidate boxes, the reference detection boxes are re-determined according to the confidence levels of the newly determined first candidate boxes. It is determined whether the aspect ratios of the newly determined first candidate boxes are all within the preset range. When the aspect ratios of the newly determined first candidate boxes are all within the preset range, the target detection boxes are determined according to the perimeter intersection over union between the second candidate boxes and the reference detection boxes; when there is a first candidate box among the newly determined first candidate boxes whose aspect ratio is not within the preset range, the target detection boxes are determined according to the area intersection over union of the newly determined second candidate boxes. The above operations are cycled until the third candidate box meets the first preset condition or the fourth candidate box meets the second preset condition.

[0117] In an embodiment of the present disclosure, when the fourth candidate box does not meet the second preset condition, the fourth candidate box is used as the first candidate box, and the operations of determining the reference detection box based on the confidence levels respectively corresponding to the first candidate boxes and the subsequent operations are performed again until the third candidate box meets the first preset condition or the fourth candidate box meets the second preset condition, thereby achieving the ability to select a suitable method to remove redundant candidate boxes for multiple objects at one time according to the actual object detection situation, determine the target detection box, and improve the object detection efficiency.

[0118] In an alternative embodiment, step S440 in the embodiments of the present disclosure includes: in response to the number of at least one fourth candidate box being less than or equal to a third preset number, determining that at least one fourth candidate box meets the second preset condition, and determining the at least one fourth candidate box and the reference detection box as the target detection box.

[0119] Wherein, the third preset number can be set according to actual requirements, and the third preset number can be the same as or different from the first preset number and the second preset number.

[0120] Exemplarily, taking the third preset number as 1, the number of fourth candidate boxes is counted, and the number of fourth candidate boxes is compared with the third preset number. When the number of fourth candidate boxes is equal to the third preset number, it is determined that the fourth candidate box meets the second preset condition, and the fourth candidate box and the reference detection box are determined as the target detection box.

[0121] In an alternative embodiment, Figure 10 a general flowchart of a method for generating a target detection box provided by an exemplary embodiment of the present disclosure is disclosed. The specific operations of each step have been described in detail in the foregoing content and will not be elaborated here.

[0122] A1. Perform object detection on the image to be processed to obtain at least one first candidate box and the confidence level of each first candidate box in the at least one first candidate box.

[0123] A2. Detect the number of first candidate boxes.

[0124] A3. Determine whether the number of first candidate boxes is less than or equal to a first preset number (the first preset number is, for example, 1). When the number of first candidate boxes is less than or equal to the first preset number, perform step A4; when the number of first candidate boxes is greater than the first preset number, perform step A5.

[0125] A4. Determine the first candidate box as the target detection box, and then do not execute the subsequent processes of this embodiment.

[0126] A5. Based on the confidence levels respectively corresponding to the first candidate boxes, determine the first candidate box with the highest confidence level as the reference detection box.

[0127] A6. Obtain the perimeter intersection over union (IoU) between each second candidate box and the reference detection box, where the second candidate box is the first candidate box in the first candidate boxes except the reference detection box.

[0128] A7. Based on the size relationship between the perimeter IoU corresponding to each second candidate box and the first preset threshold, remove the second candidate boxes with a perimeter IoU greater than the first preset threshold to obtain at least one third candidate box.

[0129] A8. Determine whether the number of third candidate boxes is less than or equal to the second preset number. When the number of third candidate boxes is less than or equal to the second preset number, determine that the third candidate boxes meet the first preset condition and execute step A9. When the number of third candidate boxes is greater than the second preset number, determine that the third candidate boxes do not meet the first preset condition and execute step A10.

[0130] A9. Determine the third candidate boxes and all reference detection boxes as the target detection boxes, and then do not execute the subsequent operations of this embodiment.

[0131] A10. Take all the third candidate boxes as the first candidate boxes, and then execute step A5.

[0132] In an alternative embodiment, Figure 11 Disclosed is an overall flowchart of a method for generating a target detection box provided by an exemplary embodiment of the present disclosure. Among them, the specific operations of each step have been described in detail in the foregoing content and will not be repeated here.

[0133] B1. Perform object detection on the image to be processed to obtain at least one first candidate box and the confidence of each first candidate box in the at least one first candidate box.

[0134] B2. Detect the number of first candidate boxes.

[0135] B3. Determine whether the number of first candidate boxes is less than or equal to the first preset number. When the number of first candidate boxes is less than or equal to the first preset number, execute step B4. When the number of first candidate boxes is greater than the first preset number, execute step B5.

[0136] B4. Determine the first candidate boxes as the target detection boxes, and then do not execute the subsequent process of this embodiment.

[0137] B5. Based on the confidence corresponding to each first candidate box, determine the first candidate box with the highest confidence as the reference detection box.

[0138] B6. Obtain the aspect ratio of each first candidate box.

[0139] B7. Determine whether the aspect ratios of all the first candidate boxes are within a preset range. When the aspect ratios of all the first candidate boxes are within the preset range, execute step B8. When it is determined that there is a first candidate box whose aspect ratio is not within the preset range, execute step B13.

[0140] B8. Obtain the perimeter intersection over union (IoU) between each second candidate box and a reference detection box, where the second candidate box is a first candidate box other than the reference detection box among the first candidate boxes.

[0141] B9. Based on the magnitude relationship between the perimeter IoU corresponding to each second candidate box and a first preset threshold, remove the second candidate boxes whose perimeter IoU is greater than the first preset threshold to obtain at least one third candidate box.

[0142] B10. Determine whether the number of third candidate boxes is less than or equal to a second preset number. When the number of third candidate boxes is less than or equal to the second preset number, determine that the third candidate boxes meet the first preset condition and execute step B11. When the number of third candidate boxes is greater than the second preset number, determine that the third candidate boxes do not meet the first preset condition and execute step B12.

[0143] B11. Determine the third candidate boxes and all the reference detection boxes as target detection boxes, and then do not execute the subsequent operations of this embodiment.

[0144] B12. Take all the third candidate boxes as the first candidate boxes, and then execute step B5.

[0145] B13. Obtain the area IoU between each second candidate box and the reference detection box respectively.

[0146] B14. Based on the magnitude relationship between the area IoU corresponding to each second candidate box and a second preset threshold, remove the second candidate boxes whose area IoU is greater than the second preset threshold to obtain fourth candidate boxes.

[0147] B15. Determine whether the number of fourth candidate boxes is less than or equal to a third preset number. When the number of fourth candidate boxes is less than or equal to the third preset number, determine that the fourth candidate boxes meet the second preset condition and execute step B16. When the number of fourth candidate boxes is greater than the third preset number, determine that the fourth candidate boxes do not meet the second preset condition and execute step B17.

[0148] B16. Determine the fourth candidate boxes and all the reference detection boxes as target detection boxes, and then do not execute the subsequent operations of this embodiment.

[0149] B17. Take all the fourth candidate boxes as the first candidate boxes, and then execute step B5.

[0150] Any method for generating a target detection box provided by an embodiment of the present disclosure may be executed by any suitable device with data processing capabilities, including but not limited to: terminal devices, servers, etc. Alternatively, any method for generating a target detection box provided by an embodiment of the present disclosure may be executed by a processor. For example, the processor executes any method for generating a target detection box mentioned in an embodiment of the present disclosure by calling corresponding instructions stored in a memory. This will not be elaborated further below.

[0151] Exemplary Apparatus

[0152] Figure 12 is a schematic structural diagram of a device for generating a target detection box provided by an exemplary embodiment of the present disclosure. The device in this embodiment can be used to implement the corresponding method embodiment of the present disclosure, such as Figure 12 The device shown includes: an image processing module 500, a detection module 510, a first response module 520, a first acquisition module 530, a first comparison module 540, and a second response module 550.

[0153] The image processing module 500 is configured to perform object detection on the image to be processed, obtain at least one first candidate box and the confidence level of each first candidate box in at least one of the first candidate boxes;

[0154] The detection module 510 is configured to detect the number of at least one of the first candidate boxes;

[0155] The first response module 520 is configured to, in response to the number of at least one of the first candidate boxes being greater than a first preset number, determine a reference detection box based on the confidence levels respectively corresponding to the first candidate boxes;

[0156] The first acquisition module 530 is configured to acquire the perimeter intersection over union between each of at least one second candidate box and the reference detection box, where at least one of the second candidate boxes is a first candidate box other than the reference detection box among at least one of the first candidate boxes;

[0157] The first comparison module 540 is configured to obtain at least one third candidate box based on the magnitude relationship between the perimeter intersection over union respectively corresponding to each of the second candidate boxes and a first preset threshold;

[0158] The second response module 550 is configured to, in response to at least one of the third candidate boxes satisfying a first preset condition, determine at least one of the third candidate boxes and the reference detection box as the target detection box.

[0159] In an optional example, as Figure 13 shown, the device of an embodiment of the present disclosure further includes:

[0160] The third response module 560 is configured to, in response to at least one of the third candidate boxes not meeting the first preset condition, use at least one of the third candidate boxes as at least one of the first candidate boxes, and perform the operation of determining the reference detection box based on the confidence levels respectively corresponding to the first candidate boxes.

[0161] In an alternative example, as Figure 13 shown, the first acquisition module 530 of the embodiments of the present disclosure may include:

[0162] The first acquisition sub-module 531 is configured to acquire the coordinate values of the four vertices of each of the second candidate boxes among at least one of the second candidate boxes, and acquire the coordinate values of the four vertices of the reference detection box;

[0163] The first determination sub-module 532 is configured to, for each of the second candidate boxes among at least one of the second candidate boxes, determine the perimeter intersection over union between the second candidate box and the reference detection box based on the coordinate values of the four vertices of the second candidate box and the reference detection box.

[0164] In an alternative example, as Figure 13 shown, the first acquisition module 530 of the embodiments of the present disclosure may further include:

[0165] The second acquisition sub-module 533 is configured to acquire the coordinate value of the center point and the coordinate value of any one vertex of each of the second candidate boxes among at least one of the second candidate boxes, and acquire the coordinate value of the center point and the coordinate value of any one vertex of the reference detection box;

[0166] The second determination sub-module 534 is configured to, for each of the second candidate boxes among at least one of the second candidate boxes, determine the perimeter intersection over union between the second candidate box and the reference detection box based on the coordinate value of the center point and the coordinate value of any one vertex of the second candidate box, and the coordinate value of the center point and the coordinate value of any one vertex of the reference detection box.

[0167] In an alternative example, the first response module 520 of the embodiments of the present disclosure is further configured to, in response to the number of at least one of the first candidate boxes being less than or equal to a first preset number, determine at least one of the first candidate boxes as the target detection box.

[0168] In an alternative example, the second response module 550 of the embodiments of the present disclosure is further configured to, in response to the number of at least one of the third candidate boxes being less than or equal to a second preset number, determine that at least one of the third candidate boxes meets the first preset condition, and determine at least one of the third candidate boxes and the reference detection box as the target detection box.

[0169] In an alternative example, as Figure 13As shown, the apparatus according to an embodiment of the present disclosure further includes:

[0170] A second acquisition module 570, configured to acquire the aspect ratios of the first candidate boxes.

[0171] A fourth response module 580, configured to perform an operation of obtaining the perimeter intersection over union between each second candidate box in the at least one second candidate box and the reference detection box in response to the aspect ratios of all the first candidate boxes being within a preset range.

[0172] In an alternative example, as Figure 13 shown, the apparatus according to an embodiment of the present disclosure further includes:

[0173] A fifth response module 590, configured to respectively acquire the area intersection over union between each second candidate box and the reference detection box in response to there being a first candidate box among the aspect ratios of all the first candidate boxes that is not within the preset range.

[0174] A second comparison module 600, configured to obtain at least one fourth candidate box based on the magnitude relationship between the area intersection over union corresponding to each second candidate box and a second preset threshold.

[0175] A sixth response module 610, configured to determine at least one fourth candidate box and the reference detection box as target detection boxes in response to at least one of the fourth candidate boxes satisfying a second preset condition.

[0176] In an alternative example, as Figure 13 shown, the apparatus according to an embodiment of the present disclosure further includes:

[0177] A seventh response module 620, configured to use at least one of the fourth candidate boxes as at least one of the first candidate boxes and perform an operation of determining a reference detection box based on the confidence levels corresponding to the first candidate boxes in response to at least one of the fourth candidate boxes not satisfying a second preset condition.

[0178] In an alternative example, as Figure 13 shown, the sixth response module 610 according to an embodiment of the present disclosure is further configured to determine that at least one of the fourth candidate boxes satisfies the second preset condition and determine at least one of the fourth candidate boxes and the reference detection box as target detection boxes in response to the number of at least one of the fourth candidate boxes being less than or equal to a third preset number.

[0179] Exemplary Electronic Device

[0180] Next, an electronic device according to an embodiment of the present disclosure will be described with reference to Figure 14 FIG. Figure 14 FIG. is a block diagram of an electronic device according to an embodiment of the present disclosure.

[0181] As shown Figure 14 in the figure, the electronic device includes one or more processors 700 and a memory 710.

[0182] The processor 700 may be a central processing unit (CPU) or other forms of processing units with data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device to perform desired functions.

[0183] The memory 710 may include one or more computer program products, and the computer program products may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory, etc. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 710 may run the program instructions to implement the method for generating the target detection frame of each embodiment of the present disclosure described above and / or other desired functions. Various contents such as input signals, signal components, noise components, etc. may also be stored in the computer-readable storage medium.

[0184] In one example, the electronic device may further include: an input device 720 and an output device 730, and these components are interconnected through a bus system and / or other forms of connection mechanisms (not shown).

[0185] The input device 720 may be a microphone or a microphone array for capturing the input signal of the sound source. In addition, the input device 720 may further include, for example, a keyboard, a mouse, etc.

[0186] The output device 730 may output various information to the outside, including the determined distance information, direction information, etc. The output device 730 may include, for example, a display, a speaker, a printer, and a communication network and its connected remote output devices, etc.

[0187] Of course, for simplicity, Figure 14 only some of the components in the electronic device 14 related to the present disclosure are shown in the figure, and components such as buses, input / output interfaces, etc. are omitted. In addition, according to specific application scenarios, the electronic device may further include any other appropriate components.

[0188] Exemplary Computer Program Product and Computer Readable Storage Medium

[0189] In addition to the above methods and devices, embodiments of the present disclosure may also be computer program products, which include computer program instructions that, when run on a processor, cause the processor to execute the steps in the method for generating object detection frames according to various embodiments of the present disclosure described in the "Exemplary Methods" section above in this specification.

[0190] The computer program product may be written in any combination of one or more programming languages for programming code to perform the operations of the embodiments of the present disclosure. The programming languages include object-oriented programming languages such as Java, C++, etc., and also include conventional procedural programming languages such as the "C" language or similar programming languages. The programming code may be executed entirely on the user's computing device, partially on the user's device, executed as a stand-alone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0191] Furthermore, embodiments of the present disclosure may also be computer-readable storage media, on which computer program instructions are stored, and the computer program instructions, when run on a processor, cause the processor to execute the steps in the method for generating object detection frames according to various embodiments of the present disclosure described in the "Exemplary Methods" section above in this specification.

[0192] The computer-readable storage media may adopt any combination of one or more readable media. The readable media may be a readable signal medium or a readable storage medium. The readable storage medium may, for example, include but is not limited to an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0193] The basic principles of the present disclosure have been described above in conjunction with specific embodiments. However, it should be noted that the advantages, benefits, effects, etc. mentioned in the present disclosure are only examples and not limitations, and it cannot be considered that these advantages, benefits, effects, etc. are essential for each embodiment of the present disclosure. In addition, the above-disclosed specific details are only for the purposes of illustration and facilitating understanding, rather than limitations. The above details do not limit the present disclosure to necessarily adopt the above specific details for implementation.

[0194] In the present specification, the various embodiments are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts among the embodiments, reference may be made to each other. For system embodiments, since they basically correspond to method embodiments, they are described relatively simply. For related parts, reference may be made to the partial descriptions of method embodiments.

[0195] The block diagrams of devices, apparatuses, equipment, and systems involved in the present disclosure are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any way. Words such as "including", "comprising", "having", etc. are open-ended terms, meaning "including but not limited to", and can be used interchangeably with each other. The word "or" and "and" used herein refer to the word "and / or", and can be used interchangeably with each other, unless the context clearly indicates otherwise. The word "such as" used herein refers to the phrase "such as but not limited to", and can be used interchangeably with each other.

[0196] The methods and apparatuses of the present disclosure can be implemented in many ways. For example, the methods and apparatuses of the present disclosure can be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of the steps for the methods is only for illustration. The steps of the methods of the present disclosure are not limited to the specific order described above, unless otherwise specifically stated. In addition, in some embodiments, the present disclosure can also be implemented as a program recorded in a recording medium, and these programs include machine-readable instructions for implementing the methods according to the present disclosure. Therefore, the present disclosure also covers a recording medium storing a program for executing the methods according to the present disclosure.

[0197] It should also be noted that in the apparatuses, equipment, and methods of the present disclosure, each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent solutions of the present disclosure.

[0198] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be very apparent to those skilled in the art, and the general principles defined herein can be applied to other aspects without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the aspects shown herein, but rather to the broadest scope consistent with the principles and novel features disclosed herein.

[0199] The foregoing description has been presented for purposes of illustration and description. Furthermore, this description is not intended to limit embodiments of the present disclosure to the form disclosed herein. Although several example aspects and embodiments have been discussed above, those skilled in the art will recognize some variations, modifications, alterations, additions, and sub-combinations thereof.

Claims

1. A method for generating a target detection box, comprising: Performing object detection on an image to be processed to obtain at least one first candidate box and the confidence of each first candidate box in the at least one first candidate box; Detecting the number of at least one of the first candidate boxes; In response to the number of at least one of the first candidate boxes being greater than a first preset number, determining a reference detection box based on the confidence corresponding to each of the first candidate boxes; Obtaining the perimeter intersection over union (IoU) between each of at least one second candidate box and the reference detection box, wherein the at least one second candidate box is the first candidate box other than the reference detection box in the at least one first candidate box, and the perimeter IoU is the ratio of the perimeter of the overlapping part between the reference detection box and the second candidate box to the sum of the perimeters of the second candidate box and the reference detection box excluding the perimeter of the overlapping part; Obtaining at least one third candidate box based on the size relationship between the perimeter IoU corresponding to each of the second candidate boxes and a first preset threshold; In response to at least one of the third candidate boxes satisfying a first preset condition, determining the at least one third candidate box and the reference detection box as the target detection box.

2. The method according to claim 1, wherein, Further comprising: In response to at least one of the third candidate boxes not satisfying the first preset condition, using the at least one third candidate box as the at least one first candidate box and performing the operation of determining a reference detection box based on the confidence corresponding to each of the first candidate boxes.

3. The method according to claim 1 or 2, wherein The obtaining the perimeter IoU between each of at least one second candidate box and the reference detection box includes: Obtaining the coordinate values of the four vertices of each of the at least one second candidate box and obtaining the coordinate values of the four vertices of the reference detection box; For each of the at least one second candidate box, determining the perimeter IoU between the second candidate box and the reference detection box based on the coordinate values of the four vertices of the second candidate box and the reference detection box.

4. The method according to claim 1 or 2, wherein The obtaining the perimeter IoU between each of at least one second candidate box and the reference detection box includes: Obtaining the coordinate value of the center point and the coordinate value of any one vertex of each of the at least one second candidate box, and obtaining the coordinate value of the center point and the coordinate value of any one vertex of the reference detection box; For each of the at least one second candidate box, determining the perimeter IoU between the second candidate box and the reference detection box based on the coordinate value of the center point and the coordinate value of any one vertex of the second candidate box, and the coordinate value of the center point and the coordinate value of any one vertex of the reference detection box.

5. The method according to claim 1, wherein, After detecting the number of the at least one first candidate box, further comprising: In response to the number of at least one of the first candidate boxes being less than or equal to the first preset number, determining the at least one first candidate box as the target detection box.

6. The method according to claim 1, wherein, The in response to at least one of the third candidate boxes satisfying the first preset condition, determining the at least one third candidate box and the reference detection box as the target detection box, includes: In response to the number of at least one of the third candidate boxes being less than or equal to a second preset number, determine that at least one of the third candidate boxes meets the first preset condition, and determine at least one of the third candidate boxes and the reference detection box as the target detection box.

7. The method according to claim 1, wherein, After determining the reference detection box based on the confidence levels respectively corresponding to the first candidate boxes in response to the number of at least one of the first candidate boxes being greater than a first preset number, further include: Obtain the aspect ratios of the first candidate boxes. In response to the aspect ratios of the first candidate boxes all being within a preset range, perform the operation of obtaining the perimeter intersection over union between each second candidate box in at least one second candidate box and the reference detection box.

8. The method according to claim 7, further includes: In response to there being a first candidate box among the first candidate boxes whose aspect ratio is not within the preset range, respectively obtain the area intersection over union between each second candidate box and the reference detection box. Based on the magnitude relationship between the area intersection over union respectively corresponding to each second candidate box and a second preset threshold, obtain at least one fourth candidate box. In response to at least one of the fourth candidate boxes meeting a second preset condition, determine at least one of the fourth candidate boxes and the reference detection box as the target detection box.

9. The method according to claim 8, wherein, Further include: In response to at least one of the fourth candidate boxes not meeting the second preset condition, use at least one of the fourth candidate boxes as at least one of the first candidate boxes, and perform the operation of determining the reference detection box based on the confidence levels respectively corresponding to the first candidate boxes.

10. The method according to claim 8 or 9, wherein The step of determining at least one of the fourth candidate boxes and the reference detection box as the target detection box in response to at least one of the fourth candidate boxes meeting the second preset condition includes: In response to the number of at least one of the fourth candidate boxes being less than or equal to a third preset number, determine that at least one of the fourth candidate boxes meets the second preset condition, and determine at least one of the fourth candidate boxes and the reference detection box as the target detection box.

11. A target detection box generation device, including: An image processing module, configured to perform object detection on a to-be-processed image to obtain at least one first candidate box and the confidence level of each first candidate box in at least one of the first candidate boxes; A detection module, configured to detect the number of at least one of the first candidate boxes; A first response module, configured to determine a reference detection box based on the confidence levels respectively corresponding to the first candidate boxes in response to the number of at least one of the first candidate boxes being greater than a first preset number; A first acquisition module, configured to obtain the perimeter intersection over union between each second candidate box in at least one second candidate box and the reference detection box, where at least one second candidate box is a first candidate box other than the reference detection box among at least one of the first candidate boxes, and the perimeter intersection over union is the ratio of the perimeter of the overlapping part between the reference detection box and the second candidate box to the sum of the perimeters of the second candidate box and the reference detection box excluding the perimeter of the overlapping part. A first comparison module, configured to obtain at least one third candidate box based on the size relationship between the intersection over union of the perimeters respectively corresponding to each of the second candidate boxes and a first preset threshold; A second response module, configured to, in response to at least one of the third candidate boxes satisfying a first preset condition, determine at least one of the third candidate boxes and the reference detection box as a target detection box.

12. A computer-readable storage medium storing a computer program for executing the method for generating a target detection box according to any one of claims 1-10 above.

13. An electronic device, comprising: A processor; A memory for storing executable instructions of the processor; The processor is configured to read the executable instructions from the memory and execute the instructions to implement the method for generating a target detection box according to any one of claims 1-10 above.

Citation Information

Patent Citations

  • Intelligent pervious concrete pore identification and segmentation method based on deep learning

    CN114298145A

  • Suppressing duplicated bounding boxes from object detection in a video analytics system

    US20190130189A1