Target detection method, system, apparatus, and medium

CN115188024BActive Publication Date: 2026-09-29江苏云从曦和人工智能有限公司
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210804133.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-07
Publication Date
2026-09-29
Estimated Expiration
2042-07-07

AI Technical Summary

Technical Problem

[0005]为了克服上述缺陷,提出了本发明,以提供解决或至少部分地解决在进行目标检测过程中,如何准确地检测并获得图像中的人体、人脸以及人体和人脸的关联关系的问题

Benefits of technology

[0048]在实施本发明的技术方案中,本发明对待检测图像单独进行人脸检测和人体检测而分别获得第一人脸检测结果和第一人体检测结果,并对待检测图像进行人脸人体关联检测,获得人脸人体关联检测结果,进一步根据第一人脸检测结果、第一人体检测结果和人脸人体关联检测结果来获取待检测图像的最终目标检测结果。通过上述配置方式,本发明获得的待检测图像的最终目标检测结果综合考虑了第一人脸检测结果、第一人体检测结果和人脸人体关联检测结果,能够更为准确有效地检测出待检测图像中的人体、人脸以及人体和人脸之间的关联关系,针对人脸被遮挡或者只露出人脸的情况也能实现很好的检测效果。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115188024B_ABST
    Figure CN115188024B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of target detection, and specifically provides a target detection method, system, device and medium, aiming to solve the problem of how to accurately detect and obtain the human body, face and the correlation between the human body and face in the image during the target detection process. To this end, the present application respectively performs face detection, human body detection and face-human body correlation detection on the image to be detected, and obtains the final target detection result of the image to be detected according to the above detection results, comprehensively considers the influence of face detection, human body detection and face-human body correlation detection on the final target detection result, can more accurately and effectively detect the human body, face and the correlation between the human body and face in the image to be detected, and can also achieve good detection effect for the case that the face is blocked or only the face is exposed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of target detection technology, and specifically provides a target detection method, system, device and medium. Background Technology

[0002] With the continuous development of artificial intelligence technology, image acquisition technology has been applied to various scenarios, such as security and finance. However, most existing target detection algorithms based on image acquisition technology can only detect individual human bodies or faces, and cannot provide the correlation between faces and human bodies. They simply associate faces and human bodies based on positional relationships, which is not very accurate, and incorrect associations can also affect subsequent target recognition and clustering operations.

[0003] In existing technologies, to obtain related human body and face bounding boxes, neural networks are generally used to regress pre-defined anchors, simultaneously outputting the corresponding human body and face bounding boxes. Experiments show that while this method can output related human body and face bounding boxes, it performs poorly in detecting human bodies in images where only the face is visible or where the face is not visible.

[0004] Accordingly, a new target detection scheme is needed in this field to solve the above problems. Summary of the Invention

[0005] To overcome the above-mentioned deficiencies, this invention is proposed to provide a solution, or at least a partial solution, to the problem of how to accurately detect and obtain human bodies, faces, and the correlation between human bodies and faces in an image during target detection.

[0006] In a first aspect, the present invention provides a target detection method, the method comprising:

[0007] Perform face detection on the image to be detected to obtain the first face detection result in the image to be detected;

[0008] Perform human detection on the image to be detected to obtain the first human detection result in the image to be detected;

[0009] Perform face and human body association detection on the image to be detected to obtain the face and human body association detection results in the image to be detected;

[0010] Based on the first human body detection result, the first face detection result, and the face-human body association detection result, the final target detection result of the image to be detected is obtained.

[0011] In one technical solution of the above-mentioned target detection method, there are multiple first human body detection results, first face detection results, and face-human body association detection results. The step of "obtaining the final target detection result of the image to be detected based on the first human body detection result, the first face detection result, and the face-human body association detection result" includes:

[0012] Multiple first-face detection results are filtered to obtain the filtered first-face detection results;

[0013] Data filtering is performed on multiple first human detection results to obtain the filtered first human detection results;

[0014] Data filtering is performed on multiple face and body association detection results to obtain the filtered face and body association detection results;

[0015] Based on the filtered first face detection results, the filtered first human body detection results, and the filtered face-human body association detection results, the first face-human body matching results are obtained.

[0016] The final target detection result is obtained based on the first face-body matching result.

[0017] In one technical solution of the above-mentioned target detection method, each face-body association detection result includes a one-to-one corresponding second face detection result and second body detection result. The step of "obtaining the first face-body matching result based on the filtered first face detection result, the filtered first body detection result, and the filtered face-body association detection result" includes:

[0018] Calculate the overlap ratio between each first face detection result and all second human body detection results in the filtered first face detection results to obtain a first overlap ratio matrix; wherein, the number of first face detection results in the filtered first face detection results is m, the number of second human body detection results is n1, and the first overlap ratio matrix is ​​an m×n1 matrix;

[0019] The overlap ratio between each first face detection result in the filtered first face detection results and all first human detection results in the filtered first human detection results is calculated to obtain the second overlap ratio matrix; wherein, the number of first human detection results in the filtered first human detection results is n2, and the second overlap ratio matrix is ​​an m×n2 matrix;

[0020] The intersection-union ratio (IUU) of each first face detection result in the filtered first face detection result set with all second face detection results is calculated to obtain the first IUU matrix; wherein, the number of second face detection results in the second face detection result set is equal to the number of second human body detection results, and the first IUU matrix is ​​an m×n1 matrix;

[0021] The first face-body matching result is obtained based on the first overlap ratio matrix, the second overlap ratio matrix, and the first intersection-union ratio matrix.

[0022] In one technical solution of the above target detection method, the step of "obtaining the first face-body matching result based on the first overlap ratio matrix, the second overlap ratio matrix, and the first intersection-union matrix" includes:

[0023] Determine whether the elements in the first cross-union ratio matrix are less than the cross-union ratio threshold. If so, adjust the corresponding elements in the first overlap ratio matrix to a preset overlap ratio to obtain the adjusted first overlap ratio matrix.

[0024] The adjusted first overlap ratio matrix and the second overlap ratio matrix are combined to obtain a combined overlap ratio matrix; wherein, the combined overlap ratio matrix is ​​an m×n matrix, and n is the sum of n1 and n2;

[0025] The first intersection-union-ratio (CUNT) matrix is ​​combined with the m×n2 zero matrix to obtain the combined CUNT matrix; the combined CUNT matrix is ​​an m×n matrix.

[0026] Add the corresponding elements in the combined overlap ratio matrix and the combined intersection-union ratio matrix to obtain the correlation matrix between the face and the human body;

[0027] The Hungarian algorithm is applied to obtain the first face-body matching result based on the correlation matrix.

[0028] In one technical solution of the above-mentioned target detection method, the step of "filtering multiple first face detection results to obtain filtered first face detection results" includes:

[0029] For each first face detection result, calculate the face intersection-union ratio between the first face detection result and all second face detection results;

[0030] If the cross-union ratio of one of the faces is greater than the preset cross-union ratio threshold, the first face detection result is deleted to obtain the filtered first face detection result.

[0031] In one technical solution of the above-mentioned target detection method, the step of "filtering multiple first human body detection results to obtain filtered first human body detection results" includes:

[0032] For each first human detection result, calculate the human crossover ratio between the first human detection result and all second human detection results;

[0033] If the crossover ratio of one of the human bodies is greater than the preset crossover ratio threshold, the first human body detection result is deleted to obtain the filtered first human body detection result.

[0034] In one technical solution of the above-mentioned target detection method, the face-body association detection result further includes the face detection result confidence of the second face detection result. The step of "filtering multiple face-body association detection results to obtain filtered face-body association detection results" includes:

[0035] For each face-body association detection result, the confidence level of the face detection result is compared with a preset confidence threshold.

[0036] The face-body association detection result whose confidence level is greater than the confidence threshold is taken as the second face-body matching result;

[0037] The face-body association detection results whose confidence level is less than or equal to the confidence threshold are used as the filtered face-body association detection results; and / or,

[0038] The step of "obtaining the final target detection result based on the first face-body matching result" further includes:

[0039] The final target detection result is obtained based on the first face-body matching result and the second face-body matching result.

[0040] In a second aspect, the present invention provides a target detection system, the system comprising:

[0041] The first face detection result acquisition module is configured to perform face detection on the image to be detected and obtain the first face detection result in the image to be detected;

[0042] The first human detection result acquisition module is configured to perform human detection on the image to be detected and obtain the first human detection result in the image to be detected.

[0043] The face and body association detection result acquisition module is configured to perform face and body association detection on the image to be detected and obtain the face and body association detection result in the image to be detected.

[0044] The final target detection result acquisition module is configured to acquire the final target detection result of the image to be detected based on the first human body detection result, the first face detection result, and the face-human body association detection result.

[0045] In a third aspect, a control device is provided, comprising a processor and a storage device, the storage device being adapted to store a plurality of program codes, the program codes being adapted to be loaded and run by the processor to perform the target detection method described in any of the above-described technical solutions of the target detection method.

[0046] In a fourth aspect, a computer-readable storage medium is provided, wherein a plurality of program codes are stored therein, the program codes being adapted to be loaded and run by a processor to perform the target detection method described in any of the above-described target detection methods.

[0047] The above-described technical solutions of the present invention have at least one or more of the following beneficial effects:

[0048] In implementing the technical solution of this invention, the invention performs face detection and human body detection separately on the image to be detected to obtain a first face detection result and a first human body detection result, respectively. Then, it performs face-human body association detection on the image to be detected to obtain a face-human body association detection result. Finally, based on the first face detection result, the first human body detection result, and the face-human body association detection result, the final target detection result of the image to be detected is obtained. Through the above configuration, the final target detection result of the image to be detected obtained by this invention comprehensively considers the first face detection result, the first human body detection result, and the face-human body association detection result. This enables more accurate and effective detection of human bodies, faces, and the relationships between human bodies and faces in the image to be detected. It also achieves good detection results even when faces are occluded or only the face is visible. Attached Figure Description

[0049] The disclosure of this invention will become more readily understood with reference to the accompanying drawings. It will be readily understood by those skilled in the art that these drawings are for illustrative purposes only and are not intended to limit the scope of protection of this invention. Wherein:

[0050] Figure 1 This is a schematic flowchart of the main steps of a target detection method according to an embodiment of the present invention;

[0051] Figure 2 This is a schematic flowchart of the main steps of a target detection method according to an embodiment of the present invention;

[0052] Figure 3 Figure 2 A flowchart illustrating the main steps of step S206;

[0053] Figure 4 This is a main structural block diagram of a target detection system according to an embodiment of the present invention. Detailed Implementation

[0054] Some embodiments of the present invention will now be described with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are merely illustrative of the technical principles of the present invention and are not intended to limit the scope of protection of the present invention.

[0055] In the description of this invention, "module" and "processor" can include hardware, software, or a combination of both. A module can include hardware circuitry, various suitable sensors, communication ports, memory, and may also include software components, such as program code, or a combination of software and hardware. A processor can be a central processing unit, microprocessor, image processor, digital signal processor, or any other suitable processor. The processor has data and / or signal processing capabilities. The processor can be implemented in software, in hardware, or a combination of both. Non-transitory computer-readable storage media includes any suitable medium capable of storing program code, such as magnetic disks, hard disks, optical disks, flash memory, read-only memory, random access memory, etc. The term "A and / or B" means all possible combinations of A and B, such as only A, only B, or A and B. The terms "at least one A or B" or "at least one of A and B" have a similar meaning to "A and / or B" and can include only A, only B, or A and B. The singular terms "a" or "this" can also include plural forms.

[0056] See appendix Figure 1 , Figure 1 This is a schematic flowchart illustrating the main steps of a target detection method according to an embodiment of the present invention. Figure 1 As shown, the target detection method in this embodiment of the invention mainly includes the following steps S101-S104.

[0057] Step S101: Perform face detection on the image to be detected to obtain the first face detection result in the image to be detected.

[0058] In this embodiment, face detection can be performed on the image to be detected to obtain the first face detection result in the image to be detected.

[0059] Step S102: Perform human detection on the image to be detected to obtain the first human detection result in the image to be detected.

[0060] In this embodiment, human detection can be performed on the image to be detected to obtain the first human detection result in the image to be detected.

[0061] In one implementation, common object detection algorithms such as R-CNN (Region Convolutional Neural Network) and YOLO series algorithms can be used for human body detection and face detection.

[0062] Step S103: Perform face and body association detection on the image to be detected to obtain the face and body association detection results in the image to be detected.

[0063] In this embodiment, face and body association detection can be performed on the image to be detected to obtain the face and body association detection results.

[0064] In one implementation, each face and body correlation detection result includes a one-to-one corresponding second face detection result and second body detection result.

[0065] In one implementation, commonly used object detection algorithms such as the YOLO series can be used for face and human body correlation detection.

[0066] In one implementation, feature extraction can be performed on the image to be detected first to obtain the image features of the image to be detected. Then, a target detection algorithm is applied to perform face detection, human body detection, and face-human body association detection based on the image features, so as to obtain the first face detection result, the first human body detection result, and the face-human body association detection result, respectively.

[0067] In one implementation, a convolutional neural network can be used to extract features from the image to be detected.

[0068] Step S104: Based on the first human body detection result, the first face detection result, and the face-human body association detection result, obtain the final target detection result of the image to be detected.

[0069] In this embodiment, the final target detection result of the image to be detected can be obtained by combining the first face detection result, the first human body detection result, and the face-human body association detection result. That is, the final target detection result is a fusion of the first face detection result, the first human body detection result, and the face-human body association detection result.

[0070] Based on steps S101-S104 above, this embodiment of the invention performs face detection and human body detection separately on the image to be detected to obtain a first face detection result and a first human body detection result, respectively. It then performs face-human body association detection on the image to be detected to obtain a face-human body association detection result. Finally, based on the first face detection result, the first human body detection result, and the face-human body association detection result, it obtains the final target detection result of the image to be detected. Through the above configuration, the final target detection result of the image to be detected obtained by this embodiment of the invention comprehensively considers the first face detection result, the first human body detection result, and the face-human body association detection result. This enables more accurate and effective detection of human bodies, faces, and the relationships between human bodies and faces in the image to be detected. It also achieves good detection results even when faces are occluded or only the face is visible.

[0071] The following is a further explanation of step S104.

[0072] In one embodiment of the present invention, there are multiple first human body detection results, first face detection results, and face-human body association detection results. Step S104 may further include the following steps S1041 to S1045:

[0073] Step S1041: Filter the multiple first face detection results to obtain the filtered first face detection results.

[0074] In this embodiment, step S1041 may further include steps S10411 to S10412:

[0075] Step S10411: For each first face detection result, calculate the face intersection-union ratio between the first face detection result and all second face detection results;

[0076] Step S10412: When the face intersection ratio of one of the faces is greater than the preset face intersection ratio threshold, the first face detection result is deleted to obtain the filtered first face detection result.

[0077] In this embodiment, the Intersection over Union (IOU) ratio between each first face detection result and all second face detection results can be calculated. If the IOU of any one of the first face detection results is greater than the IOU threshold, it can be determined that there is a duplication between this first face detection result and the second face detection results, and this first face detection result can be deleted. Repeating the above steps for all first face detection results can obtain the filtered first face detection results.

[0078] The method for calculating IOU is as follows: Assuming the area of ​​box A is S1, the area of ​​box B is S2, and the overlap area between box A and box B is S3, then the IOU between box A and box B can be obtained according to the following formula (1):

[0079]

[0080] In one implementation, the face intersection-union ratio threshold can be 0.3. That is, when the face intersection-union ratio is greater than 0.3, it can be considered that the first face detection result and the corresponding second face detection result are duplicates, and the first face detection result can be deleted.

[0081] Step S1042: Filter the multiple first human detection results to obtain the filtered first human detection results.

[0082] In this embodiment, step S1042 may further include steps S10421 to S10422:

[0083] Step S10421: For each first human detection result, calculate the human crossover ratio between the first human detection result and all second human detection results;

[0084] Step S10422: When the crossover ratio of one of the human bodies is greater than the preset crossover ratio threshold, the first human body detection result is deleted to obtain the filtered first human body detection result.

[0085] In this embodiment, the cross-union ratio (CUNR) between each first human detection result and all second human detection results can be calculated. If any CUNR is greater than a threshold, it can be determined that there is a duplicate between this first human detection result and the second human detection results, and this first human detection result can be deleted. Repeating the above steps for all first human detection results yields the filtered first human detection results.

[0086] In one implementation, the human body crossover ratio threshold can be 0.5. That is, when the human body crossover ratio is greater than 0.5, it can be considered that the first human body detection result and the corresponding second human body detection result are duplicated, and the first human body detection result can be deleted.

[0087] Step S1043: Filter the multiple face and body association detection results to obtain the filtered face and body association detection results.

[0088] In this embodiment, the face-body association detection result may further include the face detection result confidence level of the second face detection result, and step S1043 may include steps S10431 to S10433:

[0089] Step S10431: For each face-body association detection result, compare the confidence level of the face detection result with the preset confidence level threshold;

[0090] Step S10432: Use the face-body association detection results whose face detection confidence is greater than the confidence threshold as the second face-body matching results;

[0091] Step S10433: Use the face-body association detection results whose face detection confidence is less than or equal to the confidence threshold as the filtered face-body association detection results.

[0092] In this embodiment, the face-body association detection results can be filtered based on the confidence level of the face detection results. Specifically, when the confidence level of the face detection results is greater than the confidence threshold, it indicates that the association between these face-body association detection results is relatively good, and these results can be used as the second face-body matching results. The second face-body matching results can be output as part of the final target detection results. For the second face detection results with a confidence level less than or equal to the confidence threshold, these results may indicate that the face is occluded or visible; in this case, these results can be used as the filtered face-body association detection results. Those skilled in the art can choose the value of the confidence threshold according to the needs of the actual application.

[0093] Step S1044: Based on the filtered first face detection result, the filtered first human body detection result, and the filtered face-human body association detection result, obtain the first face-human body matching result.

[0094] In this embodiment, step S1044 may further include steps S10441 to S10444:

[0095] Step S10441: Calculate the overlap ratio between each first face detection result and all second human body detection results in the filtered first face detection results to obtain the first overlap ratio matrix; wherein, the number of first face detection results in the filtered first face detection results is m, the number of second human body detection results is n1, and the first overlap ratio matrix is ​​an m×n1 matrix.

[0096] In this embodiment, the overlap ratio between each first face detection result and each second human body detection result can be calculated to form a first overlap ratio matrix. That is, if there are m first face detection results and n1 second human body detection results, then the overlap ratio is m×n1, and the first overlap ratio matrix is ​​an m×n1 matrix.

[0097] The method for calculating the overlap ratio (IOF) is as follows: Assuming the area of ​​box A is S1, the area of ​​box B is S2, and the overlap area between box A and box B is S3, then the IOF between box A and box B can be obtained according to the following formula (2):

[0098]

[0099] Step S10442: Calculate the overlap ratio between each first face detection result in the filtered first face detection results and all first human detection results in the filtered first human detection results, and obtain the second overlap ratio matrix; wherein, the number of first human detection results in the filtered first human detection results is n2, and the second overlap ratio matrix is ​​an m×n2 matrix.

[0100] In this embodiment, the overlap ratio between each first face detection result and each first human body detection result can be calculated to form a second overlap ratio matrix. That is, if there are m first face detection results and n² first human body detection results, then the overlap ratio is m×n², and the second overlap ratio matrix is ​​an m×n² matrix.

[0101] Step S10443: Calculate the intersection-union ratio (IUU) of each first face detection result and all second face detection results in the filtered first face detection result set to obtain the first IUU matrix; wherein, the number of second face detection results in the second face detection result set is equal to the number of second human body detection results, and the first IUU matrix is ​​an m×n1 matrix.

[0102] In this embodiment, the intersection-union ratio (CIU) of each first face detection result and each second face detection result can be calculated to form a first CIU matrix. That is, if there are m first face detection results and n1 second face detection results, then the CIU is m×n1, and the first CIU matrix is ​​an m×n1 matrix.

[0103] Step S10444: Obtain the first face-body matching result based on the first overlap ratio matrix, the second overlap ratio matrix, and the first intersection-union ratio matrix.

[0104] In this embodiment, step S1044 may further include steps S10441 to S10445:

[0105] Step S10441: Determine whether the elements in the first cross-union ratio matrix are less than the cross-union ratio threshold. If so, adjust the corresponding elements in the first overlap ratio matrix to the preset overlap ratio to obtain the adjusted first overlap ratio matrix.

[0106] In this embodiment, the elements in the first intersection-overlap ratio (IoU) matrix can be compared with an IoU threshold. When an element in the first IoU matrix is ​​less than the IoU threshold, it indicates that the IoU between the first face detection result and the second face detection result is too low. In this case, the corresponding element in the first overlap ratio matrix can be adjusted to a preset overlap ratio, meaning that the correlation between the first face detection result and the corresponding second face detection result is considered to be very low. The preset overlap ratio is less than the overlap ratio corresponding to the element, i.e., the overlap ratio is adjusted to a small value, such as 0.1.

[0107] For example, if both the first intersection-to-union matrix and the first overlap ratio matrix are 3×5 matrices, and the first intersection-to-union matrix is ​​denoted as A. 35 The first overlap ratio matrix is ​​denoted as B. 35 When determining the element a in the first intersection-union matrix 22 If the crossover ratio (CUP) is less than the threshold, it means that the CUP between the second first face detection result and the second second face detection result is too low. Since the second face detection result and the second human detection result have a one-to-one correspondence, the correlation between the second first face detection result and the second second human detection result is considered to be very low. Therefore, the corresponding element b in the first overlap ratio matrix can be... 22 Adjust to the preset overlap ratio.

[0108] Step S10442: Combine the adjusted first overlap ratio matrix and the second overlap ratio matrix to obtain the combined overlap ratio matrix; wherein, the combined overlap ratio matrix is ​​an m×n matrix, and n is the sum of n1 and n2.

[0109] In this embodiment, the adjusted first overlap ratio matrix and the second overlap ratio matrix can be combined to obtain an m×n order combined overlap ratio matrix.

[0110] Step S10443: Combine the first intersection-union-ratio matrix with the m×n2 zero matrix to obtain the combined intersection-union-ratio matrix; the combined intersection-union-ratio matrix is ​​an m×n matrix.

[0111] In this embodiment, the first intersection-union matrix can be combined with the m×n2 zero matrix to obtain an m×n order intersection-union matrix.

[0112] Step S10444: Add the corresponding elements in the combined overlap ratio matrix and the combined intersection-union ratio matrix to obtain the correlation matrix between the face and the human body.

[0113] In this embodiment, since both the combined overlap ratio matrix and the combined intersection-over-union ratio matrix are m×n matrices, corresponding elements in the combined overlap ratio matrix and the combined intersection-over-union ratio matrix can be added together to obtain an m×n correlation matrix between faces and bodies. That is, the combined overlap ratio matrix can be denoted as S.mn S mn The element in is s ij Where i = 1, ..., m, j = 1, ..., n; the combined intersection-union matrix can be denoted as C. mn C mn The element in is c ij Where i = 1, ..., m, j = 1, ..., n; the correlation matrix can be denoted as Q. mn Q mn The element in is q ij Where i = 1, ..., m, j = 1, ..., n, q ij =s ij +c ij .

[0114] Step S10445: Apply the Hungarian algorithm to obtain the first face-body matching result based on the correlation matrix.

[0115] In this embodiment, the Hungarian algorithm can be applied to match faces and bodies based on the correlation matrix to obtain the first face-body matching result. That is, the Hungarian algorithm is used to match the filtered first face detection result with the filtered first body detection result and the second body detection result to obtain a one-to-one matching relationship between faces and bodies, which is the first face-body matching result. The Hungarian algorithm refers to an algorithm that finds the maximum matching in graph theory.

[0116] Step S1045: Obtain the final target detection result based on the first face-body matching result.

[0117] In this embodiment, the final target detection result can be obtained based on the first face-body matching result obtained in step S10445.

[0118] In one embodiment, the final target detection result may further include the second face-body matching result obtained in step S10432, that is, the first face-body matching result and the second face-body matching result are used as the final target detection result. Both the first face-body matching result and the second face-body matching result are one-to-one matching results between faces and bodies.

[0119] In one implementation, see Appendix Figure 2 , Figure 2 This is a schematic flowchart illustrating the main steps of a target detection method according to an embodiment of the present invention. Figure 2 As shown, the target detection method may include the following steps S201 to S207:

[0120] Step S201: Input the image to be detected.

[0121] Step S202: Extract features from the image to be detected to obtain image features.

[0122] In this embodiment, feature extraction can be performed on the image to be detected.

[0123] Step S203: Perform human detection based on image features to obtain the first human detection result.

[0124] In this embodiment, the method described in step S203 is similar to the method described in step S102 above, and will not be repeated here for the sake of simplicity.

[0125] Step S204: Perform face detection based on image features to obtain the first face detection result.

[0126] In this embodiment, the method described in step S204 is similar to the method described in step S101 above, and will not be repeated here for the sake of simplicity.

[0127] Step S205: Perform face and body association detection based on image features and obtain the face and body association detection results.

[0128] In this embodiment, the method described in step S205 is similar to the method described in step S103 above, and will not be repeated here for the sake of simplicity.

[0129] Step S206: Obtain the final target detection result of the image to be detected based on the first human body detection result, the first face detection result, and the face-human body association detection result.

[0130] In this embodiment, the method described in step S206 is similar to the method described in step S104 above, and will not be repeated here for the sake of simplicity.

[0131] Step S207: Output the final target detection result.

[0132] In one implementation, see Appendix Figure 3 , Figure 3 Figure 2 A flowchart illustrating the main steps of step S206. (See attached diagram.) Figure 3 As shown, step S206 may include steps S2061 to S2069:

[0133] Step S2061: Filter the data of the first face detection result to obtain the filtered first face detection result.

[0134] In this embodiment, the method described in step S2061 is similar to the method described in step S1041, and will not be described again here for the sake of simplicity.

[0135] Step S2062: Perform data filtering on the first human body detection results to obtain the filtered first human body detection results.

[0136] In this embodiment, the method described in step S2062 is similar to the method described in step S1042, and will not be described again here for the sake of simplicity.

[0137] Step S2063: Filter the face and body association detection results to obtain the filtered face and body association detection results and the second face and body matching results.

[0138] In this embodiment, the method described in step S2063 is similar to the methods described in steps S10431 to S10433, and will not be repeated here for the sake of simplicity.

[0139] Step S2064: Based on the filtered first face detection result, the filtered first human body detection result, and the filtered face-human body association detection result, perform face-human body matching to obtain the first face-human body matching result.

[0140] In this embodiment, the method described in step S2064 is similar to the method described in step S1044, and will not be repeated here for the sake of simplicity.

[0141] Step S2065: Obtain the final target detection result based on the first face-body matching result and the second face-body matching result.

[0142] In this embodiment, the first face-body matching result obtained in step S2064 and the second face-body association detection result obtained in step S2063 are used as the final target detection result.

[0143] It should be noted that although the steps in the above embodiments are described in a specific order, those skilled in the art will understand that in order to achieve the effects of the present invention, different steps do not necessarily have to be executed in such an order. They can be executed simultaneously (in parallel) or in other orders, and these variations are all within the scope of protection of the present invention.

[0144] Furthermore, the present invention also provides a target detection system.

[0145] See appendix Figure 4 , Figure 4 This is a main structural block diagram of a target detection system according to an embodiment of the present invention. Figure 4As shown, the target detection system in this embodiment of the invention may include a first face detection result acquisition module, a first human body detection result acquisition module, a face-human body association detection result acquisition module, and a final target detection result acquisition module. In this embodiment, the first face detection result acquisition module can be configured to perform face detection on the image to be detected, obtaining a first face detection result in the image to be detected. The first human body detection result acquisition module can be configured to perform human body detection on the image to be detected, obtaining a first human body detection result in the image to be detected. The face-human body association detection result acquisition module can be configured to perform face-human body association detection on the image to be detected, obtaining a face-human body association detection result in the image to be detected. The final target detection result acquisition module can be configured to obtain the final target detection result of the image to be detected based on the first human body detection result, the first face detection result, and the face-human body association detection result.

[0146] The aforementioned target detection system is used to perform Figure 1 The target detection method embodiments shown are similar in technical principle, the technical problems they solve, and the technical effects they produce. Those skilled in the art can clearly understand that, for the sake of convenience and brevity, the specific working process and related descriptions of the target detection system can be referred to the content described in the embodiments of the target detection method, which will not be repeated here.

[0147] Those skilled in the art will understand that all or part of the processes in the method of the above embodiment of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable file, or some intermediate form. The computer-readable storage medium can include any entity or device capable of carrying the computer program code, a medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory, a random access memory, an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc. It should be noted that the content included in the computer-readable storage medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable storage medium does not include electrical carrier signals and telecommunication signals.

[0148] Furthermore, the present invention also provides a control device. In one embodiment of the control device according to the present invention, the control device includes a processor and a storage device. The storage device can be configured to store a program for executing the target detection method of the above-described method embodiments, and the processor can be configured to execute the program in the storage device. The program includes, but is not limited to, a program for executing the target detection method of the above-described method embodiments. For ease of explanation, only the parts related to the embodiments of the present invention are shown; for specific technical details not disclosed, please refer to the method section of the embodiments of the present invention. This control device can be a control device device comprising various electronic devices.

[0149] Furthermore, the present invention also provides a computer-readable storage medium. In one embodiment of the computer-readable storage medium according to the present invention, the computer-readable storage medium can be configured to store a program for performing the target detection method of the above-described method embodiments. This program can be loaded and run by a processor to implement the above-described target detection method. For ease of explanation, only the parts related to the embodiments of the present invention are shown; for specific technical details not disclosed, please refer to the method section of the embodiments of the present invention. The computer-readable storage medium can be a storage device comprising various electronic devices. Optionally, in the embodiments of the present invention, the computer-readable storage medium is a non-transitory computer-readable storage medium.

[0150] Furthermore, it should be understood that since the various modules are only provided to illustrate the functional units of the device of the present invention, the physical devices corresponding to these modules may be the processor itself, or a part of the processor's software, hardware, or a combination of software and hardware. Therefore, the number of modules shown in the figures is merely illustrative.

[0151] Those skilled in the art will understand that the various modules in the device can be adaptively split or combined. Such splitting or combining of specific modules will not cause the technical solution to deviate from the principles of the present invention; therefore, the technical solutions after splitting or combining will fall within the protection scope of the present invention.

[0152] The technical solution of the present invention has been described above with reference to the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after such changes or substitutions will all fall within the scope of protection of the present invention.

Claims

1. A target detection method, characterized in that, The method includes: Perform face detection on the image to be detected to obtain the first face detection result in the image to be detected; Perform human detection on the image to be detected to obtain the first human detection result in the image to be detected; Perform face and body association detection on the image to be detected to obtain the face and body association detection results in the image to be detected; Based on the first human body detection result, the first face detection result, and the face-human body association detection result, the final target detection result of the image to be detected is obtained; The first human body detection result, the first face detection result, and the face-human body association detection result are all multiple. The step of "obtaining the final target detection result of the image to be detected based on the first human body detection result, the first face detection result, and the face-human body association detection result" includes: Multiple first-face detection results are filtered to obtain the filtered first-face detection results; Data filtering is performed on multiple first human detection results to obtain the filtered first human detection results; Multiple face and body correlation detection results are filtered to obtain filtered face and body correlation detection results; Based on the filtered first face detection results, the filtered first human body detection results, and the filtered face-human body association detection results, the first face-human body matching results are obtained. Based on the first face-body matching result, the final target detection result is obtained; Each face-body correlation detection result includes a one-to-one corresponding second face detection result and second body detection result. The step of "obtaining the first face-body matching result based on the filtered first face detection result, the filtered first body detection result, and the filtered face-body correlation detection result" includes: Calculate the overlap ratio between each first face detection result and all second human body detection results in the filtered first face detection results to obtain a first overlap ratio matrix; wherein, the number of first face detection results in the filtered first face detection results is m, the number of second human body detection results is n1, and the first overlap ratio matrix is ​​an m×n1 matrix; The overlap ratio between each first face detection result in the filtered first face detection results and all first human detection results in the filtered first human detection results is calculated to obtain the second overlap ratio matrix; wherein, the number of first human detection results in the filtered first human detection results is n2, and the second overlap ratio matrix is ​​an m×n2 matrix; The intersection-union ratio (IUU) of each first face detection result in the filtered first face detection result set with all second face detection results is calculated to obtain the first IUU matrix; wherein, the number of second face detection results in the second face detection result set is equal to the number of second human body detection results, and the first IUU matrix is ​​an m×n1 matrix; Based on the first overlap ratio matrix, the second overlap ratio matrix, and the first intersection-union ratio matrix, the first face-body matching result is obtained. The steps of "filtering multiple first-face detection results to obtain the filtered first-face detection results" include: For each first face detection result, calculate the face intersection-union ratio between the first face detection result and all second face detection results; If the face intersection ratio of one of the faces is greater than the preset face intersection ratio threshold, the first face detection result is deleted to obtain the filtered first face detection result. The steps of "filtering multiple first-human detection results to obtain the filtered first-human detection results" include: For each first human detection result, calculate the human crossover ratio between the first human detection result and all second human detection results; When the crossover ratio of one of the human bodies is greater than the preset crossover ratio threshold, the first human body detection result is deleted to obtain the filtered first human body detection result. The face and body correlation detection result also includes the confidence level of the face detection result of the second face detection result. The step of "filtering multiple face and body correlation detection results to obtain the filtered face and body correlation detection result" includes: For each face-body association detection result, the confidence level of the face detection result is compared with a preset confidence threshold. The face-body association detection result whose confidence level is greater than the confidence threshold is taken as the second face-body matching result; The face-body association detection results whose confidence level is less than or equal to the confidence threshold are used as the filtered face-body association detection results; the step of "obtaining the final target detection result based on the first face-body matching result" further includes: The final target detection result is obtained based on the first face-body matching result and the second face-body matching result.

2. The target detection method according to claim 1, characterized in that, The step of "obtaining the first face-body matching result based on the first overlap ratio matrix, the second overlap ratio matrix, and the first intersection-union matrix" includes: Determine whether the elements in the first cross-union ratio matrix are less than the cross-union ratio threshold. If so, adjust the corresponding elements in the first overlap ratio matrix to a preset overlap ratio to obtain the adjusted first overlap ratio matrix. The adjusted first overlap ratio matrix and the second overlap ratio matrix are combined to obtain a combined overlap ratio matrix; wherein, the combined overlap ratio matrix is ​​an m×n matrix, and n is the sum of n1 and n2; The first intersection-union-ratio (CUNT) matrix is ​​combined with the m×n2 zero matrix to obtain the combined CUNT matrix; the combined CUNT matrix is ​​an m×n matrix. Add the corresponding elements in the combined overlap ratio matrix and the combined intersection-union ratio matrix to obtain the correlation matrix between the face and the human body; The Hungarian algorithm is applied to obtain the first face-body matching result based on the correlation matrix.

3. A target detection system, characterized in that, The system includes: The first face detection result acquisition module is configured to perform face detection on the image to be detected and obtain the first face detection result in the image to be detected; The first human detection result acquisition module is configured to perform human detection on the image to be detected and obtain the first human detection result in the image to be detected. The face and body association detection result acquisition module is configured to perform face and body association detection on the image to be detected and obtain the face and body association detection result in the image to be detected. The final target detection result acquisition module is configured to acquire the final target detection result of the image to be detected based on the first human body detection result, the first face detection result, and the face-human body association detection result. The first human body detection result, the first face detection result, and the face-human body association detection result are all multiple. The final target detection result acquisition module is further configured to: perform data filtering on the multiple first face detection results to obtain the filtered first face detection result; Data filtering is performed on multiple first human detection results to obtain the filtered first human detection results; Multiple face and body correlation detection results are filtered to obtain filtered face and body correlation detection results; Based on the filtered first face detection results, the filtered first human body detection results, and the filtered face-human body association detection results, the first face-human body matching results are obtained. Based on the first face-body matching result, the final target detection result is obtained; Each face-body correlation detection result includes a one-to-one corresponding second face detection result and second body detection result. "Obtaining the first face-body matching result based on the filtered first face detection result, the filtered first body detection result, and the filtered face-body correlation detection result" includes: Calculate the overlap ratio between each first face detection result and all second human body detection results in the filtered first face detection results to obtain a first overlap ratio matrix; wherein, the number of first face detection results in the filtered first face detection results is m, the number of second human body detection results is n1, and the first overlap ratio matrix is ​​an m×n1 matrix; The overlap ratio between each first face detection result in the filtered first face detection results and all first human detection results in the filtered first human detection results is calculated to obtain the second overlap ratio matrix; wherein, the number of first human detection results in the filtered first human detection results is n2, and the second overlap ratio matrix is ​​an m×n2 matrix; The intersection-union ratio (IUU) of each first face detection result in the filtered first face detection result set with all second face detection results is calculated to obtain the first IUU matrix; wherein, the number of second face detection results in the second face detection result set is equal to the number of second human body detection results, and the first IUU matrix is ​​an m×n1 matrix; Based on the first overlap ratio matrix, the second overlap ratio matrix, and the first intersection-union ratio matrix, the first face-body matching result is obtained. "Data filtering of multiple first-face detection results to obtain filtered first-face detection results" includes: For each first face detection result, calculate the face intersection-union ratio between the first face detection result and all second face detection results; If the face intersection ratio of one of the faces is greater than the preset face intersection ratio threshold, the first face detection result is deleted to obtain the filtered first face detection result. "Data filtering of multiple first-human detection results to obtain filtered first-human detection results" includes: For each first human detection result, calculate the human crossover ratio between the first human detection result and all second human detection results; When the crossover ratio of one of the human bodies is greater than the preset crossover ratio threshold, the first human body detection result is deleted to obtain the filtered first human body detection result. The face and body correlation detection result also includes the confidence level of the face detection result of the second face detection result. "Data filtering of multiple face and body correlation detection results to obtain the filtered face and body correlation detection result" includes: For each face-body association detection result, the confidence level of the face detection result is compared with a preset confidence threshold. The face-body association detection result whose confidence level is greater than the confidence threshold is taken as the second face-body matching result; The face-body association detection results whose confidence level is less than or equal to the confidence threshold are used as the filtered face-body association detection results; "Obtaining the final target detection result based on the first face-body matching result" further includes: The final target detection result is obtained based on the first face-body matching result and the second face-body matching result.

4. A control device, comprising a processor and a storage device, said storage device being adapted to store a plurality of program codes, characterized in that, The program code is adapted to be loaded and run by the processor to perform the target detection method according to any one of claims 1 to 2.

5. A computer-readable storage medium storing a plurality of program codes, characterized in that, The program code is adapted to be loaded and run by a processor to perform the target detection method according to any one of claims 1 to 2.

Citation Information

Patent Citations

  • Method and device for detecting associated object in image, equipment and storage medium

    CN113557546A