Target detection method and related device

By performing tailoring and object detection based on the cropping and resolution rate on super-resolution images, combined with technologies such as retention, filtering and NMS processing, the problem of reducing object detection efficiency caused by the many targets to be detected in super-resolution images is solved, and more efficient object detection is achieved.

CN119863474APending Publication Date: 2025-04-22SUZHOU MEGAROBO TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411776730.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-04-22

AI Technical Summary

Technical Problem

In super-resolution images, when there are many objects to be detected, complex image processing is required for a large number of detection results, resulting in a reduction in overall object detection efficiency.

Method used

By cropping the image based on the clipping overlap rate and the clipping size, multiple sub-images are obtained; the target to be detected in the multiple sub-images are detected to obtain the object detection result; the target detection result is restored to the corresponding position of the original image; the result is processed based on the area position of the object detection result in the sub-image, including retention, filtering and non-maximum suppression (NMS) processing.

Benefits of technology

The amount of data that requires complex image processing is reduced, the efficiency of object detection is improved, and the amount of data and memory usage in NMS processing is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119863474A_ABST
    Figure CN119863474A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a target detection method and a related device, and the method comprises the steps: carrying out the cutting of an image based on a cutting overlapping rate and a cutting size, and obtaining a plurality of sub-images; detecting a to-be-detected target in the plurality of sub-images to obtain a target detection result of the plurality of sub-images; restoring the target detection nodes of the plurality of sub-images to corresponding positions of the image to obtain a target detection result of the image; processing the target detection result based on the regional position of the target detection result in the sub-image to obtain a processed target detection result of the image; the region position in the sub-image comprises a reserved region, a filtering region and a non-maximum suppression region which are determined in the sub-image based on the clipping overlapping ratio. According to the embodiment of the invention, corresponding processing can be carried out on the target detection results of different areas, the data volume needing complex image processing is reduced, and the target detection efficiency can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a target detection method and related devices. Background Art

[0002] Super-resolution technology is a technology that generates super-resolution images with high definition and rich details by improving image resolution. It is widely used in the field of object detection. However, when the super-resolution image size is large and the size of the target to be detected is relatively small, the target detection result is often difficult to meet the user's expectations.

[0003] At present, by cutting a large-sized super-resolution image into several small-sized sub-images, performing object detection on the several small-sized sub-images respectively, and merging the object detection results of the several sub-images into the original super-resolution image, the object detection effect in the large-sized super-resolution image can be improved.

[0004] However, when there are many targets to be detected in a super-resolution image, complex image processing is required for a large number of detection results, which requires a lot of calculations and reduces the overall target detection efficiency. Summary of the invention

[0005] Based on the above problems, the present application provides a target detection method and related devices.

[0006] The embodiments of the present application disclose the following technical solutions:

[0007] In the first aspect, the present application provides a target detection method, including:

[0008] The image is cropped based on the cropping overlap ratio and the cropping size to obtain a plurality of sub-images;

[0009] Detecting the target to be detected in the multiple sub-images to obtain target detection results of the multiple sub-images;

[0010] Restoring the target detection results of the multiple sub-images to corresponding positions of the image to obtain the target detection result of the image;

[0011] Based on the regional position of the target detection result in the sub-image, the target detection result is processed to obtain the processed target detection result of the image; the regional position in the sub-image includes a retained area, a filtered area and a non-maximum suppression (NMS) area determined in the sub-image based on the clipping overlap rate.

[0012] In a possible implementation manner, the processing the target detection result based on the regional position of the target detection result in the sub-image to obtain the processed target detection result of the image includes:

[0013] When the target detection result is in the reserved area of ​​the sub-image, the target detection result is retained to obtain the retained target detection result; when the target detection result is in the filtering area of ​​the sub-image, the target detection result is filtered; when the target detection result is in the NMS area of ​​the sub-image, the target detection result is NMS processed to obtain the target detection result after NMS processing;

[0014] Based on at least one of the retained target detection result and the target detection result after NMS processing, a processed target detection result of the image is obtained.

[0015] In a possible implementation, when the target detection result is in a reserved area of ​​the sub-image, retaining the target detection result to obtain a retained target detection result; when the target detection result is in a filtering area of ​​the sub-image, filtering the target detection result; when the target detection result is in an NMS area of ​​the sub-image, performing NMS processing on the target detection result to obtain a target detection result after NMS processing, including:

[0016] When the target detection result is in the reserved area of ​​the sub-image, retain the target detection result to obtain the reserved target detection result, and store the reserved target detection result in the first candidate list;

[0017] When the target detection result is in the filtering area of ​​the sub-image, filtering the target detection result;

[0018] When the target detection result is in the NMS area of ​​the sub-image, storing the target detection result in the NMS area of ​​the sub-image in a second candidate list;

[0019] Performing NMS processing on the target detection results in the second candidate list to obtain target detection results after NMS processing, and storing the target detection results after NMS processing in the first candidate list;

[0020] The obtaining the processed target detection result of the image based on at least one of the retained target detection result and the target detection result after NMS processing includes:

[0021] The target detection result in the first candidate list is used as the processed target detection result of the image.

[0022] In a possible implementation, the step of determining the retained area, the filtered area, and the non-maximum suppression (NMS) area includes:

[0023] Determine a first frame based on the clipping frame of the sub-image and a first distance; the first distance is the product of the clipping overlap rate, the first weight and the clipping size;

[0024] Determine the area between the first frame and the clipping frame as a filtering area of ​​the sub-image;

[0025] Determine a second frame based on the clipping frame of the sub-image and a second distance; the second distance is the product of the clipping overlap rate, the second weight and the clipping size;

[0026] The area between the second border and the first border is determined as the NMS area of ​​the sub-image; and the area surrounded by the second border is determined as the reserved area of ​​the sub-image.

[0027] In a possible implementation manner, detecting the target to be detected in the multiple sub-images to obtain the target detection results of the multiple sub-images includes:

[0028] Detecting the targets to be detected in the multiple sub-images to obtain initial target detection results of the multiple sub-images;

[0029] The initial target detection results of the multiple sub-images are subjected to NMS processing to obtain target detection results of the multiple sub-images.

[0030] In a possible implementation, the image is cropped based on the cropping overlap ratio and the cropping size to obtain a plurality of sub-images, including:

[0031] Performing clustering processing on the annotation box information in the training image to determine the size of the annotation box information; the annotation box information is obtained by annotating the target to be detected in the training image;

[0032] twice the ratio of the size of the annotation box information to the size of the training block is determined as the clipping overlap ratio;

[0033] The image is cropped based on the cropping overlap ratio and the cropping size to obtain multiple sub-images.

[0034] A second aspect: The embodiment of the present application provides a target detection device, including:

[0035] A cutting unit, a detecting unit, a restoring unit, and a processing unit;

[0036] The cropping unit is used to crop the image based on the cropping overlap rate and the cropping size to obtain multiple sub-images;

[0037] The detection unit is used to detect the target to be detected in the multiple sub-images and obtain the target detection results of the multiple sub-images;

[0038] The restoration unit is used to restore the target detection results of the multiple sub-images to corresponding positions of the image to obtain the target detection result of the image;

[0039] The processing unit is used to process the target detection result based on the regional position of the target detection result in the sub-image to obtain the processed target detection result of the image; the regional position in the sub-image includes a retained area, a filtered area and a non-maximum suppression (NMS) area determined in the sub-image based on the clipping overlap rate.

[0040] A third aspect: An embodiment of the present application provides a computer device, the computer device comprising: a processor and a memory;

[0041] The memory is used to store program code and transmit the program code to the processor;

[0042] The processor is used to execute the steps of the target detection method as described above according to the instructions in the program code.

[0043] Aspect 4: An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of a target detection method as described above are implemented.

[0044] Aspect 5: An embodiment of the present application provides a computer program product, wherein a computer program is stored on a computer-readable storage medium, and when the computer program is executed by a processor, the steps of a target detection method as described above are implemented.

[0045] Compared with the prior art, this application has the following beneficial effects:

[0046] The embodiment of the present application provides a target detection method, which obtains multiple sub-images by cropping an image based on a cropping overlap rate and a cropping size; detects the target to be detected in the multiple sub-images to obtain the target detection results of the multiple sub-images; restores the target detection results of the multiple sub-images to the corresponding positions of the image to obtain the target detection results of the image; and processes the target detection results based on the regional positions of the target detection results in the sub-images to obtain the processed target detection results of the image. Wherein, the regional positions in the sub-images include the reserved areas, the filter areas, and the non-maximum suppression (NMS) areas determined in the sub-images based on the cropping overlap rate. In the embodiment of the present application, based on the cropping overlap rate, the reserved areas, the filter areas, and the NMS areas can be divided from the sub-images. On this basis, the target detection results of different areas can be processed accordingly. For example, the target detection results of the reserved areas can be directly retained, and only the target detection results of the NMS areas are processed by NMS, thereby reducing the amount of data required for complex image processing and effectively improving the efficiency of target detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0048] Figure 1 A flow chart of a target detection method provided in an embodiment of the present application;

[0049] Figure 2 A schematic diagram of image clipping provided in an embodiment of the present application;

[0050] Figure 3 A schematic diagram of each area in a sub-image provided in an embodiment of the present application;

[0051] Figure 4 A schematic diagram of target detection provided in an embodiment of the present application;

[0052] Figure 5 A schematic diagram of the structure of a target detection device is provided for an embodiment of the present application. DETAILED DESCRIPTION

[0053] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0054] Super-resolution technology is a technology that generates super-resolution images with high definition and rich details by improving image resolution. It is widely used in the field of object detection. However, when the super-resolution image size is large and the size of the target to be detected is relatively small, the target detection result is often difficult to meet the user's expectations.

[0055] For example, a super-resolution image with a resolution of 640×480 pixels has a total of 307,200 pixels. If the target to be detected only occupies 5-10 pixels, in the target detection process, after the super-resolution image is downsampled multiple times, the features of the small-sized targets to be detected may be lost, which may lead to the inability to detect the target to be detected, thus reducing the target detection effect.

[0056] To improve the target detection effect, currently a large-size super-resolution image can be cut into several small-size sub-images, and target detection is performed on several small-size sub-images respectively. The target detection results of several sub-images are merged into the original super-resolution image to improve the target detection effect in the large-size super-resolution image.

[0057] However, after obtaining the target detection results of several sub-images, complex image post-processing is required for the target detection results of several sub-images. When there are a large number of targets to be detected on the super-resolution image, complex image processing is required for a large number of target detection results, resulting in a decrease in the overall target detection efficiency.

[0058] Exemplarily, image post-processing includes NMS processing. In the process of NMS processing the target detection results of several sub-images, it is necessary to traverse the detection frames in all target detection results, and sort and filter all detection frames according to confidence and intersection and union. Therefore, the more detection frames there are, the greater the amount of calculation in the NMS processing process, and the longer the corresponding processing time. When the targets to be detected in the super-resolution image are dense and numerous, a large number of detection frames need to be processed during the NMS processing, which takes a long time and reduces the overall target detection efficiency.

[0059] Based on this, an embodiment of the present application provides a target detection method, which obtains multiple sub-images by cropping an image based on a cropping overlap rate and a cropping size; detects the targets to be detected in the multiple sub-images to obtain target detection results of the multiple sub-images; restores the target detection results of the multiple sub-images to corresponding positions of the image to obtain target detection results of the image; and processes the target detection results based on the regional positions of the target detection results in the sub-images to obtain processed target detection results of the image. In an embodiment of the present application, based on the cropping overlap rate, a reserved area, a filtered area, and a non-maximum suppression (NMS) area can be divided from the sub-image. On this basis, corresponding processing can be performed on the target detection results of different areas. For example, the target detection results of the reserved area can be directly retained, and only the target detection results of the NMS area are subjected to NMS processing, thereby reducing the amount of data required for complex image processing and effectively improving the efficiency of target detection.

[0060] The target detection method provided in the embodiment of the present application is introduced below.

[0061] like Figure 1 As shown, the figure is a flow chart of a target detection method provided in an embodiment of the present application, including S101-S104.

[0062] S101 . Crop an image based on a cropping overlap ratio and a cropping size to obtain a plurality of sub-images.

[0063] In the embodiment of the present application, the image may be a super-resolution image; the cropping overlap ratio is the ratio of the area of ​​the intersection between two adjacent sub-images to the area of ​​the sub-image; the cropping size may include but is not limited to the length and width of the sub-image.

[0064] In a possible implementation, the labeled box information can be obtained by labeling the target to be detected in the training image. On this basis, clustering processing is performed on the labeled box information in the training image to determine the size of the labeled box information.

[0065] After the size of the annotation box information is determined, twice the ratio of the size of the annotation box information to the size of the training block may be determined as the clipping overlap rate.

[0066] For ease of description, the following description will be made by taking the size of the annotation box information as the width of the annotation box information and the cropping size as the width of the sub-image as an example.

[0067] As shown in formula (1), the crop overlap ratio can be expressed as twice the ratio of the width of the annotation box information to the training block size.

[0068] OverLoopRate=2×W / training patch size (1)

[0069] Among them, OverLoopRate represents the cropping overlap rate; W represents the width of the annotation box information; training patchsize represents the training patch size.

[0070] After determining the cropping overlap ratio, the image can be cropped based on the cropping overlap ratio and the cropping size to obtain multiple sub-images. Figure 2 When cropping the image 1100, the image 1100 can be cropped according to the cropping size along the horizontal (x) axis direction of the image 1100 based on the cropping overlap ratio to obtain multiple sub-images 1101 of the cropping size.

[0071] In target detection tasks, the size of the clipping overlap rate can affect the accuracy and completeness of target detection results. A higher clipping overlap rate can ensure that the target is covered by multiple clipping windows, thereby improving the accuracy of target detection; but too high a clipping overlap rate will increase the amount of calculation and reduce the processing speed. In an embodiment of the present application, based on the size of the annotation box information determined by clustering the annotation box information in the training image, the minimum clipping overlap rate can be obtained to reduce the number of cropped sub-images, thereby ensuring the accuracy of target detection while improving the target detection speed.

[0072] It is understandable that the cropping direction is not specifically limited in the embodiment of the present application, and the above description only takes cropping along the x-axis direction of the image as an example.

[0073] S102: Detect targets to be detected in the multiple sub-images to obtain target detection results of the multiple sub-images.

[0074] In a possible implementation, initial target detection results of the multiple sub-images may be obtained by detecting the targets to be detected in the multiple sub-images. The initial target detection results of the multiple sub-images may be subjected to NMS processing to obtain target detection results of the multiple sub-images.

[0075] The target detection result may include, but is not limited to, information such as a detection box corresponding to the detected target, a confidence level corresponding to the detection box, and a coordinate position of the detection box in the sub-image.

[0076] Exemplarily, in the embodiment of the present application, multiple sub-images can be input into the deep learning model to detect the targets to be detected in the multiple sub-images to obtain the initial target detection results of the multiple sub-images. After obtaining the initial target detection results of the multiple sub-images, the initial target detection results of each sub-image can be subjected to an NMS process to remove duplicate detection frames and reduce the number of detection frames.

[0077] In the embodiment of the present application, after obtaining the initial target detection result, the duplicate detection frames are removed through NMS processing, which reduces the number of comparisons between subsequent detection frames and can effectively reduce the computational complexity.

[0078] S103: Restoring the target detection results of the multiple sub-images to corresponding positions of the image to obtain the target detection result of the image.

[0079] Exemplarily, in an embodiment of the present application, based on the corresponding positions of target detection results of multiple sub-images in the sub-images, and the positions of the sub-images corresponding to the original image, it is possible to determine the positions in the original image to which the target detection results of each sub-image correspond.

[0080] Based on the object detection results of each sub-image corresponding to the position in the original image, the object detection results of multiple sub-images can be restored to the corresponding positions of the image to obtain the object detection results of the image.

[0081] S104: Process the target detection result based on the regional position of the target detection result in the sub-image to obtain a processed target detection result of the image.

[0082] The region position in the sub-image includes a reserved region, a filtered region, and a non-maximum suppression (NMS) region determined in the sub-image based on the clipping overlap ratio.

[0083] like Figure 3 As shown, this figure is a schematic diagram of each area in a sub-image provided by an embodiment of the present application. In the embodiment of the present application, based on the clipping border 1200 of the sub-image and the first distance (d1), a first border 1201 can be determined. The area between the first border 1201 and the clipping border 1200 is determined as the filtering area 1202 of the sub-image. Among them, the first distance is the product of the clipping overlap rate, the first weight and the clipping size.

[0084] Exemplarily, when the clipping width is 1, the clipping overlap rate is 0.2, and the first weight is 1 / 2, the first distance can be obtained as 0.1.

[0085] In the embodiment of the present application, based on the cropping border 1200 of the sub-image and the second distance (d2), a second border 1203 can be determined. The area between the second border 1203 and the first border 1201 is determined as the NMS area 1204 of the sub-image, and the area surrounded by the second border 1203 is determined as the reserved area 1205 of the sub-image. The second distance is the product of the cropping overlap rate, the second weight and the cropping size.

[0086] Exemplarily, when the clipping width is 1, the clipping overlap rate is 0.2, and the second weight is 2, the second distance can be obtained as 0.4.

[0087] In an embodiment of the present application, after determining the regional position in the sub-image and obtaining the target detection result, the target detection result can be processed accordingly based on the regional position of the target detection result in the sub-image.

[0088] In one example, when the target detection result is in the reserved area of ​​the sub-image, the target detection result is retained to obtain the retained target detection result. When the target detection result is in the filtering area of ​​the sub-image, the target detection result can be directly filtered. When the target detection result is in the NMS area of ​​the sub-image, the target detection result can be NMS processed to obtain the target detection result after NMS processing.

[0089] In the embodiment of the present application, a plurality of processed target detection results may be obtained based on at least one of the retained target detection results and the target detection results processed by the NMS.

[0090] In another example, when the target detection result is in the reserved area of ​​the sub-image, the target detection result is reserved to obtain the reserved target detection result, and the reserved target detection result is stored in the first candidate list. The target detection results in the first candidate list are detection results that do not need to be processed again.

[0091] When the target detection result is in the filtering area of ​​the sub-image, the target detection result can be filtered, so that it does not need to be processed later, which can reduce the amount of data for image processing and improve processing efficiency.

[0092] When the target detection result is in the NMS area of ​​the sub-image, the target detection result in the NMS area of ​​the sub-image is stored in the second candidate list. The target detection results in the second candidate list are the detection results that need to be processed by NMS.

[0093] After storing the target detection results in the NMS area of ​​the sub-image in the second candidate list, NMS processing may be performed on the target detection results in the second candidate list to obtain target detection results after NMS processing.

[0094] The target detection result after NMS processing is a detection result that does not need to be processed further. In this case, the target detection result after NMS processing can be stored in the first candidate list.

[0095] The current first candidate list includes the target detection results in the reserved area of ​​the sub-image and the target detection results in the NMS area after NMS processing. At this time, the target detection results included in the current first candidate list can be used as the processed target detection results of the image, and the processed target detection results of the image are the final output results.

[0096] To summarize, in the embodiments of the present application, based on the clipping overlap rate, the sub-image can be divided into a retained area, a filtered area and an NMS area. On this basis, corresponding processing can be performed on the target detection results in different areas. For example, the target detection results in the retained area can be directly retained, and only the target detection results in the NMS area are subjected to NMS processing. This reduces the amount of data that requires complex image processing and can effectively improve the efficiency of target detection.

[0097] At the same time, the method provided in the embodiment of the present application reduces the amount of data in the NMS processing process, reduces memory usage, and reduces the number of comparisons between detection frames, reduces the amount of calculation, and effectively improves data processing efficiency.

[0098] For ease of understanding, the following Figure 4 An overall introduction to a target detection method provided in an embodiment of the present application is given.

[0099] The size of the labeling box information is determined by clustering the labeling box information in the training image, and the clipping overlap ratio is determined based on twice the ratio of the width of the labeling box information to the size of the training block.

[0100] The super-resolution image is cropped along the x-axis direction of the super-resolution image according to the cropping overlap rate and the cropping size to obtain multiple sub-images of the cropping size. The multiple sub-images are input into the trained neural network model for target detection to obtain initial target detection results. The initial target detection results are processed by NMS to remove duplicate detection frames to obtain target detection results of the sub-images.

[0101] Based on the object detection results of each sub-image corresponding to the position in the original image, the object detection results of multiple sub-images are restored to the corresponding positions of the image to obtain the object detection results of the image.

[0102] After obtaining the target detection result of the image, the target detection result is processed accordingly based on the regional position of the target detection result in the sub-image. Exemplarily, when the target detection result is in the reserved area of ​​the sub-image, the target detection result is retained and stored in the first candidate list. When the target detection result is in the filter area of ​​the sub-image, the target detection result can be filtered. When the target detection result is in the NMS area of ​​the sub-image, the target detection result in the NMS area of ​​the sub-image is stored in the second candidate list. The target detection result in the second candidate list is subjected to NMS processing to obtain the target detection result after NMS processing and store it in the first candidate list.

[0103] At this time, the target detection result included in the current first candidate list can be used as the processed target detection result corresponding to the image.

[0104] This application provides a target detection device, see Figure 5 , this figure is a schematic diagram of the structure of a target detection device provided in an embodiment of the present application. Its specific implementation method is consistent with the implementation method and the technical effect achieved in the embodiment of the above method, and some contents will not be repeated here.

[0105] An object detection device 1500, comprising:

[0106] A trimming unit 1501, a detection unit 1502, a restoration unit 1503, and a processing unit 1504;

[0107] The cropping unit 1501 is used to crop the image based on the cropping overlap rate and the cropping size to obtain multiple sub-images;

[0108] The detection unit 1502 is used to detect the target to be detected in the multiple sub-images and obtain the target detection results of the multiple sub-images;

[0109] The restoration unit 1503 is used to restore the target detection results of the multiple sub-images to corresponding positions of the image to obtain the target detection result of the image;

[0110] The processing unit 1504 is used to process the target detection result based on the regional position of the target detection result in the sub-image to obtain the processed target detection result of the image; the regional position in the sub-image includes a retained area, a filtered area and a non-maximum suppression (NMS) area determined in the sub-image based on the clipping overlap rate.

[0111] In a possible implementation, the reduction unit is specifically used to:

[0112] When the target detection result is in the reserved area of ​​the sub-image, the target detection result is retained to obtain the retained target detection result; when the target detection result is in the filtering area of ​​the sub-image, the target detection result is filtered; when the target detection result is in the NMS area of ​​the sub-image, the target detection result is NMS processed to obtain the target detection result after NMS processing;

[0113] Based on at least one of the retained target detection result and the target detection result after NMS processing, a processed target detection result of the image is obtained.

[0114] In a possible implementation, the reduction unit is specifically used to:

[0115] When the target detection result is in the reserved area of ​​the sub-image, retain the target detection result to obtain the reserved target detection result, and store the reserved target detection result in the first candidate list;

[0116] When the target detection result is in the filtering area of ​​the sub-image, filtering the target detection result;

[0117] When the target detection result is in the NMS area of ​​the sub-image, storing the target detection result in the NMS area of ​​the sub-image in a second candidate list;

[0118] Performing NMS processing on the target detection results in the second candidate list to obtain target detection results after NMS processing, and storing the target detection results after NMS processing in the first candidate list;

[0119] The target detection result in the first candidate list is used as the processed target detection result of the image.

[0120] In a possible implementation, the device includes a determination unit for determining a retained area, a filtered area, and a non-maximum suppression (NMS) area;

[0121] The determining unit is specifically configured to:

[0122] Determine a first frame based on the clipping frame of the sub-image and a first distance; the first distance is the product of the clipping overlap rate, the first weight and the clipping size;

[0123] Determine the area between the first frame and the clipping frame as a filtering area of ​​the sub-image;

[0124] Determine a second frame based on the clipping frame of the sub-image and a second distance; the second distance is the product of the clipping overlap rate, the second weight and the clipping size;

[0125] The area between the second border and the first border is determined as the NMS area of ​​the sub-image; and the area surrounded by the second border is determined as the reserved area of ​​the sub-image.

[0126] In a possible implementation, the detection unit is specifically used to:

[0127] Detecting the targets to be detected in the multiple sub-images to obtain initial target detection results of the multiple sub-images;

[0128] The initial target detection results of the multiple sub-images are subjected to NMS processing to obtain target detection results of the multiple sub-images.

[0129] In a possible implementation, the image is cropped based on the cropping overlap ratio and the cropping size to obtain a plurality of sub-images, including:

[0130] Performing clustering processing on the annotation box information in the training image to determine the size of the annotation box information; the annotation box information is obtained by annotating the target to be detected in the training image;

[0131] twice the ratio of the size of the annotation box information to the size of the training block is determined as the clipping overlap ratio;

[0132] The image is cropped based on the cropping overlap ratio and the cropping size to obtain multiple sub-images.

[0133] To summarize, in the embodiments of the present application, based on the clipping overlap rate, the sub-image can be divided into a retained area, a filtered area and an NMS area. On this basis, corresponding processing can be performed on the target detection results in different areas. For example, the target detection results in the retained area can be directly retained, and only the target detection results in the NMS area are subjected to NMS processing. This reduces the amount of data that requires complex image processing and can effectively improve the efficiency of target detection.

[0134] At the same time, the method provided in the embodiment of the present application reduces the amount of data in the NMS processing process, reduces memory usage, and reduces the number of comparisons between detection frames, reduces the amount of calculation, and effectively improves data processing efficiency.

[0135] An embodiment of the present application also provides a computer device, which includes: a processor and a memory; the memory is used to store program code and transmit the program code to the processor; the processor is used to execute the steps of a target detection method as described above according to the instructions in the program code.

[0136] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of a target detection method as described above are implemented.

[0137] An embodiment of the present application further provides a computer program product, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the target detection method described above are implemented.

[0138] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A target detection method, characterized in that: include: The image is cropped based on the cropping overlap ratio and the cropping size to obtain a plurality of sub-images; Detecting the target to be detected in the multiple sub-images to obtain target detection results of the multiple sub-images; Restoring the target detection results of the multiple sub-images to corresponding positions of the image to obtain the target detection result of the image; Based on the regional position of the target detection result in the sub-image, the target detection result is processed to obtain the processed target detection result of the image; the regional position in the sub-image includes a retained area, a filtered area and a non-maximum suppression (NMS) area determined in the sub-image based on the clipping overlap rate.

2. The method according to claim 1, characterized in that The processing of the target detection result based on the regional position of the target detection result in the sub-image to obtain the processed target detection result of the image includes: When the target detection result is in the reserved area of ​​the sub-image, the target detection result is retained to obtain the retained target detection result; when the target detection result is in the filtering area of ​​the sub-image, the target detection result is filtered; when the target detection result is in the NMS area of ​​the sub-image, the target detection result is NMS processed to obtain the target detection result after NMS processing; Based on at least one of the retained target detection result and the target detection result after NMS processing, a processed target detection result of the image is obtained.

3. The method according to claim 2, characterized in that When the target detection result is in the reserved area of ​​the sub-image, retaining the target detection result to obtain a retained target detection result; When the target detection result is in the filtering area of ​​the sub-image, filtering the target detection result; When the target detection result is in the NMS area of ​​the sub-image, performing NMS processing on the target detection result to obtain the target detection result after NMS processing includes: When the target detection result is in the reserved area of ​​the sub-image, retain the target detection result to obtain the reserved target detection result, and store the reserved target detection result in the first candidate list; When the target detection result is in the filtering area of ​​the sub-image, filtering the target detection result; When the target detection result is in the NMS area of ​​the sub-image, storing the target detection result in the NMS area of ​​the sub-image in a second candidate list; Performing NMS processing on the target detection results in the second candidate list to obtain target detection results after NMS processing, and storing the target detection results after NMS processing in the first candidate list; The obtaining the processed target detection result of the image based on at least one of the retained target detection result and the target detection result after NMS processing includes: The target detection result in the first candidate list is used as the processed target detection result of the image.

4. The method according to claim 1, characterized in that: The steps of determining the reserved area, the filtered area and the non-maximum suppression (NMS) area include: Determine a first frame based on the clipping frame of the sub-image and a first distance; the first distance is the product of the clipping overlap rate, the first weight and the clipping size; Determine the area between the first frame and the clipping frame as a filtering area of ​​the sub-image; Determine a second frame based on the clipping frame of the sub-image and a second distance; the second distance is the product of the clipping overlap rate, the second weight and the clipping size; The area between the second border and the first border is determined as the NMS area of ​​the sub-image; and the area surrounded by the second border is determined as the reserved area of ​​the sub-image.

5. The method according to claim 1, characterized in that The detecting the target to be detected in the multiple sub-images to obtain the target detection results of the multiple sub-images includes: Detecting the targets to be detected in the multiple sub-images to obtain initial target detection results of the multiple sub-images; The initial target detection results of the multiple sub-images are subjected to NMS processing to obtain target detection results of the multiple sub-images.

6. The method according to claim 1, characterized in that The image is clipped based on the clipping overlap ratio and the clipping size to obtain a plurality of sub-images, including: Performing clustering processing on the annotation box information in the training image to determine the size of the annotation box information; the annotation box information is obtained by annotating the target to be detected in the training image; twice the ratio of the size of the annotation box information to the size of the training block is determined as the clipping overlap ratio; The image is cropped based on the cropping overlap ratio and the cropping size to obtain multiple sub-images.

7. A target detection device, characterized in that: include: A cutting unit, a detecting unit, a restoring unit, and a processing unit; The cropping unit is used to crop the image based on the cropping overlap rate and the cropping size to obtain multiple sub-images; The detection unit is used to detect the target to be detected in the multiple sub-images and obtain the target detection results of the multiple sub-images; The restoration unit is used to restore the target detection results of the multiple sub-images to corresponding positions of the image to obtain the target detection result of the image; The processing unit is used to process the target detection result based on the regional position of the target detection result in the sub-image to obtain the processed target detection result of the image; the regional position in the sub-image includes a retained area, a filtered area and a non-maximum suppression (NMS) area determined in the sub-image based on the clipping overlap rate.

8. A computer device, characterized in that: The computer device comprises: a processor and a memory; The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the steps of a target detection method as described in any one of claims 1-6 according to the instructions in the program code.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of a target detection method according to any one of claims 1 to 6 are implemented.

10. A computer program product, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of a target detection method according to any one of claims 1 to 6 are implemented.

Citation Information

Cited By

  • Image labeling method and device, electronic equipment and storage medium

    CN120236184A