A method and apparatus for detecting engineering targets in high-resolution images
By employing overlapping segmentation and area-based bounding box fusion strategies for high-resolution images, the problem of false filtering of large bounding boxes in existing technologies is solved, thereby improving the accuracy and completeness of target detection in high-resolution images. This approach is suitable for analysis of engineering construction areas.
Patent Information
- Application Number
- CN202411340878.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2044-09-25
AI Technical Summary
When processing high-resolution aerial images, the completeness and accuracy of target detection in existing technologies are affected by scaling and slicing operations. In particular, large target boxes are easily misfiltered in overlapping areas, leading to inaccurate analysis of engineering construction areas.
By combining overlapping slicing with deep learning, high-resolution images are overlaid and sliced. A target detection model is used to detect small-sized images. An area-based target box fusion strategy is used to filter and fuse overlapping regions to ensure that the target boxes accurately fit the target regions.
It improves the accuracy and reliability of target detection under high-resolution images, ensures the integrity and accuracy of target bounding boxes, and significantly enhances the accuracy and efficiency of engineering construction area analysis.
Smart Images

Figure CN119229093B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of multi-category, multi-target detection of high-resolution images, and in particular to a method, apparatus, electronic device, and computer storage medium for detecting engineering targets in high-resolution images. Background Technology
[0002] During the construction process, engineering technicians usually need to analyze the construction area on the engineering map in order to accurately estimate the project cost and material preparation, thereby assisting them in rationally allocating resources, optimizing construction plans, and improving overall construction efficiency.
[0003] To expedite the analysis of construction areas, traditional techniques employ template-matching methods, utilizing satellite imagery provided by Geographic Information Systems (GIS). However, while template matching performs well when target features (such as shape and size) are fixed, its effectiveness significantly diminishes when the target is rotated, scaled, or partially occluded, making it unsuitable for complex construction scenarios.
[0004] With the widespread adoption of drone aerial photography technology and machine learning, acquiring high-resolution aerial images of construction scenes using drones has become a routine practice. Machine learning is then used to detect and analyze features within these construction areas to assess changes or progress, thus assisting engineers in making informed decisions. However, conventional machine learning methods for processing high-resolution aerial images often require scaling or slicing. Scaling can lead to the loss of information about small targets, affecting the completeness and accuracy of target detection; while slicing can fragment targets at the edges, impacting the continuity of the bounding boxes.
[0005] Based on this, existing technologies have proposed a Slicing Aided Hyper Inference (SAHI) method combined with deep learning for multi-object detection. This SAHI method involves overlapping and slicing a high-resolution aerial image into several smaller images, and then inputting all these smaller images into an object detection model to detect objects within them. The detection results from each smaller image are then stitched together to generate a detection map consistent with the aerial image. Next, to address potential duplicate bounding boxes in the overlapping regions of the stitched image, existing technologies use non-maximum suppression (NMS) to filter the bounding boxes, thus retaining the most representative ones. These bounding boxes can be used by engineers to quickly analyze the land area of a construction site and accordingly prepare materials and allocate resources.
[0006] However, when processing overlapping regions, NMS typically selects the bounding boxes to retain based on confidence level and overlap ratio (cross-union ratio). When multiple bounding boxes have similar confidence levels but significant size differences, the smaller bounding box may be retained due to its higher confidence level, causing the larger bounding box to be filtered out. Consequently, when the detected target is located at the edge of an overlapping slice, its complete bounding box is easily misfiltered, resulting in the bounding box not accurately fitting the target area. This, in turn, prevents engineers from analyzing the construction area's footprint or preparing materials based on accurate bounding boxes. Summary of the Invention
[0007] Based on this, the purpose of the present invention is to provide a method for detecting engineering targets in high-resolution images.
[0008] A method for detecting engineering targets in high-resolution images, comprising the following steps:
[0009] S1: Overlap and cut the high-resolution image to be detected to obtain several small-sized overlapping images to be detected;
[0010] S2: Use a target detection model to detect several small-sized overlapping images to obtain several small-sized detection result images;
[0011] S3: Combine several small-sized detection result images to obtain a high-resolution detection result image;
[0012] S4: An area-based target box fusion strategy is used to sequentially filter and fuse overlapping areas in the high-resolution detection result image to obtain an accurate high-resolution detection result image; wherein, the area-based fusion box strategy is to filter based on the area ratio of the target box to the overlapping area, the area ratio between target boxes, and the intersection-union ratio between target boxes.
[0013] The engineering target detection method for high-resolution images described in this invention effectively solves the problem of large target boxes being misfiltered when processing overlapping regions in existing technologies by employing overlapping slicing, target box stitching, and area-based target box fusion strategies. It ensures that the target box accurately fits the corresponding target region regardless of whether the target is located at the edge of an overlapping slice or spans multiple slices, and avoids overlapping boxes through area fusion. This significantly improves the accuracy and reliability of target detection in high-resolution images, thereby ensuring the integrity of the target boxes for large targets in engineering scenarios.
[0014] Further, step S4 includes the following sub-steps:
[0015] S41: Perform overlapping region analysis on the high-resolution detection result image to obtain several bounding boxes to be analyzed;
[0016] The overlapping region analysis is expressed as follows:
[0017] overlap={area i ∪area j |i∈[1,n x -1],j∈[1,n y -1]}
[0018] In the formula, overlap is the set of all overlapping regions; area i and area j These are the horizontal and vertical overlapping regions, respectively; n x and n y The number of horizontal and vertical cut blocks in the small-sized overlapping image to be detected are respectively calculated as follows:
[0019]
[0020] In the formula, W and H are the width and height of the high-resolution image to be detected, respectively; This is for rounding up; w and h are the width and height of the small overlapping images to be detected, respectively; th is the threshold for the overlapping region to be cut.
[0021] Next, the target bounding boxes intersecting with all overlapping regions are obtained, resulting in several bounding boxes to be analyzed, specifically represented as follows:
[0022] Box = {box k |box k ∩overlap}
[0023] In the formula, Box represents the set of all boxes to be analyzed; k ∩overlap represents the k-th bounding box. k There exists a geometric intersection with any overlapping region; where k∈N, and N is the total number of target boxes that intersect with all overlapping regions;
[0024] S42: Area-based nonmaximum suppression is used to filter several boxes to be analyzed, resulting in several boxes to be merged.
[0025] The specific operation of filtering based on area-based nonmaximum suppression is as follows:
[0026]
[0027] In the formula, Fusion boxThis is the set of all boxes to be fused; remove(·) is used to remove the input boxes to be analyzed from the high-resolution detection result image; keep(·) is used to keep the input boxes to be analyzed in the high-resolution detection result image; The current box to be analyzed k The area of intersection with the overlapping region and the box to be analyzed k The ratio between the areas; while IoA is the current box to be analyzed. k The area ratio to other bounding boxes to be analyzed is expressed as follows:
[0028]
[0029] In the formula, area(box) k ∩box i () indicates the current box to be analyzed. k The area of intersection with other boxes to be analyzed; area(box) k () represents the current box to be analyzed. k The area;
[0030] S43: Several boxes to be fused are filtered by cross-union comparison (CUC), and the filtered boxes are then fused to obtain an accurate high-resolution detection result image; wherein, the specific operation of filtering by CUC is as follows:
[0031]
[0032] In the formula, Fusion filter This is the set of all filtered boxes to be merged; IoU is the intersection-over-union ratio, calculated as follows:
[0033]
[0034] In the formula, area(box) k ∪box i () represents the current box to be merged. k The area of the box to be merged with other boxes to be merged;
[0035] Next, Fusion will be applied to all filtered boxes to be merged. filter Intersecting bounding boxes are fused to obtain an accurate, high-resolution detection result image, which is relevant to the i-th bounding box. i Intersecting with the j-th target box j The coordinates of the top-left and bottom-right corners of the merged target bounding box are represented as follows:
[0036] (min(x i L ,x j L),min(y i L ,y j L ))
[0037] (max(x i R ,x j R ),max(y i R ,y j R ))
[0038] In the formula, (x i L ,y i L ) and (x i R ,y i R ) are represented as boxes i The coordinates of the top left corner and the bottom right corner (x j L ,y j L ) and (x j R ,y j R ) are represented as boxes j The coordinates of the top left and bottom right corners; min(·) and max(·) represent selecting the minimum value and the maximum value, respectively.
[0039] This invention uses an area-based approach to remove unnecessary small bounding boxes in overlapping regions, preventing the over-retention of small bounding boxes while large targets are falsely filtered out. Simultaneously, the invention employs empirically set IoA and overlapping region area ratio thresholds to effectively ensure accurate extraction of small bounding boxes within overlapping regions, reducing the risk of false rejection and improving the detection accuracy of small targets. Furthermore, the set IoU threshold ensures the accuracy of multi-target detection, preventing the false fusion of independent targets and guaranteeing that large targets can still be completely detected when spanning multiple slices.
[0040] Furthermore, the specific calculation for the overlapping cut is as follows:
[0041] I slide ={img i,j =Crop((w x (i),h y (j)),(w,h))|i∈[0,n x -1],j∈[0,n y -1]}
[0042] In the formula, I slide This is a collection of several small, overlapping images to be detected; img i,j This represents the small-sized overlapping image to be detected in the i-th row and j-th column; Crop((w x (i),h y (j)), (w,h)) represent the starting position (w) of the high-resolution image to be detected. x (i),h y (j)) Begin cutting, and cut out a small overlapping image to be inspected with dimensions w×h; w x (i) And obtained by calculation in the following way:
[0043] w x (i) = i × w × (1 - th)
[0044] In the formula, w is the preset cutting width; th is the threshold of the overlapping area of the cut; and h y (j) is obtained by calculation in the following manner:
[0045] h y (j)=j×h×(1-th)
[0046] In the formula, h is the preset cutting height.
[0047] This invention improves the coverage of targets by overlapping segmentation. Especially when the target spans multiple image blocks, the overlapping area acts as a buffer to prevent the target from being lost due to image segmentation. At the same time, it improves the coverage of target detection and ensures the continuity and accuracy of target detection.
[0048] Furthermore, before employing the target detection model, several small-sized overlapping images to be detected are grouped according to the number of threads, and the grouped small-sized overlapping images to be detected are assigned to the target detection model in the corresponding thread for detection; after the detection is completed, the detection results in all threads are summarized to obtain several small-sized detection result images;
[0049] The number of threads is a preset parameter.
[0050] This invention effectively enhances the parallel processing capability of detection by grouping several small-sized overlapping images to be detected and distributing them to a multi-threaded object detection model. This significantly accelerates the detection speed of high-resolution images and ensures efficient processing of large-scale image processing tasks. Furthermore, the multi-threaded approach allows the object detection model to be deployed on different devices, achieving distributed processing and significantly accelerating the processing of large-scale images. It also enables the object detection model to adapt to various hardware environments and application scenarios.
[0051] An engineering target detection device for high-resolution images includes an image overlap and cutting unit, an image detection unit, an image stitching unit, and a target bounding box fusion unit;
[0052] The image overlap cutting unit is used to overlap and cut a high-resolution image to be detected to obtain several small-sized overlapping images to be detected.
[0053] The image detection unit is used to detect several small-sized overlapping images to be detected using a target detection model, and obtain several small-sized detection result images.
[0054] The image stitching unit is used to stitch together several small-sized detection result images to obtain a high-resolution detection result image.
[0055] The target bounding box fusion unit is used to sequentially filter and fuse the overlapping areas of the high-resolution detection result image using an area-based target bounding box fusion strategy to obtain an accurate high-resolution detection result image.
[0056] The area-based fusion box strategy involves filtering based on the area ratio of the target box to the overlapping region, the area ratio between target boxes, and the intersection-union ratio between target boxes.
[0057] Furthermore, the target box fusion unit includes an overlapping region analysis module, a target box filtering module, and a target box fusion module;
[0058] The overlapping region analysis module is used to perform overlapping region analysis on the high-resolution detection result image to obtain several bounding boxes to be analyzed; wherein, the overlapping region analysis is represented as:
[0059] overlap={area i ∪area j |i∈[1,n x -1],j∈[1,n y -1]}
[0060] In the formula, overlap is the set of all overlapping regions; area i and area j These are the horizontal and vertical overlapping regions, respectively; n x and n y The number of horizontal and vertical cut blocks in the small-sized overlapping image to be detected are respectively calculated as follows:
[0061]
[0062] In the formula, W and H are the width and height of the high-resolution image to be detected, respectively; This is for rounding up; w and h are the width and height of the small overlapping images to be detected, respectively; th is the threshold for the overlapping region to be cut.
[0063] Next, the target bounding boxes intersecting with all overlapping regions are obtained, resulting in several bounding boxes to be analyzed, specifically represented as follows:
[0064] Box = {box k |box k ∩overlap}
[0065] In the formula, Box represents the set of all boxes to be analyzed; k ∩overlap represents the k-th bounding box. k There exists a geometric intersection with any overlapping region; where k∈N, and N is the total number of target boxes that intersect with all overlapping regions;
[0066] The target box filtering module is used to filter several boxes to be analyzed using area-based nonmaximum suppression to obtain several boxes to be merged.
[0067] The specific operation of filtering based on area-based nonmaximum suppression is as follows:
[0068]
[0069] In the formula, Fusion box This is the set of all boxes to be fused; remove(·) is used to remove the input boxes to be analyzed from the high-resolution detection result image; keep(·) is used to keep the input boxes to be analyzed in the high-resolution detection result image; The current box to be analyzed k The area of intersection with the overlapping region and the box to be analyzed k The ratio between the areas; while IoA is the current box to be analyzed. k The area ratio to other bounding boxes to be analyzed is expressed as follows:
[0070]
[0071] In the formula, area(box) k ∩box i () indicates the current box to be analyzed. k The area of intersection with other boxes to be analyzed; area(box) k () represents the current box to be analyzed. k The area;
[0072] The target bounding box fusion module is used to filter several bounding boxes to be fused by cross-intersection over union (CUI), and then fuse the filtered bounding boxes to obtain an accurate high-resolution detection result image; wherein, the specific operation of filtering by CUI is as follows:
[0073]
[0074] In the formula, Fusion filter This is the set of all filtered boxes to be merged; IoU is the intersection-over-union ratio, calculated as follows:
[0075]
[0076] In the formula, area(box) k ∪box i () represents the current box to be merged. k The area that is merged with other frames to be merged.
[0077] Next, Fusion will be applied to all filtered boxes to be merged. filter Intersecting bounding boxes are fused to obtain an accurate, high-resolution detection result image, which is relevant to the i-th bounding box. i Intersecting with the j-th target box j The coordinates of the top-left and bottom-right corners of the merged target bounding box are represented as follows:
[0078] (min(x i L ,x j L ),min(y i L ,y j L ))
[0079] (max(x i R ,x j R ),max(y i R ,y j R ))
[0080] In the formula, (x i L ,y i L ) and (x i R ,y i R ) are represented as boxes i The coordinates of the top left corner and the bottom right corner (x jL ,y j L ) and (x j R ,y j R ) are represented as boxes j The coordinates of the top left and bottom right corners; min(I) and max(·) represent selecting the minimum value and selecting the maximum value, respectively.
[0081] Furthermore, the image overlap cutting unit includes an overlap cutting module for performing overlap cutting, the specific calculation of which is as follows:
[0082] I slide ={img i,j =Crop((w x (i),h y (j)),(w,h))|i∈[0,n x -1],j∈[0,n y -1]}
[0083] In the formula, I slide This is a collection of several small, overlapping images to be detected; img i,j This represents the small-sized overlapping image to be detected in the i-th row and j-th column; Crop((w x (i),h y (j)), (w,h)) represent the starting position (w) of the high-resolution image to be detected. x (i),h y (j)) Begin cutting, and cut out a small overlapping image to be inspected with dimensions w×h; w x (i) And obtained by calculation in the following way:
[0084] w x (i) = i × w × (1 - th)
[0085] In the formula, w is the preset cutting width; th is the threshold of the overlapping area of the cut; and h y (j) is obtained by calculation in the following manner:
[0086] h y (j)=j×h×(1-th)
[0087] In the formula, h is the preset cutting height.
[0088] Furthermore, the engineering target detection device for high-resolution images also includes a thread counting unit, which is used to group several small-sized overlapping images to be detected according to the number of threads before using the target detection model, and to assign the grouped small-sized overlapping images to the target detection model in the corresponding thread for detection; after the detection is completed, the detection results in all threads are summarized to obtain several small-sized detection result images.
[0089] The number of threads is a preset parameter.
[0090] To better understand and implement this invention, the following detailed description is provided in conjunction with the accompanying drawings. Attached Figure Description
[0091] Figure 1 This is a schematic diagram of the overall structure of the engineering target detection device for high-resolution images according to the present invention;
[0092] Figure 2 This is a schematic diagram of the overall process of the high-resolution image engineering target detection method described in this invention;
[0093] Figure 3 A simplified schematic diagram illustrating the bounding boxes of different targets in an overlapping region;
[0094] Figure 4 and Figure 5 This is a schematic diagram illustrating the comparison between the high-resolution image engineering target detection method of the present invention and other detection methods. Detailed Implementation
[0095] To address the problem in existing technologies where the complete bounding box of a target located at the edge of an overlapping slice is easily misfiltered, resulting in the target box not accurately fitting the target area, this invention performs overlapping and segmentation on a high-resolution image to be detected, obtaining several smaller overlapping images. A target detection model is then used to detect these smaller overlapping images, resulting in several smaller detection result images. These smaller detection result images are then stitched together to generate a high-resolution detection result image. An area-based bounding box fusion strategy is employed to analyze, filter, and fuse the overlapping areas to generate an accurate high-resolution detection result image. Therefore, this invention uses an area-based bounding box fusion strategy to ensure that targets at the edge are not misfiltered due to traditional NMS (Non-Maximum Detection System), and the fusion of bounding boxes ensures accurate fitting of the target area, thereby improving the accuracy and reliability of target detection results at high resolution.
[0096] Please also refer to Figure 1 and Figure 2 , Figure 1 This is a schematic diagram of the overall structure of the engineering target detection device for high-resolution images according to the present invention. Figure 2 This is a schematic diagram of the overall process of the high-resolution image engineering target detection method described in this invention.
[0097] Based on the above design, this invention proposes a method for detecting engineering targets in high-resolution images, and based on this method, proposes a device for detecting engineering targets in high-resolution images.
[0098] The high-resolution image engineering target detection device includes an image overlap cutting unit 1, an image detection unit 2, an image stitching unit 3, and a target box fusion unit 4.
[0099] The image overlap cutting unit 1 is used to perform step S1: overlap cutting of the high-resolution image to be detected to obtain several small-sized overlap images to be detected.
[0100] Specifically, the calculation for the overlapping cut is as follows:
[0101] I slide ={img i,j =Crop((w x (i),h y (j)),(w,h))|i∈[0,n x -1],j∈[0,n y -1]}
[0102] In the formula, I slide This is a collection of several small, overlapping images to be detected; img i,j This represents the small-sized overlapping image to be detected in the i-th row and j-th column; Crop((w x (i),h y (j)), (w,h)) represent the starting position (w) of the high-resolution image to be detected. x (i),h y (j)) Begin cutting, and cut out a small overlapping image to be inspected with dimensions w×h; w x (i) And obtained by calculation in the following way:
[0103] w x (i) = i × w × (1 - th)
[0104] In the formula, w is the preset cutting width; th is the threshold for the overlapping area of the cut, which defaults to 0.2; and h y (j) is obtained by calculation in the following manner:
[0105] h y (j)=j×h×(1-th)
[0106] In the formula, h is the preset cutting height; and n x and n yThe number of horizontal and vertical cut blocks in the small-sized overlapping image to be detected are respectively calculated as follows:
[0107]
[0108] In the formula, W and H are the width and height of the high-resolution image to be detected, respectively; This is a rounding up operation.
[0109] When a target in a high-resolution image to be detected is located at the edge of a slice or spans multiple slices, some targets may be missed due to the slice being cut off, thus affecting the accuracy of the target detection model. Therefore, this invention uses overlapping slices to ensure that when a target in a high-resolution image to be detected is located at the edge of a slice, the target detection model will not experience loss, missed detection, or false detection.
[0110] The image detection unit 2 is used to perform step S2: using a target detection model to detect several small-sized overlapping images to be detected, and obtain several small-sized detection result images.
[0111] Specifically, the detection operation is represented as follows:
[0112] R small ={r i,j =Model(I slide )|i∈[0,n x -1],j∈[0,n y -1]}
[0113] In the formula, R small A collection of several small-sized test result images; r i,j The image is represented as the small-sized detection result image in the i-th row and j-th column; Model(·) represents the object detection model, which can be YOLOv10 (You Only Look Once version 10). The object detection model includes a backbone network, a neck network, and a probe network. The backbone network is used to continuously extract features from the input small-sized overlapping image to be detected, obtaining shallow and medium-level feature maps. It then performs feature extraction and spatial feature pyramid pooling on the medium-level feature map to obtain a deep feature map. The neck network is used to fuse the shallow, medium, and deep feature maps using a feature pyramid to obtain a shallow, medium, and deep fused feature map. The probe network is used to classify and locate the shallow, medium, and deep fused feature maps respectively, obtaining small, medium, and large-scale detection results. All detection results are then integrated to obtain the small-sized detection result image.
[0114] In order to enable the target detection model to effectively detect engineering targets, this embodiment further trains the target detection model.
[0115] In the training preparation stage, this invention processes a batch of high-resolution engineering construction images through step S1 to obtain several small-sized overlapping images to be detected. Then, by manually or using annotation tools, the targets in the several small-sized overlapping images to be detected are selected and corresponding labels are added to generate training sets, test sets, and validation sets.
[0116] In the first stage of training, the original small-sized overlapping images to be detected from the training set are input into the object detection model for object detection to obtain small-sized detection result images. The localization loss function and classification loss function are used to calculate the loss values of the small-sized detection result images and the corresponding bounding boxes and labels in the training set, respectively. The weights of the current object detection model are updated according to the loss values.
[0117] The localization loss function can be calculated using different intersection-union ratio losses such as IOU loss, GIOU loss, CIOU loss, or EIOU loss; the classification loss function can be the cross-entropy loss function. The specific loss function can be adjusted according to the actual application scenario, and this invention does not specifically limit the choice of its loss function.
[0118] In the second stage of training, the original small target overlapping images from the validation set are input into the target detection model for target detection to obtain small-sized detection result images. The small-sized detection result images are then compared with the target boxes and labels in the validation set to calculate the accuracy and determine whether the accuracy meets a training threshold. If not, the training returns to the first stage; if so, the training proceeds to the third stage.
[0119] The training threshold is a custom standard, which can be the convergence of the loss value of the validation set or the achievement of a set standard, such as the number of training epochs.
[0120] In the third stage of training, the original small target overlapping images from the test set are input into the target detection model for target detection to obtain small-sized detection result images; and it is determined whether the current small-sized detection result image meets a detection criterion; if not, the training is returned to the first stage; if yes, the training is completed and the final target detection model is obtained.
[0121] In this embodiment, the detection standard requires the target detection model to achieve a detection rate of at least 70% and a false negative rate of less than 5% in the validation set, so as to ensure that subsequent box fusion can meet the expected standard of engineering detection. However, this standard is set according to actual application requirements, and the present invention does not limit the setting of its detection standard.
[0122] Since there are many object detection models to choose from, such as the R-CNN series, YOLO series, SSD series and Swim-Transformer, YOLOv10 was selected in this embodiment. However, in actual applications, other models can be replaced as needed. Therefore, this invention does not limit the specific object detection model.
[0123] Furthermore, before adopting the target detection model, several small-sized overlapping images to be detected are grouped according to the number of threads, and the grouped small-sized overlapping images to be detected are assigned to the target detection model in the corresponding thread for detection; after the detection is completed, the detection results in all threads are summarized to obtain several small-sized detection result images.
[0124] The number of threads is a preset parameter that can be customized based on actual device resources. By using multiple threads to detect several small-sized overlapping images to be detected, the speed of data processing and model inference can be accelerated.
[0125] Furthermore, since the primary detection target of this invention is engineering objectives, which typically possess regular geometric shapes, while instance segmentation can accurately delineate target boundaries and easily resolve overlap issues through semantic similarity / fusion, overly precise target boundaries are actually detrimental to subsequent area calculations and construction planning in engineering detection. Therefore, rectangular target boxes can more concisely represent engineering target areas, and compared to instance segmentation, they require fewer computational resources. Accordingly, this invention uses rectangular target boxes to represent construction areas to simplify the detection process and ensure that the detection results can be directly applied to engineering planning and decision-making, thereby providing effective information for subsequent resource allocation and construction management.
[0126] The image stitching unit 3 is used to perform step S3: stitching together several small-sized detection result images to obtain a high-resolution detection result image.
[0127] Specifically, the splicing combination is represented as follows:
[0128]
[0129] In the formula, R full The image shows a high-resolution detection result image containing several detection targets. This is a translation operation used to move small-sized detection result images r. i,j The starting coordinates (w) of the translation to global coordinates x (i),h y (j)) thus enabling the splicing and combination of small-sized detection result images; This is used to represent shifting all small-sized detection result images sequentially to the global coordinate position according to indices i and j, forming a large image.
[0130] Accordingly, by stitching together the small-sized detection result images after detection according to the rules of overlapping slices, the situation of target omission or discontinuous detection caused by the segmentation of small-sized detection result images is avoided, and the global target detection results of the large-resolution image to be detected are effectively restored, ensuring the integrity and accuracy of the overall detection of the large-resolution image.
[0131] The target box fusion unit 4 is used to perform step S4: using an area-based target box fusion strategy to sequentially filter and fuse the overlapping areas of the high-resolution detection result image to obtain an accurate high-resolution detection result image.
[0132] Specifically, the area-based fusion box strategy involves filtering based on the area ratio of the target box to the overlapping region, the area ratio between target boxes, and the intersection-union ratio between target boxes, thereby determining the target boxes that need to be retained, deleted, or fused.
[0133] The target box fusion unit 4 includes an overlapping region analysis module 41, a target box filtering module 42, and a target box fusion module 43.
[0134] The overlapping region analysis module 41 is used to perform step S41: perform overlapping region analysis on the high-resolution detection result image to obtain several boxes to be analyzed.
[0135] Specifically, the overlapping region analysis can be expressed as:
[0136] overlap={area i ∪area j |i∈[1,n x -1],j∈[1,n y -1]}
[0137] In the formula, overlap is the set of all overlapping regions; area i and area j These are the horizontal and vertical overlapping regions, respectively. Next, the bounding boxes intersecting all overlapping regions are obtained, resulting in several boxes to be analyzed, specifically represented as follows:
[0138] Box = {box k |box k ∩overlap}
[0139] In the formula, Box represents the set of all boxes to be analyzed; k ∩overlap represents the k-th bounding box. k There exists a geometric intersection with any overlapping region; where k∈N, and N is the total number of target boxes that intersect with all overlapping regions.
[0140] Because of the existence of overlapping areas, meaning that the same target may be detected multiple times, it is necessary to focus on extracting the target bounding boxes in the overlapping areas to analyze the phenomenon of target overlap.
[0141] The target box filtering module 42 is used to perform step S42: filter several boxes to be analyzed by using area-based nonmaximum suppression to obtain several boxes to be merged.
[0142] Specifically, the filtering operation based on area-based nonmaximum suppression is as follows:
[0143]
[0144] In the formula, Fusion box This is the set of all boxes to be fused; remove(·) is used to remove the input boxes to be analyzed from the high-resolution detection result image; keep(·) is used to keep the input boxes to be analyzed in the high-resolution detection result image; The current box to be analyzed k The area of intersection with the overlapping region and the box to be analyzed k The ratio between the areas; while IoA is the current box to be analyzed. k The area ratio to other bounding boxes to be analyzed is expressed as follows:
[0145]
[0146] In the formula, area(box) k ∩box i () indicates the current box to be analyzed. k The area of intersection with other boxes to be analyzed; area(box) k () represents the current box to be analyzed. k The area.
[0147] In the overlapping region, the target bounding box mainly falls into two different categories, such as Figure 3 As shown, these are the bounding boxes corresponding to the small and large targets in the overlapping area:
[0148] For small targets, since most of the area of the target is in the overlapping region, it can be assumed that there is a target box that almost completely covers the small target. Therefore, we only need to remove the target boxes with smaller areas and keep the target boxes with the largest areas to obtain a target box that completely fits the current small target.
[0149] For large targets, especially when they span overlapping areas, a single bounding box cannot completely fit the entire target. Therefore, these bounding boxes will be marked as boxes to be merged after filtering, for further analysis and processing in subsequent steps.
[0150] The target box fusion module 43 is used to perform step S43: filtering several boxes to be fused by cross-joining comparison, and fusing the filtered boxes to be fused to obtain an accurate high-resolution detection result image.
[0151] Specifically, the filtering operation based on the intersection-union ratio is as follows:
[0152]
[0153] In the formula, Fusion filter This is the set of all filtered boxes to be merged; IoU is the intersection-over-union ratio, calculated as follows:
[0154]
[0155] In the formula, area(box) k ∪box i () represents the current box to be merged. k The area that is merged with other frames to be merged.
[0156] Next, Fusion will be applied to all filtered boxes to be merged. filter Intersecting bounding boxes are fused to obtain an accurate, high-resolution detection result image, which is relevant to the i-th bounding box. i Intersecting with the j-th target box j The coordinates of the top-left and bottom-right corners of the merged target bounding box are represented as follows:
[0157] (min(x i L ,x j L ),min(y i L ,y j L ))
[0158] (max(x i R ,x j R ),max(y i R ,y j R ))
[0159] In the formula, (x i L ,y i L ) and (x i R ,y i R) are represented as boxes i The coordinates of the top left corner and the bottom right corner (x j L ,y j L ) and (x j R ,y j R ) are represented as boxes j The coordinates of the top left and bottom right corners; min(·) and max(·) represent selecting the minimum value and the maximum value, respectively.
[0160] Since bounding boxes of large targets in overlapping regions are prone to overlap due to cross-regional issues, this invention excludes detection boxes of small targets and further analyzes and filters the boxes to be fused using the Cross-Union Ratio (CUI). Through actual testing, this invention found that when the CUI between the boxes to be fused is less than 0.5, the two boxes are considered to represent detection results of different targets, thus requiring no further fusion; however, when the CUI between the boxes to be fused is greater than or equal to 0.5, the two boxes are considered to represent detection results of the same target, and therefore, the two boxes need to be fused. This invention dynamically adjusts the boundaries of the bounding boxes by using the maximum and minimum values of the upper left and lower right corners, thereby automatically adapting to the fusion of multiple bounding boxes under large targets, thus optimizing the detection efficiency and localization accuracy of existing target detection models for high-resolution images.
[0161] Compared to existing technologies, this invention analyzes the bounding boxes of overlapping regions using area-based nonmaximum suppression. While eliminating useless overlapping boxes, it ensures that even small targets located at the edge of slices are correctly bounded, thus significantly improving the accuracy of target detection models in complex scenes. Simultaneously, this invention filters the boxes to be fused using intersection-union ratio (IoU) and performs fusion processing, ensuring that large targets, even those spanning multiple slice regions, can still be completely detected, avoiding incomplete target box segmentation. This strategy significantly improves the detection accuracy of large targets in high-resolution images, particularly excelling in complex engineering scenarios.
[0162] In addition, since the present invention uses an overlapping slicing method to perform target detection on a small-sized image to be detected, even if the target is located in multiple slice regions, as long as the target is successfully detected in any small image, it can be framed and accurately presented in the high-resolution detection result image through an area-based target box fusion strategy. This reduces the possibility of missed detection due to detection errors or the target spanning multiple slices, thereby significantly improving the target detection rate, which reaches 98%.
[0163] Please also refer to Figure 4 and Figure 5 In the figure, labels 1, 2 and 3 are comparison figures of not analyzing overlapping areas, processing overlapping areas with NMS, and processing with the area-based target box fusion strategy of the present invention, respectively. It can be seen that label 3 can more accurately frame the target and does not have overlapping target boxes.
[0164] Based on the same inventive concept, this application also provides an electronic device, which can be a server, desktop computing device, or mobile computing device (e.g., laptop computing device, handheld computing device, tablet computer, netbook, etc.). The device includes one or more processors and a memory, wherein the processor is used to execute a program to implement the engineering target detection method for high-resolution images according to embodiments of the present invention; the memory is used to store computer programs executable by the processor.
[0165] Based on the same inventive concept, this application also provides a computer-readable storage medium corresponding to the aforementioned embodiments of the engineering target detection method for high-resolution images. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the steps of the engineering target detection method for high-resolution images described in any of the above embodiments.
[0166] This application may take the form of a computer program product implemented on one or more storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing program code. Computer storage media include permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information may be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to: phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.
[0167] The embodiments described above are merely examples of several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and the present invention also intends to include these modifications and variations.
Claims
1. A method of engineering target detection of a large resolution image, characterized in that, The method comprises the following steps: S1: performing overlapping cutting on a large-resolution to-be-detected image to obtain a plurality of small-size overlapping to-be-detected images; S2: detecting the plurality of small-size overlapping to-be-detected images by using a target detection model to obtain a plurality of small-size detection result images; S3: performing splicing combination on the plurality of small-size detection result images to obtain a large-resolution detection result image; S4: performing filtering and frame fusion on overlapping areas of the large-resolution detection result image in sequence by using an area-based target frame fusion strategy to obtain an accurate large-resolution detection result image; The area-based fusion frame strategy is screening according to an area ratio of target frames to overlapping areas, an area ratio between target frames, and an intersection-over-union ratio between target frames; The step S4 comprises the following sub-steps: S41: performing overlapping area analysis on the large-resolution detection result image to obtain a plurality of to-be-analyzed frames; S42: filtering the plurality of to-be-analyzed frames by using area-based non-maximum suppression to obtain a plurality of to-be-fused frames; The specific operation of the area-based non-maximum suppression filtering is as follows: wherein, is a set of all to-be-fused boxes; is used to eliminate the input to-be-analyzed box from the high-resolution detection result map; is used to retain the input to-be-analyzed box to the high-resolution detection result map; is the current to-be-analyzed box is the ratio between the intersection area of the overlapping region and the area of the to-be-analyzed box ; and is the area ratio of the current to-be-analyzed box to other to-be-analyzed boxes, and is specifically represented as follows: wherein represents the current frame to be analyzed intersection area with other frames to be analyzed; is the area of the current frame to be analyzed is the area of the current frame to be analyzed S43: filtering the plurality of to-be-fused frames by using the intersection-over-union ratio, and fusing the filtered to-be-fused frames to obtain the accurate large-resolution detection result image.
2. The engineering target detection method for a large-resolution image according to claim 1, characterized in that: In the step S41, the overlapping area analysis is represented as: wherein, is the set of all overlapping regions; and are the horizontal and vertical overlapping regions, respectively; and are the number of horizontal and vertical cutting blocks of the small size overlapping image to be detected, respectively, and are calculated as follows: wherein, and are respectively the width and the height of the large resolution image to be detected; is a rounding up operation; and are respectively the width and the height of the small size overlapping image to be detected; is the threshold of the overlapping area of the cut. Then, target frames intersecting with all overlapping areas are obtained to obtain a plurality of to-be-analyzed frames, which are specifically represented as: wherein, represents a set of all bounding boxes to be analyzed; represents the number of target boxes that are geometrically intersected with any overlapping region; wherein, its total number of target boxes that are intersected with all overlapping regions; In the step S43, the specific operation of filtering by using the intersection-over-union ratio is as follows: wherein is the set of all filtered to-be-fused frames; is the intersection over union, calculated as follows: wherein is represented as the current frame to be merged area of the current frame to be merged Next, all filtered target frames to be fused are merged The target frames are intersected and merged to obtain an accurate high-resolution detection result map, which is for the first target frame The top-left and bottom-right coordinates of the merged target frame are represented as: the first target frame the first target frame wherein and are represented as the upper left corner coordinates and the lower right corner coordinates of and are represented as the upper left corner coordinates and the lower right corner coordinates of and are represented as selecting the minimum value and selecting the maximum value. 3. The method of claim 2, wherein, The specific calculation of the overlapping cutting is as follows: wherein is a set of small size overlapping sub-images to be detected; represents the small size overlapping sub-image in the i-th row and the j-th column; represents the small size overlapping sub-image in the i-th row and the j-th column; represents the small size overlapping sub-image in the i-th row and the j-th column; represents the small size overlapping sub-image in the i-th row and the j-th column; is cut out from the start position of the large resolution sub-image to be detected, and the small size overlapping sub-image with a size of is cut out; is obtained by calculation in the following way: wherein is a preset cut width; is a threshold value for the overlap area of the cut; and is calculated by In the formula, is a preset cutting height.
4. The method of claim 3, wherein, Before the target detection model is used, the plurality of small-size overlapping to-be-detected images are grouped according to a thread number, and the grouped plurality of small-size overlapping to-be-detected images are distributed to the target detection model in the corresponding thread for detection; after the detection is completed, the detection results in all threads are summarized to obtain the plurality of small-size detection result images; The thread number is a preset parameter.
5. An apparatus for detecting an engineering target of a large resolution image, characterized by comprising: The device comprises an image overlapping cutting unit, an image detection unit, an image splicing unit, and a target frame fusion unit; The image overlapping cutting unit is configured to perform overlapping cutting on a large-resolution to-be-detected image to obtain a plurality of small-size overlapping to-be-detected images; The image detection unit is configured to detect the plurality of small-size overlapping to-be-detected images by using a target detection model to obtain a plurality of small-size detection result images; The image splicing unit is configured to perform splicing combination on the plurality of small-size detection result images to obtain a large-resolution detection result image; The target frame fusion unit is configured to perform filtering and frame fusion on overlapping areas of the large-resolution detection result image in sequence by using an area-based target frame fusion strategy to obtain an accurate large-resolution detection result image; wherein the area-based fusion frame strategy is screening according to an area ratio of target frames to overlapping areas, an area ratio between target frames, and an intersection-over-union ratio between target frames; The target frame fusion unit comprises an overlapping area analysis module, a target frame filtering module, and a target frame fusion module; The overlap region analysis module is configured to perform overlap region analysis on the high-resolution detection result image to obtain a plurality of to-be-analyzed frames. The target frame filtering module is configured to perform filtering on the plurality of to-be-analyzed frames by using area-based non-maximum suppression to obtain a plurality of to-be-fused frames. The area-based non-maximum suppression filtering is performed in the following manner: wherein, is a set of all to-be-fused boxes; is used to eliminate the input to-be-analyzed box from the high-resolution detection result map; is used to retain the input to-be-analyzed box to the high-resolution detection result map; is the current to-be-analyzed box is the ratio between the intersection area of the overlapping region and the area of the to-be-analyzed box ; and is the area ratio of the current to-be-analyzed box to other to-be-analyzed boxes, and is specifically represented as follows: wherein represents the current frame to be analyzed the intersection area with other frames to be analyzed; is the area of the current frame to be analyzed ; The target frame fusion module is configured to perform filtering on the plurality of to-be-fused frames by using intersection over union, and fuse the filtered to-be-fused frames to obtain an accurate high-resolution detection result image.
6. The engineering target detection device for high-resolution images according to claim 5, characterized in that: The overlap region analysis is expressed as: wherein, is the set of all overlapping regions; and are the horizontal and vertical overlapping regions, respectively; and are the number of horizontal and vertical cutting blocks of the small size overlapping image to be detected, respectively, and are calculated as follows: wherein, and are respectively the width and the height of the high resolution image to be detected; is a ceiling operation; and are respectively the width and the height of the small size overlapping image to be detected; is the threshold of the overlapping area of the cut. Then, the target frame intersecting with all the overlap regions is obtained to obtain a plurality of to-be-analyzed frames, which is specifically expressed as: wherein, represents a set of all bounding boxes to be analyzed; represents the number of target boxes that are geometrically intersected with any overlapping region; wherein, its total number of target boxes that are intersected with all overlapping regions; The filtering by using intersection over union is performed in the following manner: wherein is the set of all filtered to-be-fused frames; is the intersection over union, calculated as follows: wherein area of the current frame to be merged area of the current frame to be merged Next, all filtered target boxes in the to-be-fused frame are fused The target boxes intersecting with each other are fused to obtain an accurate high-resolution detection result map, which is for the first target box and the corresponding intersecting first target box The upper left corner and the lower right corner coordinates of the fused target box are represented as: wherein and respectively represent the upper left corner coordinates and the lower right corner coordinates of and respectively represent the upper left corner coordinates and the lower right corner coordinates of and respectively represent the selection of the minimum value and the selection of the maximum value. 7. The apparatus for engineering target detection of large resolution images of claim 6, wherein, The image overlap cutting unit comprises an overlap cutting module configured to perform overlap cutting, and the specific calculation is as follows: wherein is a set of small-size overlapping sub-images to be detected; represents the small-size overlapping sub-image in the i-th row and the j-th column; represents the small-size overlapping sub-image in the i-th row and the j-th column; represents the small-size overlapping sub-image in the i-th row and the j-th column; represents the small-size overlapping sub-image in the i-th row and the j-th column; is cut out from the start position of the large-resolution sub-image to be detected starting from the start position of the large-resolution sub-image to be detected is calculated by wherein is a preset cut width; is a threshold value for the overlap area of the cuts; and is calculated by In the formula, is a preset cutting height.
8. The apparatus for engineering target detection of large resolution images of claim 7, wherein, Further comprising a thread number unit configured to group a plurality of small-size overlap to-be-detected images according to a thread number before using the target detection model, and distribute the grouped plurality of small-size overlap to-be-detected images to the target detection model in the corresponding thread for detection; after the detection is completed, the detection results in all threads are summarized to obtain a plurality of small-size detection result images. The thread number is a preset parameter.
9. An electronic device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the engineering target detection method for high-resolution images according to any one of claims 1 to 4 when executing the computer program.
10. A computer-readable storage medium storing computer-executable instructions, the computer-executable instructions comprising: The computer executable instructions are used for the engineering target detection method for high-resolution images according to any one of claims 1 to 4.
Citation Information
Patent Citations
Target detection method and target detection device for wide-field-of-view image
CN117079217A