Target detection method, device, electronic device and readable storage medium
By optimizing the final position information of the object detection box using the confidence and discrete values of the detection box, the problem of insufficient accuracy of the detection box position information in the prior art is solved, and more efficient and accurate object detection is achieved.
Patent Information
- Application Number
- CN202210828333.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-13
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2042-07-13
AI Technical Summary
In the prior art, in object detection, the confidence and discrete values of the detection box are not effectively utilized, resulting in insufficient accuracy of the final position information of the detection box.
By calculating the discrete values of the object detection box based on confidence, and optimizing the final position information with historical information, using a pre-trained position optimization model, the accuracy of the final position information of the detection box is improved.
It improves the accuracy of the final position information of the object detection box, reduces waste of computing resources, and improves the efficiency and accuracy of object detection.
Smart Images

Figure CN115359233B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, specifically cloud computing, image recognition, deep learning, and computer vision technology, and is applicable in intelligent cloud scenarios. A target detection method, device, electronic device, and readable storage medium are provided. Background Art
[0002] With the development of artificial intelligence technology, deep learning models such as neural networks have been widely used in target detection, object recognition, image classification and other fields. In the process of target detection, determining the detection box surrounding the detected object is an indispensable step. Summary of the Invention
[0003] According to a first aspect of the present disclosure, a target detection method is provided, comprising: performing target detection on an image to be processed to obtain initial position information and a confidence level of a target detection frame in the image to be processed; obtaining a target discrete value of the target detection frame based on the confidence level; and obtaining final position information of the target detection frame based on the initial position information and the target discrete value.
[0004] According to a second aspect of the present disclosure, a target detection device is provided, comprising: a detection unit, configured to perform target detection on an image to be processed, and obtain initial position information and a confidence level of a target detection frame in the image to be processed; a processing unit, configured to obtain a target discrete value of the target detection frame based on the confidence level; and an optimization unit, configured to obtain final position information of the target detection frame based on the initial position information and the target discrete value.
[0005] According to a third aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method described above.
[0006] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the method as described above.
[0007] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein the computer program implements the method described above when executed by a processor.
[0008] It can be seen from the above technical solutions that the present disclosure uses the target discrete value of the target detection frame obtained based on the confidence of the target detection frame to process the final position information of the target detection frame, which can improve the accuracy of the final position information of the target detection frame.
[0009] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] The accompanying drawings are provided to facilitate a better understanding of the present invention and do not constitute a limitation of the present disclosure.
[0011] Figure 1 is a schematic diagram according to a first embodiment of the present disclosure;
[0012] Figure 2 is a schematic diagram according to a second embodiment of the present disclosure;
[0013] Figure 3 is a schematic diagram according to a third embodiment of the present disclosure;
[0014] Figure 4 is a block diagram of an electronic device used to implement the target detection method according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0015] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, and various details of the embodiments of the present disclosure are included to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and mechanisms are omitted in the following description.
[0016] Figure 1 Schematic diagram of the first embodiment of the present disclosure. Figure 1 As shown, the target detection method of this embodiment specifically includes the following steps:
[0017] S101, performing target detection on the image to be processed to obtain initial position information and confidence of the target detection frame in the image to be processed;
[0018] S102: Obtaining a target discrete value of the target detection frame based on the confidence level;
[0019] S103 : Obtain final position information of the target detection frame based on the initial position information and the target discrete value.
[0020] The target detection method of this embodiment, after obtaining the initial position information and confidence of the target detection frame in the image to be processed, first obtains the target discrete value of the target detection frame based on the confidence, and then obtains the final position information of the target detection frame based on the initial position information and the target discrete value of the target detection frame. Since the confidence of the target detection frame can reflect the accuracy of the obtained target detection frame, this embodiment uses the target discrete value of the target detection frame obtained based on the confidence of the target detection frame to process the final position information of the target detection frame, which can improve the accuracy of the final position information of the obtained target detection frame.
[0021] When executing S101 in this embodiment, the image input from the input end can be used as the image to be processed, the image selected on the page by the input end can be used as the image to be processed, or a frame of image can be selected from the video input or selected from the input end as the image to be processed.
[0022] In this embodiment, when executing S101 to perform target detection on the image to be processed, the image to be processed can be input into the target detection model to obtain the initial position information and confidence of the target detection box output by the target detection model; wherein the target detection box corresponds to the target detection object in the image to be processed, specifically the minimum circumscribed rectangular box surrounding the target detection object in the image to be processed.
[0023] The target detection model used in this embodiment when executing S101 can be trained based on a deep learning method. This embodiment does not limit the type of the target detection model.
[0024] The initial position information of the target detection frame obtained by executing S101 in this embodiment is the position information of the target detection frame in the image to be processed. The initial position information may include the upper left corner coordinates, upper right corner coordinates, lower left corner coordinates and lower right corner coordinates of the target detection frame in the image to be processed. It may also include the upper left corner coordinates and lower right corner coordinates of the target detection frame in the image to be processed. This embodiment does not limit the type of coordinates contained in the initial position information.
[0025] The initial position information of the target detection frame obtained using the target detection algorithm usually has a certain error, and the confidence of the target detection frame output by the target detection algorithm can reflect the accuracy of the obtained initial position information. The accuracy indicates the degree of credibility of the target detection object contained in the obtained target detection frame.
[0026] For example, if the confidence of the target detection frame is 0.99, it means that the accuracy of the target detection frame is high, and the probability that the final position information of the target detection frame is near the initial position information output by the target detection algorithm is high; if the confidence of the target detection frame is 0.1, it means that the accuracy of the target detection frame is low, and the probability that the final position information of the target detection frame is near the initial position information output by the target detection algorithm is low.
[0027] The confidence level of the target detection frame obtained by executing S101 in this embodiment indicates the degree of confidence that the target detection object is contained in the target detection frame, that is, the accuracy of the initial position information of the target detection frame. The higher the confidence level, the higher the degree of confidence that the target detection object is contained in the target detection frame, and the higher the accuracy of the obtained initial position information. Otherwise, the lower the degree of confidence that the target detection object is contained in the target detection frame, and the lower the accuracy of the obtained initial position information.
[0028] When executing S101 in this embodiment, the target detection frame may be all detection frames in the image to be processed, or may be part of the detection frames in the image to be processed, that is, the number of target detection frames in this embodiment may be one or more.
[0029] In this embodiment, when executing S101 to perform target detection on the image to be processed and obtain the initial position information and confidence of the target detection frame in the image to be processed, the following method can also be adopted: performing target detection on the image to be processed and obtaining the confidence of each detection frame in the image to be processed; taking the detection frame whose confidence exceeds the confidence threshold as the target detection frame, and obtaining the initial position information and confidence of the target detection frame.
[0030] That is to say, this embodiment can filter the detection frames in the image to be processed according to the confidence level, so that the detection frames whose confidence levels meet the preset requirements are used as target detection frames, and the detection frames with lower confidence levels are discarded, thereby avoiding waste of computing resources and improving the efficiency of target detection.
[0031] In this embodiment, after executing S101 to obtain the initial position information and confidence of the target detection frame in the image to be processed, executing S102 to obtain the target discrete value of the target detection frame based on the confidence.
[0032] The target discrete value obtained by executing S102 in this embodiment is used to represent the degree of discreteness between the final position information and the initial position information of the target detection frame; wherein, the larger the target discrete value, the further the final position information of the target detection frame is from the initial position information, and the smaller the target discrete value, the closer the final position information of the target detection frame is to the initial position information; the final position information in this embodiment is the accurate position information of the target detection frame.
[0033] Typically, existing technologies only filter detection frames based on their confidence levels, and then use the initial position information of the filtered detection frames as accurate position information. They do not obtain target discrete values based on the confidence levels of the detection frames, and further process the initial position information based on the target discrete values to obtain the final position information of the target detection frames.
[0034] Since different confidence levels correspond to different degrees of discreteness, the method of obtaining the target discrete value of the target detection frame based on the confidence level of the target detection frame in this embodiment can achieve the purpose of treating different target detection frames separately, avoids the problem of treating target detection frames with different confidence levels equally in the prior art, and improves the rationality of the obtained target discrete value.
[0035] In this embodiment, when executing S102 to obtain the target discrete value of the target detection box based on the confidence level, an optional implementation method that can be adopted is: obtaining discrete value calculation parameters, which are preset; and obtaining the target discrete value of the target detection box based on the confidence level and the obtained discrete value calculation parameters.
[0036] In this embodiment, when executing S102 to calculate parameters based on the confidence and discrete values to obtain the target discrete value of the target detection frame, the following preset calculation formula can be used:
[0037] σ' 2 =λ(1-conf)
[0038] In the above calculation formula: σ' 2 is the target discrete value; λ is the discrete value calculation parameter, and the discrete value calculation parameter in this embodiment is preferably 2; conf is the confidence level; the target discrete value calculated using the above formula can be considered as the variance.
[0039] In this embodiment, when executing S102 to calculate parameters based on the confidence and discrete values to obtain the target discrete value of the target detection frame, the following preset calculation formula may also be used:
[0040]
[0041] In the above calculation formula: σ' is the target discrete value; λ is the discrete value calculation parameter, and the discrete value calculation parameter in this embodiment is preferably 2; conf is the confidence level; the target discrete value calculated using the above formula can be considered as the standard deviation.
[0042] In this embodiment, when executing S102 to obtain the target discrete value of the target detection frame based on the confidence level and the discrete value calculation parameter, the product result between the confidence level and the discrete value calculation parameter can also be used as the target discrete value of the target detection frame.
[0043] When executing S102 to obtain the target discrete value of the target detection frame based on the confidence level, this embodiment can also use the discrete value corresponding to the confidence level of the target detection frame as the target discrete value of the target detection frame based on the correspondence between the confidence level and the discrete value.
[0044] That is to say, this embodiment can also pre-set the correspondence between the reliability and the discrete value, and obtain the target discrete value of the target detection frame according to the correspondence, thereby simplifying the steps of obtaining the target discrete value and improving the efficiency of obtaining the target discrete value.
[0045] When executing S102 to obtain the target discrete value of the target detection frame based on the confidence level, this embodiment may also adopt the following method: based on the obtained confidence level, obtain the initial discrete value of the target detection frame, for example, use the above-mentioned discrete value calculation parameter method to obtain the initial discrete value; obtain the historical target discrete value of the target detection frame; and obtain the target discrete value of the target detection frame based on the initial discrete value and the historical target discrete value.
[0046] Among them, when executing S102 to obtain the historical target discrete value of the target detection frame, this embodiment can first determine the historical frame image corresponding to the image to be processed, and then obtain the historical target discrete value of the target detection frame based on the determined historical frame image.
[0047] It can be understood that the target discrete value of the target detection frame in the image to be processed obtained by executing S102 in this embodiment can be used as the historical target discrete value of the target detection frame in the future frame image located after the image to be processed, so as to obtain the target discrete value of the target detection frame in the future frame image; that is, this embodiment can record the obtained target discrete value to determine the final position information and / or target discrete value of other images.
[0048] That is to say, in addition to using the confidence of the target detection frame, this embodiment can also combine the historical target discrete values corresponding to the target detection frame in the historical frame image to jointly obtain the target discrete value of the target detection frame. Using the historical target discrete value to optimize the initial discrete value can improve the accuracy of the obtained target discrete value.
[0049] In this embodiment, when executing S102 to obtain the target discrete value of the target detection frame based on the initial discrete value and the historical target discrete value, the following calculation formula can be used:
[0050]
[0051] In the above calculation formula: σ' 2 is the target discrete value; σ0 2 is the initial discrete value; σ1 2 is the historical target discrete value.
[0052] In this embodiment, after executing S102 to obtain the target discrete value of the target detection frame, S103 is executed to obtain the final position information of the target detection frame based on the initial position information of the target detection frame and the target discrete value.
[0053] When there are multiple target detection frames obtained by executing S101 in this embodiment, when executing S103, this embodiment will obtain the final position information of each target detection frame based on the initial position information and the target discrete value of each target detection frame.
[0054] In this embodiment, when executing S103 to obtain the final position information of the target detection frame based on the initial position information and the target discrete value of the target detection frame, the initial position information and the target discrete value of the target detection frame can be input into the position optimization model, and the output result of the position optimization model can be used as the final position information of the target detection frame; wherein, the position optimization model is pre-trained and can obtain the optimized position information based on the input position information and discrete value.
[0055] That is to say, this embodiment obtains the final position information of the target detection frame based on the target discrete value, so that the confidence of the target detection frame is fully utilized, and the final position information integrates the target discrete value obtained by the confidence, thereby improving the accuracy of the final position information obtained.
[0056] After executing S103 to obtain the final position information of the target detection frame, this embodiment can obtain the image features of the detection object corresponding to the target detection frame from the image to be processed based on the final position information, and then perform preset processing such as target classification and target tracking based on the image features.
[0057] It can be understood that the final position information of the target detection frame in the image to be processed obtained by executing S103 in this embodiment can be used as the historical final position information of the target detection frame in the future frame image located after the image to be processed, so as to obtain the final position information of the target detection frame in the future frame image; that is, this embodiment can record the obtained final position information to determine the final position information of other images.
[0058] Figure 2 Schematic diagram of the second embodiment of the present disclosure. Figure 2 As shown, in this embodiment, when executing S103 "obtaining the final position information of the target detection frame based on the initial position information and the target discrete value", the following steps may be included:
[0059] S201, obtaining historical target discrete values and historical final position information of the target detection frame;
[0060] S202 : Obtain final position information of the target detection frame according to the initial position information, the target discrete value, the historical final position information, and the historical target discrete value.
[0061] That is to say, in addition to using the initial position information and target discrete value of the target detection frame, this embodiment will also combine the historical final position information and historical target discrete value of the target detection frame to jointly obtain the final position information of the target detection frame, thereby further improving the accuracy of the obtained final position information.
[0062] When executing S201 to obtain the historical target discrete value and historical final position information of the target detection frame, this embodiment can first determine the historical frame image corresponding to the image to be processed, which is the previous frame image adjacent to the image to be processed in the video containing the image to be processed, and then obtain the historical target discrete value and historical final position information of the target detection frame based on the determined historical frame image.
[0063] The historical target discrete value of the target detection frame obtained by executing S201 in this embodiment is the historical frame image of the target detection frame obtained when the historical frame image is used as the image to be processed; the historical final position information of the target detection frame obtained by executing S201 in this embodiment is the final position information of the target detection frame obtained when the historical frame image is used as the image to be processed.
[0064] That is to say, after obtaining the target discrete value and final position information of the target detection frame in the image to be processed, this embodiment can use the obtained target discrete value and final position information as the historical target discrete value and historical final position information corresponding to the future frame image located after the image to be processed, so as to determine the final position information of the target detection frame in the future frame image.
[0065] In this embodiment, when executing S202 to obtain the final position information of the target detection frame based on the initial position information, the target discrete value, the historical final position information, and the historical target discrete value, the following preset calculation formula can be used:
[0066]
[0067] In the above calculation formula: μ' is the final position information; μ0 is the initial position information; μ1 is the historical final position information; σ' 2 is the target discrete value; σ1 2 is the historical target discrete value.
[0068] It can be understood that when the location information contains multiple coordinates, this embodiment can perform separate calculations for each coordinate when executing S203; for example, for the upper left corner coordinate, μ0 is the upper left corner coordinate in the initial location information, μ1 is the upper left corner coordinate in the historical final location information, and μ' is the upper left corner coordinate in the final location information.
[0069] Figure 3 Schematic diagram of the third embodiment of the present disclosure. Figure 3 As shown, the target detection device 300 of this embodiment includes:
[0070] The detection unit 301 is used to perform target detection on the image to be processed and obtain the initial position information and confidence level of the target detection frame in the image to be processed;
[0071] The processing unit 302 is configured to obtain a target discrete value of the target detection frame based on the confidence level.
[0072] The optimization unit 303 is configured to obtain final position information of the target detection frame based on the initial position information and the target discrete value.
[0073] The detection unit 301 can use the image input from the input end as the image to be processed, or use the image selected on the page from the input end as the image to be processed, or select a frame of image from the video input or selected from the input end as the image to be processed.
[0074] When performing target detection on the image to be processed, the detection unit 301 can input the image to be processed into the target detection model to obtain the initial position information and confidence of the target detection box output by the target detection model; wherein, the target detection box corresponds to the target detection object in the image to be processed, specifically the minimum circumscribed rectangular box surrounding the target detection object in the image to be processed.
[0075] The target detection model used by the detection unit 301 can be trained based on a deep learning method. This embodiment does not limit the type of the target detection model.
[0076] The initial position information of the target detection frame obtained by the detection unit 301 is the position information of the target detection frame in the image to be processed. The initial position information may include the upper left corner coordinates, upper right corner coordinates, lower left corner coordinates and lower right corner coordinates of the target detection frame in the image to be processed. It may also include the upper left corner coordinates and lower right corner coordinates of the target detection frame in the image to be processed. This embodiment does not limit the type of coordinates contained in the initial position information.
[0077] The confidence of the target detection frame obtained by the detection unit 301 indicates the degree of confidence that the target detection object is contained in the target detection frame, that is, the accuracy of the initial position information of the target detection frame; the higher the confidence, the higher the degree of confidence that the target detection object is contained in the target detection frame, and the higher the accuracy of the obtained initial position information; otherwise, the lower the degree of confidence that the target detection object is contained in the target detection frame, and the lower the accuracy of the obtained initial position information.
[0078] The target detection frame obtained by the detection unit 301 may be all detection frames in the image to be processed, or may be part of the detection frames in the image to be processed, that is, the number of target detection frames in this embodiment may be one or more.
[0079] When the detection unit 301 performs target detection on the image to be processed and obtains the initial position information and confidence of the target detection frame in the image to be processed, the following method can also be adopted: performing target detection on the image to be processed and obtaining the confidence of each detection frame in the image to be processed; taking the detection frame whose confidence exceeds the confidence threshold as the target detection frame, and obtaining the initial position information and confidence of the target detection frame.
[0080] That is to say, the detection unit 301 can screen the detection frames in the image to be processed according to the confidence level, so as to use the detection frames whose confidence levels meet the preset requirements as target detection frames and discard the detection frames with lower confidence levels, thereby avoiding waste of computing resources and improving the efficiency of target detection.
[0081] In this embodiment, after the detection unit 301 obtains the initial position information and confidence of the target detection frame in the image to be processed, the processing unit 302 obtains the target discrete value of the target detection frame based on the confidence.
[0082] The target discrete value obtained by the processing unit 302 is used to indicate the degree of discreteness between the final position information and the initial position information of the target detection frame; wherein, a larger target discrete value indicates that the final position information of the target detection frame is further away from the initial position information, and a smaller target discrete value indicates that the final position information of the target detection frame is closer to the initial position information; the final position information in this embodiment is the accurate position information of the target detection frame.
[0083] Typically, existing technologies only filter detection frames based on their confidence levels, and then use the initial position information of the filtered detection frames as accurate position information. They do not obtain target discrete values based on the confidence levels of the detection frames, and further process the initial position information based on the target discrete values to obtain the final position information of the target detection frames.
[0084] Since different confidence levels correspond to different degrees of discreteness, the way in which the processing unit 302 obtains the target discrete value of the target detection frame based on the confidence level of the target detection frame can achieve the purpose of treating different target detection frames separately, avoiding the problem of the existing technology of treating target detection frames with different confidence levels equally, and improving the rationality of the obtained target discrete value.
[0085] When the processing unit 302 obtains the target discrete value of the target detection frame based on the confidence level, an optional implementation method that can be adopted is: obtaining discrete value calculation parameters; and obtaining the target discrete value of the target detection frame based on the confidence level and the obtained discrete value calculation parameters.
[0086] When the processing unit 302 calculates the parameter based on the confidence and the discrete value to obtain the target discrete value of the target detection frame, the following preset calculation formula can be used:
[0087] σ' 2 =λ(1-conf)
[0088] In the above calculation formula: σ' 2 is the target discrete value; λ is the discrete value calculation parameter, and the discrete value calculation parameter in this embodiment is preferably 2; conf is the confidence level; the target discrete value calculated using the above formula can be considered as the variance.
[0089] When the processing unit 302 calculates the parameters based on the confidence and discrete value to obtain the target discrete value of the target detection frame, it can also use the following preset calculation formula:
[0090]
[0091] In the above calculation formula: σ' is the target discrete value; λ is the discrete value calculation parameter, and the discrete value calculation parameter in this embodiment is preferably 2; conf is the confidence level; the target discrete value calculated using the above formula can be considered as the standard deviation.
[0092] When the processing unit 302 obtains the target discrete value of the target detection frame based on the confidence level and the discrete value calculation parameter, it may also use the product result between the confidence level and the discrete value calculation parameter as the target discrete value of the target detection frame.
[0093] When the processing unit 302 obtains the target discrete value of the target detection frame based on the confidence level, it can also use the discrete value corresponding to the confidence level of the target detection frame as the target discrete value of the target detection frame according to the correspondence between the confidence level and the discrete value.
[0094] That is, the processing unit 302 may also preset a correspondence between the reliability and the discrete value, and obtain the target discrete value of the target detection frame according to the correspondence, thereby simplifying the steps of obtaining the target discrete value and improving the efficiency of obtaining the target discrete value.
[0095] When the processing unit 302 obtains the target discrete value of the target detection frame based on the confidence level, it can also adopt the following method: based on the obtained confidence level, obtain the initial discrete value of the target detection frame; obtain the historical target discrete value of the target detection frame; and obtain the target discrete value of the target detection frame based on the initial discrete value and the historical target discrete value.
[0096] When the processing unit 302 obtains the historical target discrete value of the target detection frame, it can first determine the historical frame image corresponding to the image to be processed, and then obtain the historical target discrete value of the target detection frame based on the determined historical frame image.
[0097] It can be understood that the target discrete value of the target detection frame in the image to be processed obtained by the processing unit 302 can be used as the historical target discrete value of the target detection frame in the future frame image located after the image to be processed, so as to obtain the target discrete value of the target detection frame in the future frame image; that is, the processing unit 302 can record the obtained target discrete value to determine the final position information and / or target discrete value of other images.
[0098] That is to say, in addition to using the confidence of the target detection frame, the processing unit 302 can also combine the historical target discrete values corresponding to the target detection frame in the historical frame image to jointly obtain the target discrete value of the target detection frame, and use the historical target discrete value to optimize the initial discrete value, which can improve the accuracy of the obtained target discrete value.
[0099] When the processing unit 302 obtains the target discrete value of the target detection frame according to the initial discrete value and the historical target discrete value, the following calculation formula can be used:
[0100]
[0101] In the above calculation formula: σ' 2 is the target discrete value; σ0 2 is the initial discrete value; σ1 2 is the historical target discrete value.
[0102] In this embodiment, after the processing unit 302 obtains the target discrete value of the target detection frame, the optimization unit 303 obtains the final position information of the target detection frame based on the initial position information of the target detection frame and the target discrete value.
[0103] When there are multiple target detection frames obtained by the detection unit 301, the optimization unit 303 obtains the final position information of each target detection frame based on the initial position information and the target discrete value of each target detection frame.
[0104] When the optimization unit 303 obtains the final position information of the target detection frame based on the initial position information and the target discrete value of the target detection frame, the initial position information and the target discrete value of the target detection frame can be input into the position optimization model, and the output result of the position optimization model can be used as the final position information of the target detection frame; wherein, the position optimization model is pre-trained and can obtain the optimized position information based on the input position information and discrete value.
[0105] That is to say, the optimization unit 303 obtains the final position information of the target detection frame based on the target discrete value, so that the confidence of the target detection frame is fully utilized, and the final position information integrates the target discrete value obtained by the confidence, thereby improving the accuracy of the final position information obtained.
[0106] After obtaining the final position information of the target detection frame, the optimization unit 303 can obtain the image features of the detection object corresponding to the target detection frame from the image to be processed based on the final position information, and then perform preset processing such as target classification and target tracking based on the image features.
[0107] It can be understood that the final position information of the target detection frame in the image to be processed obtained by the optimization unit 303 can be used as the historical final position information of the target detection frame in the future frame image located after the image to be processed, so as to obtain the final position information of the target detection frame in the future frame image; that is, the optimization unit 303 can record the obtained final position information to determine the final position information of other images.
[0108] When the optimization unit 303 obtains the final position information of the target detection frame based on the initial position information and the target discrete value, it can also adopt the following method: obtain the historical target discrete value and the historical final position information of the target detection frame; obtain the final position information of the target detection frame according to the initial position information, the target discrete value, the historical final position information and the historical target discrete value.
[0109] That is to say, in addition to using the initial position information and target discrete value of the target detection frame, the optimization unit 303 will also combine the historical final position information and historical target discrete value of the target detection frame to jointly obtain the final position information of the target detection frame, thereby further improving the accuracy of the obtained final position information.
[0110] When obtaining the historical target discrete values and historical final position information of the target detection frame, the optimization unit 303 can first determine the historical frame image corresponding to the image to be processed, and then obtain the historical target discrete values and historical final position information of the target detection frame based on the determined historical frame image.
[0111] The historical target discrete value of the target detection frame obtained by the optimization unit 303 is the historical frame image of the target detection frame obtained when the historical frame image is used as the image to be processed; the historical final position information of the target detection frame obtained by the optimization unit 303 is the final position information of the target detection frame obtained when the historical frame image is used as the image to be processed.
[0112] That is to say, after obtaining the target discrete value and final position information of the target detection frame in the image to be processed, the optimization unit 303 can use the obtained target discrete value and final position information as the historical target discrete value and historical final position information corresponding to the future frame image located after the image to be processed, so as to determine the final position information of the target detection frame in the future frame image.
[0113] When the optimization unit 303 obtains the final position information of the target detection frame according to the initial position information, the target discrete value, the historical final position information, and the historical target discrete value, the following preset calculation formula can be used:
[0114]
[0115] In the above calculation formula: μ' is the final position information; μ0 is the initial position information; μ1 is the historical final position information; σ' 2 is the target discrete value; σ1 2 is the historical target discrete value.
[0116] It is understandable that when the position information includes multiple coordinates, the optimization unit 303 can perform calculations for each coordinate separately.
[0117] In the technical solutions disclosed herein, the acquisition, storage, and application of user personal information involved comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0118] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0119] like Figure 4, is a block diagram of an electronic device according to a target detection method according to an embodiment of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0120] like Figure 4 As shown, the device 400 includes a computing unit 401, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 402 or a computer program loaded from a storage unit 408 into a random access memory (RAM) 403. Various programs and data required for the operation of the device 400 can also be stored in the RAM 403. The computing unit 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0121] Various components in device 400 are connected to I / O interface 405, including an input unit 406, such as a keyboard, mouse, etc.; an output unit 407, such as various types of displays, speakers, etc.; a storage unit 408, such as a magnetic disk, optical disk, etc.; and a communication unit 409, such as a network card, modem, wireless communication transceiver, etc. Communication unit 409 allows device 400 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0122] The computing unit 401 can be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 401 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 401 performs the various methods and processes described above, such as the target detection method. For example, in some embodiments, the target detection method can be implemented as a computer software program that is tangibly contained in a machine-readable medium, such as the storage unit 408.
[0123] In some embodiments, part or all of the computer program may be loaded and / or installed on the device 400 via the ROM 402 and / or the communication unit 409. When the computer program is loaded into the RAM 403 and executed by the computing unit 401, one or more steps of the target detection method described above may be performed. Alternatively, in other embodiments, the computing unit 401 may be configured to perform the target detection method in any other suitable manner (e.g., by means of firmware).
[0124] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0125] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable target detection device so that the program code, when executed by the processor or controller, causes the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code can be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.
[0126] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer 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 foregoing.
[0127] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0128] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.
[0129] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact via a communication network. The client-server relationship is established by computer programs running on the respective computers and establishing a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, a host product within the cloud computing service system that addresses the management difficulties and poor business scalability of traditional physical hosts and VPS services ("Virtual Private Servers," or simply "VPS"). The server may also be a server in a distributed system or a server integrated with blockchain.
[0130] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not limited herein.
[0131] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the scope of protection of this disclosure.
Claims
1. A target detection method, comprising: Performing target detection on the image to be processed to obtain initial position information and confidence of the target detection frame in the image to be processed; Based on the confidence level, obtaining a target discrete value of the target detection frame; Obtaining final position information of the target detection frame based on the initial position information and the target discrete value; The step of obtaining a target discrete value of the target detection frame based on the confidence level includes: Based on the confidence level, obtaining an initial discrete value of the target detection box; Obtaining historical target discrete values of the target detection frame; A target discrete value of the target detection frame is obtained according to the initial discrete value and the historical target discrete value.
2. The method according to claim 1, wherein The step of performing target detection on the image to be processed and obtaining the initial position information and confidence level of the target detection frame in the image to be processed includes: Performing target detection on the image to be processed to obtain the confidence level of each detection frame in the image to be processed; The detection frame whose confidence exceeds the confidence threshold is used as the target detection frame, and the initial position information and confidence of the target detection frame are obtained.
3. The method according to any one of claims 1 to 2, wherein Obtaining a target discrete value of the target detection frame based on the confidence level includes: Get discrete value calculation parameters; A target discrete value of the target detection frame is obtained based on the confidence level and the discrete value calculation parameter.
4. The method according to claim 1, wherein The obtaining of the historical target discrete value of the target detection frame includes: Determining a historical frame image corresponding to the image to be processed; Based on the historical frame image, a historical target discrete value of the target detection frame is obtained.
5. The method according to claim 1, wherein The obtaining of the final position information of the target detection frame based on the initial position information and the target discrete value includes: Obtain historical target discrete values and historical final position information of the target detection frame; The final position information of the target detection frame is obtained according to the initial position information, the target discrete value, the historical final position information and the historical target discrete value.
6. The method according to claim 5, wherein: The acquiring of the historical target discrete value and the historical final position information of the target detection frame includes: Determining a historical frame image corresponding to the image to be processed; Based on the historical frame image, historical target discrete values and historical final position information of the target detection frame are obtained.
7. A target detection device comprising: A detection unit, configured to perform target detection on the image to be processed, and obtain initial position information and confidence of the target detection frame in the image to be processed; a processing unit, configured to obtain a target discrete value of the target detection frame based on the confidence level; an optimization unit, configured to obtain final position information of the target detection frame based on the initial position information and the target discrete value; When obtaining the target discrete value of the target detection frame based on the confidence level, the processing unit specifically performs: Based on the confidence level, obtaining an initial discrete value of the target detection box; Obtaining historical target discrete values of the target detection frame; A target discrete value of the target detection frame is obtained according to the initial discrete value and the historical target discrete value.
8. The device according to claim 7, wherein When the detection unit performs target detection on the image to be processed and obtains the initial position information and confidence of the target detection frame in the image to be processed, the detection unit specifically performs the following steps: Performing target detection on the image to be processed to obtain the confidence level of each detection frame in the image to be processed; The detection frame whose confidence exceeds the confidence threshold is used as the target detection frame, and the initial position information and confidence of the target detection frame are obtained.
9. The device according to any one of claims 7 to 8, wherein: When the processing unit obtains the target discrete value of the target detection frame based on the confidence level, the processing unit specifically performs: Get discrete value calculation parameters; A target discrete value of the target detection frame is obtained based on the confidence level and the discrete value calculation parameter.
10. The device according to claim 7, wherein When obtaining the historical target discrete value of the target detection frame, the processing unit specifically performs: Determining a historical frame image corresponding to the image to be processed; Based on the historical frame image, a historical target discrete value of the target detection frame is obtained.
11. The device according to claim 7, wherein When the optimization unit obtains the final position information of the target detection frame based on the initial position information and the target discrete value, the optimization unit specifically performs: Obtain historical target discrete values and historical final position information of the target detection frame; The final position information of the target detection frame is obtained according to the initial position information, the target discrete value, the historical final position information and the historical target discrete value.
12. The device according to claim 11, wherein When obtaining the historical target discrete value and the historical final position information of the target detection frame, the optimization unit specifically performs: Determining a historical frame image corresponding to the image to be processed; Based on the historical frame image, historical target discrete values and historical final position information of the target detection frame are obtained.
13. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 6.
14. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 6.
15. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Image processing method, device and equipment, and storage medium
CN110136198A
Target tracking method and device, computing equipment and storage medium
CN111667501A